Skip to content

Conversation

FFroehlich
Copy link
Member

@FFroehlich FFroehlich commented Jun 26, 2025

Summary

  • detect continuously differentiable piecewise expressions
  • check smoothness w.r.t. given parameters only
  • keep these piecewise expressions instead of converting to Heaviside
  • extend tests for constant piecewise expressions

Testing

  • pre-commit run --files python/sdist/amici/import_utils.py python/tests/test_heavisides.py
  • pytest python/tests/test_heavisides.py::test_parse_piecewise_c1_no_heaviside python/tests/test_heavisides.py::test_parse_piecewise_discontinuous_to_heaviside python/tests/test_heavisides.py::test_parse_piecewise_c1_constant_zero -q

fixes #2049


https://chatgpt.com/codex/tasks/task_b_685d399bee14832b899b26d9136e2fda

Copy link

codecov bot commented Jun 26, 2025

Codecov Report

Attention: Patch coverage is 78.00000% with 11 lines in your changes missing coverage. Please review.

Project coverage is 79.05%. Comparing base (167864b) to head (8e9ca87).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
python/sdist/amici/import_utils.py 75.55% 11 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2840      +/-   ##
==========================================
- Coverage   79.62%   79.05%   -0.57%     
==========================================
  Files         358      358              
  Lines       23033    23077      +44     
  Branches     1581     1582       +1     
==========================================
- Hits        18339    18243      -96     
- Misses       4683     4823     +140     
  Partials       11       11              
Flag Coverage Δ
cpp 74.98% <68.00%> (+<0.01%) ⬆️
cpp_python 32.50% <68.00%> (-0.68%) ⬇️
petab 38.90% <12.00%> (-0.09%) ⬇️
python 73.84% <78.00%> (+<0.01%) ⬆️
sbmlsuite-jax ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
python/sdist/amici/pysb_import.py 94.57% <ø> (ø)
python/sdist/amici/sbml_import.py 82.12% <100.00%> (-12.07%) ⬇️
python/sdist/amici/sbml_utils.py 81.52% <100.00%> (+0.11%) ⬆️
python/sdist/amici/import_utils.py 80.97% <75.55%> (-3.98%) ⬇️

... and 8 files with indirect coverage changes

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

dweindl added a commit to dweindl/AMICI that referenced this pull request Jun 30, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jun 30, 2025
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@FFroehlich
Copy link
Member Author

Comment on why this hasn't been merged yet: I currently don't really trust the C1 continuity check as assignments etc are not flattened out. This might imply that we could inadvertently miss discontinuities, but maybe it's all fine as we can assume continuity of the respective terms. Haven't thought about it enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

piecewise without events
2 participants