Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Apr 23, 2024
1 parent d3c4fc4 commit 2dcd19a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions python/sdist/amici/sbml_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,14 @@ def _build_ode_model(
dxdt = smart_multiply(
self.stoichiometric_matrix, MutableDenseMatrix(fluxes)
)
# there may be an additional 0-entry at the end of the
# stoichiometric matrix / flux vector
assert dxdt.shape[0] - len(self.symbols[SymbolId.SPECIES]) in (0, 1)
# dxdt has algebraic states at the end
assert dxdt.shape[0] - len(self.symbols[SymbolId.SPECIES]) == len(
self.symbols.get(SymbolId.ALGEBRAIC_STATE, [])
), (
self.symbols[SymbolId.SPECIES],
dxdt,
self.symbols[SymbolId.SPECIES],
)

# correct time derivatives for compartment changes
for ix, ((species_id, species), formula) in enumerate(
Expand Down

0 comments on commit 2dcd19a

Please sign in to comment.