-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
Modularization fixes for fast_callable
interpreters
#35774
Conversation
…ubset of interpreters
@@ -174,7 +159,7 @@ def build_interp(interp_spec, dir): | |||
write_if_changed(path, method()) | |||
|
|||
|
|||
def rebuild(dirname, force=False): | |||
def rebuild(dirname, force=False, interpreters=None, distribution=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're adding arguments, can you add the missing INPUT
block that explains what they do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 12c04b8
generate_code(et, str) | ||
str.instr('return') | ||
return builder(str.get_current()) | ||
|
||
|
||
def _builder_and_stream(vars, domain): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see what's going on from the diff, but if someone comes along a year from now, this docstring isn't really going to explain what the function is doing and why. Can you expand it a little?
Also, if possible, can you test the import-failure code path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just mechanical refactoring of code that was nested a bit too deep. Let me see if I remember what it is doing, after a mere 4 days, not a year...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you test the import-failure code path?
done in afd3be6
@@ -60,14 +61,14 @@ def __init__(self): | |||
|
|||
Make sure that pow behaves reasonably:: | |||
|
|||
sage: var('x,y') | |||
sage: var('x,y') # optional - sage.symbolic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should avoid the optional tag:
from sage.ext.fast_callable import ExpressionTreeBuilder
etb = ExpressionTreeBuilder(vars=('x','y'))
x = etb.var('x')
y = etb.var('y')
ff = fast_callable(x^y, domain=RDF)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, done in 97135ad
…e of symbolics in doctest
Documentation preview for this PR (built with commit 97135ad) is ready! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, presumably you know what's going on with all_py
, and the rest LGTM.
Thank you! May I set to "positive review" then? |
Yes, it'll take me a few years to remember to do it. |
📚 Description
The code generator in
sage_setup.autogen.interpreters
can now build a subset of interpreters. This is used in #35095 to only build the interpreters forElement
andobject
in the sagemath-categories distribution.At runtime,
sage.ext.fast_callable
no longer fails when an interpreter cannot be imported but falls back to theElement
interpreter if necessary.📝 Checklist
⌛ Dependencies