Repository navigation
fix(evolve): raise error when IterEv > 1 for truncated evolution - #258
Open
ashishsoni-ai wants to merge 1 commit into
Open
ashishsoni-ai wants to merge 1 commit into
ashishsoni-ai wants to merge 1 commit into
Conversation
ashishsoni-ai
force-pushed
the
fix/truncated-iterations-error
branch
from
November 5, 2026 05:04
11d7b48 to
3915685
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.
Closes #176
Summary
This PR addresses issue #176 by enforcing validation of the evolution method configuration in
write_operator_card:Raise error when iterations > 1 for truncated evolution (
src/pineko/evolve.py):ModEv == "TRN") does not support breaking the evolution integral into multiple iterations (IterEv > 1). Previously, anyIterEv > 1was silently ignored and overwritten with1.ValueErroriftcard["ModEv"] == "TRN"andIterEv > 1, as requested by @scarlehoff in Raise an error when the number of iterations > 1 for truncated #176.Fix literal comparison bug:
if "IterEv" not in tcard and "ModEv" == "EXA":compared the string literal"ModEv"to"EXA", leaving theIterEvpresence check for exact evolution dead. Changed totcard["ModEv"] == "EXA".Guards for unsupported evolution methods:
elsebranch raisingValueErroriftcard["ModEv"]is not recognized, preventing incomplete operator card generation.Unit Tests (
tests/test_evolve.py):test_write_operator_card_evolution_methodsusing theFakePinemock to verify:ModEvraisesValueError.ModEvraisesValueError.ModEv == "EXA"withoutIterEvraisesValueError.ModEv == "EXA"withIterEvsucceeds.ModEv == "TRN"withIterEv > 1raisesValueError.ModEv == "TRN"withIterEv == 1succeeds.Verification
pytest tests/test_evolve.py: 2 passed (100%).black: 0 issues.git diff --check: 0 issues.