Skip to content

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented May 21, 2024

Related to PEtab-dev/PEtab#579

  • ANTLR grammar for PEtab math expressions + derived lexer/parser/visitor
  • Test cases
  • PEtab -> SymPy converter

Note: All sympy symbols in PEtab match expressions now have real=True.

dweindl added a commit to dweindl/libpetab-python that referenced this pull request May 21, 2024
Centralize sympification of PEtab and SBML math expressions.

Simplifies incorporating PEtab-dev#260

Also fixes likely collisions of model entities with sympy entities.
@dweindl dweindl mentioned this pull request May 21, 2024
dweindl added a commit that referenced this pull request May 22, 2024
Centralize sympification of PEtab and SBML math expressions.

Simplifies incorporating #260

Also fixes likely collisions of SBML model entities with sympy entities.
Related to PEtab-dev/PEtab#579

* ANTLR grammar for PEtab math expressions + derived lexer/parser/visitor
* Test cases
* PEtab -> SymPy converter
@dweindl
Copy link
Member Author

dweindl commented Jun 12, 2024

@codecov-commenter
Copy link

codecov-commenter commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 74.28256% with 233 lines in your changes missing coverage. Please review.

Project coverage is 75.68%. Comparing base (41481bb) to head (18c59e4).

Files Patch % Lines
petab/math/_generated/PetabMathExprParser.py 73.06% 140 Missing and 34 partials ⚠️
petab/math/SympyVisitor.py 69.23% 19 Missing and 21 partials ⚠️
...etab/math/_generated/PetabMathExprParserVisitor.py 61.36% 16 Missing and 1 partial ⚠️
petab/math/_generated/PetabMathExprLexer.py 96.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #260      +/-   ##
===========================================
- Coverage    76.12%   75.68%   -0.45%     
===========================================
  Files           36       40       +4     
  Lines         3238     4137     +899     
  Branches       785      891     +106     
===========================================
+ Hits          2465     3131     +666     
- Misses         568      744     +176     
- Partials       205      262      +57     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

dweindl and others added 5 commits June 26, 2024 12:57
@dweindl dweindl changed the title PoC: PEtab math parser and sympy converter Add PEtab math parser and sympy converter Jun 26, 2024
@dweindl dweindl marked this pull request as ready for review June 26, 2024 14:36
@dweindl dweindl requested a review from a team as a code owner June 26, 2024 14:36
@dweindl dweindl self-assigned this Jun 26, 2024
Copy link
Member

@dilpath dilpath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks like a nice design, thanks for setting this up. I didn't check _generated much.

This math parsing code is generally unfamiliar to me, but I didn't see anything obviously wrong, and I'm happy with the tests.

@dweindl
Copy link
Member Author

dweindl commented Jun 26, 2024

I didn't check _generated much.

Good. That's auto-generated and not really meant to be read.

Copy link
Member

@dilpath dilpath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
@dweindl dweindl merged commit f567a1e into PEtab-dev:develop Jun 26, 2024
@dweindl dweindl deleted the parse_math branch June 26, 2024 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants