Skip to content

Add petab_symbol - #563

Merged
dweindl merged 1 commit into
PEtab-dev:mainfrom
dweindl:petab-symbol
Oct 20, 2026
Merged

dweindl merged 1 commit into
PEtab-dev:mainfrom
dweindl:petab-symbol

Conversation

@dweindl

@dweindl dweindl commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Adds petab.v1.math.petab_symbol(name) (also available from petab.v2.math), which creates a sympy symbol with the same assumptions as the symbols created by sympify_petab (currently real=True).

So far, real=True was repeated wherever symbols are created to match parsed expressions. SymPy treats symbols with different assumptions as different symbols, so a mismatch makes, e.g., substitutions silently do nothing. The parser and calculate (v1 and v2) now use petab_symbol.

🤖 Generated with Claude Code

@dweindl dweindl self-assigned this Oct 20, 2026
@codecov-commenter

codecov-commenter commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.20%. Comparing base (1307856) to head (fd01339).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #563   +/-   ##
=======================================
  Coverage   78.19%   78.20%           
=======================================
  Files          68       68           
  Lines        7842     7845    +3     
  Branches     1400     1400           
=======================================
+ Hits         6132     6135    +3     
  Misses       1224     1224           
  Partials      486      486           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dweindl
dweindl marked this pull request as ready for review October 20, 2026 06:16
@dweindl
dweindl requested a review from a team as a code owner October 20, 2026 06:16
Add `petab.v1.math.petab_symbol` (also available from `petab.v2.math`),
which creates a sympy symbol with the same assumptions as the symbols
created by `sympify_petab` (currently `real=True`).

Use it in the parser and in `calculate`, instead of repeating
`real=True`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@dilpath dilpath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@dweindl
dweindl merged commit f7612ec into PEtab-dev:main Oct 20, 2026
7 checks passed
@dweindl
dweindl deleted the petab-symbol branch October 20, 2026 14:55
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