Open user202729 opened 2 weeks ago
Documentation preview for this PR (built with commit 99bce53524a82b506bde489951be933a17f5cba4; changes) is ready! :tada: This preview will update shortly after each push to this PR.
This looks nice.
It would be nicer if the new argument view_annotate
is accepted to the cell magic %%cython
. For example,
%%cython view_annotate=True
def f(int n):
...
or
%%cython --view_annotate
def f(int n):
...
The cell magic is defined in https://github.com/sagemath/sage/blob/develop/src/sage/repl/ipython_extension.py. Find the line
def cython(self, line, cell):
line
seems to accept the part after "%%cython". So we may use it to provide arguments to the cython
function. What do you think?
Already did that in https://github.com/sagemath/sage/pull/38945 . (though whichever being merged first need to be modified to incorporate the other…)
You may set #38945 as a dependency and merge it here.
and instead of
- ``line`` -- parsed as keyword arguments. See :func:`~sage.misc.cython.cython` for details.
you may at least list the possible arguments for users' convenience, leaving details to sage.misc.cython.cython
.
As in the title.
I think this is a rather common use case, to investigate whether the code does get the desired speedup.
Remark: there's
sage.misc.viewer.browser()
which could be used instead, but then a lot of existing code in SageMath useswebbrowser.open()
anyway?:memo: Checklist
Dependencies
Depends on #38945 .