-
-
Notifications
You must be signed in to change notification settings - Fork 526
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 complex handling of libs/pynac/py_float() #23077
Comments
Commit: |
comment:3
BTW, the numeric doctest changes have better accuracy, so consider it a bug fix for inaccurate results as well. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Author: Ralf Stephan |
comment:6
Is it ever (natually) possible for the parent to not have a |
comment:7
Replying to @tscrim:
Try |
comment:8
So could we get into a situation where this raises an diff --git a/src/sage/functions/orthogonal_polys.py b/src/sage/functions/orthogonal_polys.py
index 931b247..51da378 100644
--- a/src/sage/functions/orthogonal_polys.py
+++ b/src/sage/functions/orthogonal_polys.py
@@ -1942,7 +1942,10 @@ class Func_jacobi_P(OrthogonalFunction):
prec = the_parent.precision()
BF = CBF(prec+5)
ret = BF(x).jacobi_P(BF(n), BF(a), BF(b))
- return the_parent(ret)
+ try:
+ return the_parent(ret)
+ except (TypeError, ValueError):
+ return the_parent.complex_field()(ret)
jacobi_P = Func_jacobi_P()
Should we catch the error? |
comment:10
I agree this should be consistent and did so. Should there be a ticket for |
Reviewer: Travis Scrimshaw |
comment:11
I'm not sure. However, it is good that we are consistent now. Positive review. |
comment:12
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:14
Also |
comment:15
Ah no, further repercussions, sorry. |
comment:16
Reason is interval fields do not have a |
comment:17
Oh, ball fields have it neither. Their elements will all fail conversion to float/complex. Seriously. |
Dependencies: #23145 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:22
|
Changed branch from u/rws/fix_complex_handling_of_libs_pynac_py_float__ to |
The goal is to always return some float, either real or complex but:
The code shows it's only done if there is no parent given:
The ticket should make it possible to fall back on the associated complex field of any parent.
Depends on #23145
Component: interfaces
Author: Ralf Stephan
Branch/Commit:
856f8dd
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/23077
The text was updated successfully, but these errors were encountered: