-
Notifications
You must be signed in to change notification settings - Fork 7
Add petab-compatible sympy string-printer #364
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #364 +/- ##
===========================================
- Coverage 74.57% 74.57% -0.01%
===========================================
Files 57 58 +1
Lines 6080 6119 +39
Branches 1058 1062 +4
===========================================
+ Hits 4534 4563 +29
- Misses 1141 1149 +8
- Partials 405 407 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5edcd58
to
522e06e
Compare
522e06e
to
cec9253
Compare
1139547
to
c15876e
Compare
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.
👍
tests/v1/math/test_math.py
Outdated
# non-real symbols are changed to real | ||
# TODO: should we raise an error instead? | ||
assert sympify_petab(sp.Symbol("x", real=False)).is_real |
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.
Probably raise an error, or does it occur in standard use?
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.
It happens if you pass sympify("x")
. Not sure what standard use will be 😅
I think, just stating that the real-assumption is applied to all inputs is sufficient.
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.
Ah, fine for me on the level of symbols. I was thinking of expressions, which I guess is irrelevant here, so nevermind.
1583431
to
e800abb
Compare
Add a sympy Printer to stringify sympy expressions in a petab-compatible way. For example, we need to avoid `str(sympy.sympify("x^2"))` -> `'x**2'`. Closes PEtab-dev#362.
e800abb
to
51c96ad
Compare
Add a sympy Printer to stringify sympy expressions in a petab-compatible way. For example, we need to avoid
str(sympy.sympify("x^2"))
->'x**2'
.Closes #362.