Skip to content

flint.good can not be imported (python-flint 0.5) #102

Closed

Description

@TimBerberich

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.

Best,
Tim

Activity

  1. oscarbenjamin commented on Nov 1, 2023

    @oscarbenjamin
    Collaborator

    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:

    from flint.functions.showgood import good

    To make it importable at top-level it would need to be added here:

    from .functions.showgood import showgood

  2. TimBerberich commented on Nov 1, 2023

    @TimBerberich
    Author

    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 :)

  3. oscarbenjamin commented on Nov 1, 2023

    @oscarbenjamin
    Collaborator

    Okay, so there are three problems here.

    1. The docs website has not been updated since python-flint 0.3.0 (Bump version to 0.5.0 #84 (comment)).
    2. The doctests are not being checked for the rst docs.
    3. The good function was probably importable like from flint import good in previous python-flint releases.
  4. oscarbenjamin commented on Nov 1, 2023

    @oscarbenjamin
    Collaborator

    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.0
    rootdir: /home/oscar/current/active/python-flint
    plugins: hypothesis-6.84.2, cov-4.1.0, split-0.8.1, timeout-2.1.0, doctestplus-1.0.0, xdist-3.3.1
    collected 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 precision
    041     threads = 1        # max number of threads used internally
    042 
    043 The user can mutate the properties directly, for example::
    044 
    045     >>> ctx.pretty = False
    046     >>> fmpq(3,2)
    047     fmpq(3,2)
    048     >>> ctx.pretty = True
    Expected:
        3/2
    Got 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):

    >>> ctx.pretty = False
    >>> fmpq(3,2)
    fmpq(3,2)
    >>> ctx.pretty = True
    3/2

  5. TimBerberich commented on Nov 1, 2023

    @TimBerberich
    Author

    Thanks for all the effort !

  6. oscarbenjamin commented on Nov 2, 2023

    @oscarbenjamin
    Collaborator

    Thanks Tim.

    This should be fixed in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions