sage.symbolic.function: Remove direct use of cimports from pynac
Closed this issue · 34 comments
Similar to what is done in #32391. Mechanical refactoring to use new helper functions defined in sage.symbolic.expression instead of directly cimporting from sage.libs.pynac
Preparation for #32386.
Component: symbolics
Author: Matthias Koeppe
Branch/Commit: 06e8c31
Reviewer: Jonathan Kliem
Issue created by migration from https://trac.sagemath.org/ticket/32407
Branch pushed to git repo; I updated commit sha1. New commits:
50048aa | sage.symbolic.function.Function._register_function: Refactor through new function sage.symbolic.expression.register_or_update_function |
a2f97a1 | sage.symbolic.function.GinacFunction._register_function: Refactor through sage.symbolic.expression.register_or_update_function |
Commit: a2f97a1
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
4ac54df | src/sage/symbolic/function.pyx: Replace cimport * by more specific cimport |
6f49aee | sage.symbolic.function.Function.__call__: Refactor through new helper function sage.symbolic.expression.call_by_ginac_serial |
2f92b90 | sage.symbolic.function.Function._register_function: Refactor through new function sage.symbolic.expression.register_or_update_function |
e81e6c7 | sage.symbolic.function.GinacFunction._register_function: Refactor through sage.symbolic.expression.register_or_update_function |
Branch pushed to git repo; I updated commit sha1. New commits:
d397ef1 | sage.symbolic.function: Remove unused imports, cimports |
Branch pushed to git repo; I updated commit sha1. New commits:
1c43dbe | sage.symbolic.function.{GinacFunction,BuiltinFunction}._is_registered: Refactor through new function sage.symbolic.expression.find_registered_function; remove last pynac import |
Author: Matthias Koeppe
Description changed:
---
+++
@@ -1,4 +1,4 @@
-Similar and in extension of #32391.
+Similar to what is done in #32391. Mechanical refactoring to use new helper functions defined in `sage.symbolic.expression` instead of directly `cimport`ing from `sage.libs.pynac`
Preparation for #32386.
Branch pushed to git repo; I updated commit sha1. New commits:
9d4fe5f | sage.symbolic.function: Remove unused cimport |
Reviewer: Jonathan Kliem
The cpdef functions should have doctests for coverage.
Branch pushed to git repo; I updated commit sha1. New commits:
d680c35 | sage.symbolic.expression.call_registered_function: Rename from call_by_ginac_serial |
sage: from sage.symbolic.function import BuiltinFunction
- sage: from sage.symbolic.expression import register_or_update_function, call_registered_function
sage: class Archosaurian(BuiltinFunction):
....: def __init__(self):
....: BuiltinFunction.__init__(self, 'archsaur', nargs=1)
....: def _eval_(self, x):
....: return x * exp(x)
sage: archsaur = Archosaurian() # indirect doctest
sage: archsaur(2)
2*e^2The import isn't used.
Branch pushed to git repo; I updated commit sha1. New commits:
7f1e5be | src/sage/symbolic/pynac_function_impl.pxi: Remove unused import in doctest |
patchbot is morally green (failures are from a missing docbuild on the patchbot)
Actually this ticket leads to failure of docbuild and this should be fixed.
It is fixed in #32386 and can be somewhat cherry-picked from there.
The problem seems to be with
:class:`Expression`s
This doesn't seem to work, but you can do
:class:`Expression` (Expressions)
which supposedly has Expressions as the link text
(for some reason I have fixed it with Expression's in #32386, which is wrong grammar.
Ah! Thanks for the explanation
Branch pushed to git repo; I updated commit sha1. New commits:
06e8c31 | src/sage/symbolic/pynac_function_impl.pxi: Fix doc markup |
Replying to @kliem:
Actually this ticket leads to failure of docbuild and this should be fixed.
It is fixed in #32386 and can be somewhat cherry-picked from there.
The problem seems to be with
:class:`Expression`sThis doesn't seem to work, but you can do
:class:`Expression` (Expressions)which supposedly has
Expressionsas the link text
(for some reason I have fixed it withExpression'sin #32386, which is wrong grammar.
That is also not quite correct as I believe you want
:class:`Expressions <Expression>`
to show Expressions but link to the class Expression. Although you can also do something like :class:`Expression`-s or 's, but I won't worry too much about the grammar there...
Replying to @tscrim:
Replying to @kliem:
Actually this ticket leads to failure of docbuild and this should be fixed.
It is fixed in #32386 and can be somewhat cherry-picked from there.
The problem seems to be with
:class:`Expression`sThis doesn't seem to work, but you can do
:class:`Expression` (Expressions)which supposedly has
Expressionsas the link text
(for some reason I have fixed it withExpression'sin #32386, which is wrong grammar.That is also not quite correct as I believe you want
:class:`Expressions <Expression>`to show
Expressionsbut link to the classExpression. Although you can also do something like:class:`Expression`-sor's, but I won't worry too much about the grammar there...
I see. I got confused by the documentation.
LGTM.
Thank you!
Changed branch from u/mkoeppe/sage_symbolic_function__remove_direct_use_of_cimports_from_pynac to 06e8c31