Repository navigation
fix: no-ODE simulations refused, model files read as UTF-8 under any locale - #66
Merged
Merged
Conversation
…he solver The Sundials solver segfaults on an input with NUM_EQUATIONS 0 (every variable constant, or rate rules VCell's SBML import did not keep: BIOMD0000000020, BIOMD0000000241), taking the Python process down. simulate_ode_vcml now raises a ValueError first. Also: explicit output times are written as floats (numpy floats assigned after validation were written as np.float64(...)), and the docstring says rule-based networks are regenerated by the bundled BioNetGen. Co-Authored-By: Claude Opus 5.5 <[email protected]>
COPASI and libroadrunner set the C locale when loaded, which makes Python's default text encoding ASCII; every VCML,
SBML and Antimony file pyvcell reads or writes (libvcell's intermediate files included) then failed on non-ASCII
names and notes ('ascii' codec can't decode byte 0xc3). Found running pbsim_common's VCellUTCStep beside COPASI.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Found while building pbsim_common's
VCellUTCStep(compose-apidocs/plan-vcell-ode.md).A solver input with 0 equations crashed the process. pyvcell-odesolver segfaults (
CVDense: A memory request failed, exit 139) when VCell's math has no state variables. Two cases:simulate_ode_vcmlnow readsNUM_EQUATIONSfrom the input and raises aValueError("has no ODEs to solve") before calling the solver. The crash itself also belongs in vcell-ode, which should report an error instead.Explicit output times are written as floats. numpy floats assigned after validation skip pydantic's coercion, and
reprwrote them asnp.float64(0.5), which VCell refuses.Model files are read and written as UTF-8, whatever the process locale. COPASI and libroadrunner set the C locale when they load, which makes Python's default text encoding ASCII. Every VCML, SBML and Antimony file pyvcell reads or writes, including libvcell's intermediate files, then failed on non-ASCII names or notes (
'ascii' codec can't decode byte 0xc3).open/read_textnow passencoding="utf-8". A new test switches to the C locale and loads a model with non-ASCII names: it fails onmainwith that error and passes here.Docstring: rule-based networks are now regenerated by the BioNetGen bundled with libvcell ≥ 0.0.22, falling back to the stored math.
Tests: three new ones: the boundary-species model refused rather than crashed, numpy output times written as numbers, and loading under the C locale.
tests/vcml/test_ode_simulation.pypasses 20 of 20 locally, and mypy is clean.🤖 Generated with Claude Code