Skip to content

Commit

Permalink
Updated ValueError messages when extending
Browse files Browse the repository at this point in the history
* When `mapping` is `None`, use the mapping provided by the
  ProtocolDAGResult
  • Loading branch information
ianmkenney committed Apr 12, 2024
1 parent 67392bc commit 8c69b31
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions feflow/protocols/nonequilibrium_cycling.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,13 +974,16 @@ def _create(
original_mapping = setup.inputs["mapping"]

if original_state_a != stateA.key:
raise ValueError()
raise ValueError("'stateA' key is not the same as the key provided by the 'extends' ProtocolDAGResult.")

if original_state_b != stateB.key:
raise ValueError()
raise ValueError("'stateB' key is not the same as the key provided by the 'extends' ProtocolDAGResult.")

if original_mapping != mapping:
raise ValueError()
if mapping is not None:
if original_mapping != mapping:
raise ValueError("'mapping' is not consistent with the mapping provided by the 'extnds' ProtocolDAGResult.")
else:
mapping = original_mapping

systems = {}
states = {}
Expand Down

0 comments on commit 8c69b31

Please sign in to comment.