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
Fix use of scipy rtol parameter #22439
Comments
Author: Ximin Luo |
Commit: |
This comment has been minimized.
This comment has been minimized.
New commits:
|
comment:4
This seems a bit over-engineered to me. What exactly is the problem? |
comment:5
I mean: why not just change the default value of |
comment:6
Oh, that is because An alternative is to define |
comment:7
Replying to @infinity0:
Why is that needed? Why not just change the default value and nothing else? |
comment:8
To change the default value in both locations as you're suggesting, I would have to write The definition comes from the documentation of scipy yet is a calculation on a numpy architecture-dependent property. (The docs say It's unfortunate that scipy don't expose the value themselves. Actually, I will send a patch to them for that, when I next get some time. I just noticed again that it's available as In the meantime, shall I do it your way and duplicate the definitions? |
comment:9
Are you sure that this value is architecture-dependent? I think it's just the constant |
comment:10
I'm not confident how architecture-dependent this is; numpy themselves perform quite a long complex calculation in I think it would be safer to use the symbolic value as indicated in the scipy documentation, than try to guess that it might be architecture-dependent. (It's true that Sage only works on x86 and x64 right now, but there's no need to add more obstacles to portability.) |
comment:11
Replying to @infinity0:
Sage doesn't "think" it's a different value, Sage just hardcodes a different number. So why does this default value for |
comment:12
It needs to be greater than the documented minimum, otherwise we get errors. From the documentation: rtol [..] cannot be smaller than its default value of |
comment:13
Replying to @infinity0:
According to Wikipedia, a C |
comment:14
In other words: even though it might theoretically be architecture-dependent, in practice it's not. |
comment:15
Replying to @infinity0:
For the record: we do consider that a bug: #22280. In the past, Sage has worked on SPARC, Itanium, various kinds of PowerPCs, ARM (some of these with a few issues). |
comment:16
OK, I see
in python's |
comment:17
Replying to @infinity0:
Sounds good. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:20
Oh, I dug a bit deeper and found that scipy changed the meaning of this flag between 0.17.1 and 0.18.1. Sage's current usage is also OK for the older version but not the newer version: scipy/scipy@cbd91b9#diff-9167bb8d33bd7d9eb5e07e0ebe18e05e I'm unsure if this patch will cause any extra doctest failures for Sage upstream and scipy 0.17.1, but I guess we'll see that when a build is run. (On Debian, we are also patching some doctests to expect slightly different float results, but I can't remember which of these are caused by scipy. The differences are minute, of course.) |
comment:21
I guess it may be best to put off this change until you guys upgrade to scipy >= 0.18.1. At least, the extra doc comment I added in that commit is wrong for scipy 0.17.1. |
Reviewer: Jeroen Demeyer |
Changed branch from u/infinity0/fix_use_of_scipy_rtol_parameter to |
Otherwise it doesn't work with Debian's version of scipy
Component: interfaces
Author: Ximin Luo
Branch/Commit:
e9ebab2
Reviewer: Jeroen Demeyer
Issue created by migration from https://trac.sagemath.org/ticket/22439
The text was updated successfully, but these errors were encountered: