Skip to content
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

Specification of math expressions #579

Merged
merged 41 commits into from
Jun 26, 2024
Merged

Specification of math expressions #579

merged 41 commits into from
Jun 26, 2024

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented May 16, 2024

Previously, the math expression syntax wasn't specified. This was very problematic, because different libraries and programming languages have different names for the same functions, and more importantly, differ in operator precedence.

👀 https://petab--579.org.readthedocs.build/en/579/documentation_data_format.html#math-expressions-syntax

Examples / test cases: https://github.com/dweindl/libpetab-python/blob/parse_math/tests/math/math_tests.yaml

dweindl added a commit to dweindl/libpetab-python that referenced this pull request May 21, 2024
Related to PEtab-dev/PEtab#579

* ANTLR grammar for PEtab math expressions + derived lexer/parser/visitor
* Test cases
* PEtab -> SymPy converter
dweindl added a commit to dweindl/libpetab-python that referenced this pull request May 22, 2024
Related to PEtab-dev/PEtab#579

* ANTLR grammar for PEtab math expressions + derived lexer/parser/visitor
* Test cases
* PEtab -> SymPy converter
@dweindl dweindl linked an issue May 23, 2024 that may be closed by this pull request
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.

🚀

doc/documentation_data_format.rst Outdated Show resolved Hide resolved
doc/documentation_data_format.rst Outdated Show resolved Hide resolved
doc/documentation_data_format.rst Outdated Show resolved Hide resolved
doc/documentation_data_format.rst Outdated Show resolved Hide resolved
doc/documentation_data_format.rst Outdated Show resolved Hide resolved
doc/documentation_data_format.rst Outdated Show resolved Hide resolved
doc/documentation_data_format.rst Outdated Show resolved Hide resolved
doc/documentation_data_format.rst Outdated Show resolved Hide resolved
doc/documentation_data_format.rst Outdated Show resolved Hide resolved
doc/documentation_data_format.rst Outdated Show resolved Hide resolved
doc/src/functions.tsv Outdated Show resolved Hide resolved
doc/src/functions.tsv Outdated Show resolved Hide resolved
doc/src/functions.tsv Outdated Show resolved Hide resolved
doc/src/functions.tsv Outdated Show resolved Hide resolved
@sebapersson sebapersson marked this pull request as ready for review June 18, 2024 17:06
@sebapersson sebapersson requested a review from a team as a code owner June 18, 2024 17:06
Copy link
Contributor

@sebapersson sebapersson left a comment

Choose a reason for hiding this comment

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

I am happy with all proposed changes, and think that the current syntax encapsulates the relevant functions.

As a potential addition, in the test-cases I just think three tests on Boolean <-> float conversion could be added (when everyone agree on that point).

@fbergmann
Copy link
Contributor

I'm happy with the proposed description. If anything I'd rename the false_value in piecewise to otherwise. But that wont do much in the end.

dweindl added a commit to PEtab-dev/petab_test_suite that referenced this pull request Jun 26, 2024
@dweindl dweindl changed the title WIP: Specification of math expressions Specification of math expressions Jun 26, 2024
@dweindl dweindl merged commit dbfc577 into release/2.0.0 Jun 26, 2024
2 checks passed
@dweindl dweindl deleted the v2_math_syntax branch June 26, 2024 14:00
dweindl added a commit to PEtab-dev/libpetab-python that referenced this pull request Jun 26, 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 PEtab-dev/petab_test_suite that referenced this pull request Jul 1, 2024
Add math expression test cases.

Related to PEtab-dev/PEtab#579
dweindl added a commit that referenced this pull request Jul 3, 2024
Previously, the math expression syntax wasn't specified. This was very problematic, because different libraries and programming languages have different names for the same functions, and more importantly, differ in operator precedence.


Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
Co-authored-by: dilpath <dilan.private+github@outlook.com>
dweindl added a commit that referenced this pull request Jul 3, 2024
Previously, the math expression syntax wasn't specified. This was very problematic, because different libraries and programming languages have different names for the same functions, and more importantly, differ in operator precedence.


Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
Co-authored-by: dilpath <dilan.private+github@outlook.com>
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.

Noise formulas should not contain spaces
4 participants