Repository navigation
Conversation
This was referenced Nov 16, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3582 +/- ##
==========================================
+ Coverage 80.52% 80.82% +0.30%
==========================================
Files 332 331 -1
Lines 23698 23850 +152
Branches 1690 1674 -16
==========================================
+ Hits 19082 19276 +194
+ Misses 4610 4563 -47
- Partials 6 11 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
* Event assignments to entities that are not (solver) state variables now raise a `ValueError` in `DEModel.generate_basic_variables`, i.e., before code generation, and in `Event.get_state_update`. Such assignments were silently dropped. * Add `Event.assignment_targets` and `Event.check_assignment_targets`. * `ode_model_from_pysb_importer` disables conservation laws with a warning for models with events, as the SBML importer does, instead of raising. Preparation for PEtab v2 condition changes in later periods for PySB models (AMICI-dev#3068). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Condition changes in any period but the first one, including the main period after pre-equilibration, failed with a `TypeError`. They are now implemented as events: * Species targets are resolved via pattern matching against the generated reaction network. This also removes the requirement of a `pysb.Initial` with an identical pattern for first-period changes, and fixes changes of the same species in multiple experiments. * Target values of later-period changes may depend on the current model state, model parameters, `time`, and parameter-table parameters. * No events are created for periods without changes. * `time` is allowed in first-period target values. Invalid targets now raise: * `pysb.Expression`s and observables are algebraic entities and not valid condition targets. Their changes were silently ignored. * Compartments and parameters that compartment sizes depend on (also via `pysb.Expression`s) are not supported, as BioNetGen evaluates compartment sizes during network generation. * Changes of `pysb.Parameter`s remain unsupported for now. * Entities named `t` (reserved by AMICI) in changes after the first period, as event assignments don't use the renames of the PySB import. The JAX backend raises `NotImplementedError` for changes after the first period, as `pysb2jax` doesn't support events. Relates to AMICI-dev#3068. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dweindl
force-pushed
the
pysb_v2_species_changes
branch
from
November 16, 2026 13:11
107354a to
6efedc4
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes PEtab v2 species condition changes for PySB models. Based on #3581 (only the last commit is new).
Previously:
TypeError: Can only work with Components, got a <class 'str'>. Fixing that alone would have hit further problems: anAssertionErrorfor non-parameter targets, symbols without AMICI's assumptions in the trigger (generated code failed to compile), event assignments to parameters silently dropped, and conservation laws not supported with events.pysb.Initialwith a byte-identical pattern string, and failed for the same species changed in multiple experiments.pysb.Expressiontargets were silently ignored, because the converter assigned to a non-existentpysb.Expression.valueattribute. Expressions are algebraic entities and therefore not valid PEtab v2 condition targets.Now:
pysb.Expressionandpysb.Observabletargets raise aValueError. Compartment targets and compartment-size parameters raise as well, since BioNetGen evaluates compartment sizes during network generation.pysb.Parametertargets raise aNotImplementedError; they are added in Support PEtab v2 condition changes ofpysb.Parameters #3583.t(reserved by AMICI) in changes after the first period raise aNotImplementedError, as the event assignments don't use the renames of the PySB import.NotImplementedErrorfor PySB problems with changes after the first period (pysb2jaxdoesn't support events yet).Relates to #3068.
🤖 Generated with Claude Code