Repository navigation
Conversation
… that reports (lanl#961) lanl#710 refused steady_state() wherever any function read the time, which refused minutes := time/60 in BIOMD0000000739 and 951 though nothing in the dynamics reads it. The refusal now asks what the time reaches: a rate law (rate_laws_read_clock, which does not count a rateOf), or a rule a species or compartment size is reported through. Where it reaches neither, the state is solved for and each function that reads the clock (functions_reading_clock) is reported as NaN, with a NaN sensitivity row output_sensitivities refuses by that reason.
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.
Part of #961: lifts the item "A function that reads the time and that nothing in the dynamics reads" (
minutes := time/60, BIOMD0000000498, 739, 951, and a time-indexed table nothing reads).What was refused
#710 refuses
steady_state()for any model where some function reads the time (NetworkModel.functions_use_time, one flag for the whole function block). A function that only reports, likeminutes := time/60, doesn't touchf(y), so the state those models settle to was refused for no reason. On main:The same happens for
seen() = 2*time()besideA -> Batk(the existing testtest_a_reported_function_that_reads_the_time_is_refused).The change
Core:
RateDeps(the dependency walk behindreaction_rate_reads_time) gains aclockflag. It is set bytimeand by a time-indexed table, and not by arateOf, which reads the running derivatives (0 at a steady state).NetworkModel::rate_laws_read_clock(): does any reaction's rate read the clock.NetworkModel::functions_reading_clock(): which functions' values move with the clock, through other functions and derived parameters (viaexpression_support).find_steady_staterefuses onrate_laws_read_clock()in place offunctions_use_time(). In its result, each clock-reading function's value and output-sensitivity row are NaN: what was read is its value at t = 0, and it has no steady value.Python (
_raise_if_no_steady_state_to_solve_forand the new_ss_reads_the_time): still refuses when the time reaches what is reported as a state:S := B*(1 - exp(-time)), via_ar_report_map);C := 1 + time/(1+time), viacompartment_size_params).Otherwise the state is solved for.
Reporting:
SteadyStateResultrecords the clock-reading functions, andoutput_sensitivities("expression:seen")refuses by that reason ("it reads the time, so it has no steady value ... issue #961") instead of "its value is nan".Unchanged: the early stop of
run(steady_state=True)(the next #961 item), which still usesfunctions_use_time.Tests
In
test_steady_state_of_a_model_that_reads_time.py, #710's file:test_a_reported_function_that_reads_the_time_is_refusedbecomes..._only_reports_is_nan, under integration and newton. It checks the state is [0, 1],seenis NaN, andktis 1.output_sensitivitiesrefuses with the reason;minutes := time/60(A, B = 1/3, 2/3);time, in SBML; an assignment-rule species on the time; a compartment sized on the time; events; size jumps), and therateOfcontrol.Mutation tests (the core rebuilt for each C++ mutant): all 10 are killed.
functions_use_timerateOfcounted as the clockrateOfcontrolCorpus
178 of 1,323 BioModels read the time and have no event.
time_minutesrun()to t = 1e9 to 2.8e-7 at rtol 1e-12 (0.1 at 1e-8, 4e-4 at 1e-10)parameter_1(a pulse nothing reads)converged=Falseminutesconverged=FalseV_aveconverged=False, naming 4 write-only accumulators and suggestingmask=run()at t = 1e6 to 1.5e-15, thoughconvergedstays False (residual 1.96)Every model that ran before takes the same path: the NaN mask applies only where
functions_use_timeis set, and all such models were refused.Checks (macOS arm64)
python/tests: 16,943 passed, 0 failed.parity_checks/tests: 1,015 passed. The 2 failures (test_bngsim_provenanceand the reference-archive replay) also fail on main here: their subprocess can't importbngsimwithout my local import shim.pre-commit run --all-files,sphinx -W, andci/changelog.py check/requiredare clean (changelog.d/961.changed.md).Not verified
docs/user-guide/steady-state.mdis updated. The Tracking: forward-sensitivity runs that are refused where a derivative exists (refusals to lift) #961 checkbox is left for a maintainer to tick.