Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move FLOAT_CMP upstream and/or combine with numpy/scipy? #55

Open
mhvk opened this issue Mar 19, 2019 · 5 comments
Open

Move FLOAT_CMP upstream and/or combine with numpy/scipy? #55

mhvk opened this issue Mar 19, 2019 · 5 comments
Labels

Comments

@mhvk
Copy link
Contributor

mhvk commented Mar 19, 2019

As noted originally in astropy/astropy#6554, numpy was thinking about their own version of something like FLOAT_CMP and ended up adapting scipy's refguide [1] for its docstring testing. It includes float comparisons and "numbers may vary". We should check whether we can also use this, to make the ecosystem a bit more uniform. In this respect, probably good to remember that this was put also to python-ideas by @kdavies4 with Coghlan concluding it was a good idea [2]. (See also numpy/numpy#9415 (comment))

[1] https://github.com/scipy/scipy/blob/master/tools/refguide_check.py
[2] https://mail.python.org/pipermail/python-ideas/2014-August/028559.html

@drdavella
Copy link
Contributor

I'd be in favor, especially given the fact that we recently discovered some issues with the way that FLOAT_CMP interacts with other doctest flags. See #54.

@hameerabbasi
Copy link

This is something that would be very useful. I can look into it, definitely. 😄

@nstarman
Copy link

Pytest has added NUMBER (see https://docs.pytest.org/en/6.2.x/doctest.html?highlight=doctest#using-doctest-options). Maybe FLOAT_CMP can just be a thin redirect to that?

@pllim
Copy link
Contributor

pllim commented May 30, 2023

I think we decided that NUMBER isn't as flexible as we need it to be (we support atol and rtol here, but it does not).

Superseded by #199

@pllim pllim closed this as not planned Won't fix, can't repro, duplicate, stale May 30, 2023
@mhvk
Copy link
Contributor Author

mhvk commented May 30, 2023

Let's keep this open for the moment, since perhaps NUMBER is really good enough: its atol is just set by the last digit, so adjustable in that sense.

@mhvk mhvk reopened this May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants