Add CompiledReaction.from_pinned; fix ruff-format drift on main - #192
Merged
Conversation
from_pinned records the from-side pinned coordinate for every axis a transition pins on its from-side selector (full_axes minus from_axes). This was missing from #191: that PR added full_axes and widened `pinned` to cover from-pinned axes too, but `pinned` only ever carries the TO-side coordinate for those axes. For a point-to-point transition (pinned on both sides, e.g. a vaccination-dose-progression transition pinned at vax=unvaccinated on from and vax=partial on to), the from-side and to-side coordinates differ, so a consumer building a depletion-target index into from_base cannot derive it from `pinned` alone -- confirmed by diphtheria_outbreakvacc's run_hybrid_ctmc consumer, which needs exactly this to deplete the correct source cell rather than the (wrong) to-side one. Also fixes ruff-format drift left on main by #191's merge (my own _reactions.py/compile.py edits weren't format-clean) and a pre-existing, unrelated formatting issue in README.md -- both were failing the "quality" CI check on main.
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.
Follow-up to #191, which merged with an incomplete fix and left
main's "quality" CI check red.Missing piece from #191: that PR added
full_axesand widenedpinnedto cover from-side-pinned axes, butpinnedonly ever carries the to-side coordinate for those axes. For a point-to-point transition (pinned on both sides — e.g. a vaccination-dose-progression transition pinned atvax=unvaccinatedonfromandvax=partialonto), the from-side and to-side coordinates differ, so a consumer building a depletion-target index intofrom_basecan't derive it frompinnedalone. Caught this while wiringdiphtheria_outbreakvacc'srun_hybrid_ctmcconsumer: it was depleting the wrong (to-side) coordinate for from-pinned transitions. AddsReactionArtifactIR.from_pinned/CompiledReaction.from_pinned, threaded the same way aspinned.CI cleanup:
mainhas been failing thequality(ruff format) check since #191 merged — my own edits there weren't format-clean, plus one pre-existing, unrelated formatting drift inREADME.md. Both fixed here;ruff format --check .is clean.Testing: full suite (472/472) + mypy clean. Verified against
diphtheria_outbreakvacc's hybrid-CTMC engine tests (7/7 pass) using this branch as the sibling editable install —run_hybrid_ctmcnow depletes the correct from-pinned source cell forvax_dose1/vax_dose2/wane_full/wane_partial.