You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
flint.good can not be imported (python-flint 0.5) #102
Hi all,
thanks for the nice python package. I stumbled over a potential bug in the new 0.5 release.
I did install python flint 0.5 via pip install python-flint
I can import and use any sub module/function except for flint.good.
Calling from flint import good
or from flint.functions import good
throw Import errors. Importing showgood however works fine.
This is how the doctests can be run. They fail immediately:
$ pytest --doctest-glob='*.rst' doc/source/======================================== test session starts ========================================platform linux -- Python 3.11.3, pytest-7.4.0, pluggy-1.2.0rootdir: /home/oscar/current/active/python-flintplugins: hypothesis-6.84.2, cov-4.1.0, split-0.8.1, timeout-2.1.0, doctestplus-1.0.0, xdist-3.3.1collected 1 item doc/source/general.rst F [100%]============================================= FAILURES ==============================================_______________________________________ [doctest] general.rst _______________________________________039 dps = 15 # real/complex precision (in digits)040 cap = 10 # power series precision041 threads = 1 # max number of threads used internally042 043 The user can mutate the properties directly, for example::044 045 >>> ctx.pretty = False046 >>> fmpq(3,2)047 fmpq(3,2)048 >>> ctx.pretty = TrueExpected: 3/2Got nothing/home/oscar/current/active/python-flint/doc/source/general.rst:48: DocTestFailure====================================== short test summary info ======================================FAILED doc/source/general.rst::general.rst========================================= 1 failed in 0.08s =========================================
No surprise there are the doctest is wrong (it shouldn't output anything):
Activity
oscarbenjamin commentedon Nov 1, 2023
Hi Tim, thanks for testing.
Is this something that you were using in previous releases of python-flint?
I have just tested that this works with 0.5.0:
To make it importable at top-level it would need to be added here:
python-flint/src/flint/__init__.py
Line 27 in 9252d17
TimBerberich commentedon Nov 1, 2023
Hi Oscar,
no I just started playing with flint and was following the tutorial where examples for good are shown that suggest it is in the namespace of flint:
https://fredrikj.net/python-flint/general.html?highlight=good#flint.good
The import from flint.functions.showgood worked fine in my case as well :)
oscarbenjamin commentedon Nov 1, 2023
Okay, so there are three problems here.
goodfunction was probably importable likefrom flint import goodin previous python-flint releases.oscarbenjamin commentedon Nov 1, 2023
This is how the doctests can be run. They fail immediately:
No surprise there are the doctest is wrong (it shouldn't output anything):
python-flint/doc/source/general.rst
Lines 45 to 49 in 9252d17
TimBerberich commentedon Nov 1, 2023
Thanks for all the effort !
oscarbenjamin commentedon Nov 2, 2023
Thanks Tim.
This should be fixed in the next release.