Skip to content

Commit a3e95c3

Browse files
committed
updates following code review
1 parent 0efe35c commit a3e95c3

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

paths_cli/compiling/networks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def mistis_trans_info_param_builder(dcts):
4545
volume_compiler = compiler_for("volume")
4646
interface_set_compiler = compiler_for('interface_set')
4747
for dct in dcts:
48+
dct = dct.copy()
4849
dct['type'] = dct.get('type', default)
4950
initial_state = volume_compiler(dct.pop('initial_state'))
5051
final_state = volume_compiler(dct.pop('final_state'))

paths_cli/tests/compiling/test_networks.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,32 @@ def test_build_tps_network(cv_and_states):
4747
def test_build_mistis_network(cv_and_states, unidirectional_tis_compiler):
4848
cv, state_A, state_B = cv_and_states
4949
mistis_dict = {
50-
'interface_sets': [{
51-
'initial_state': "A",
52-
'final_state': "B",
53-
'cv': 'cv',
54-
'minvals': 'float("-inf")',
55-
'maxvals': "np.array([0, 0.1, 0.2]) * np.pi"
56-
}]
50+
'interface_sets': [
51+
{
52+
'initial_state': "A",
53+
'final_state': "B",
54+
'cv': 'cv',
55+
'minvals': 'float("-inf")',
56+
'maxvals': "np.array([0, 0.1, 0.2]) * np.pi"
57+
},
58+
{
59+
'initial_state': "B",
60+
'final_state': "A",
61+
'cv': 'cv',
62+
'minvals': "np.array([1.0, 0.9, 0.8])",
63+
'maxvals': "float('inf')",
64+
}
65+
]
5766
}
5867

5968
with mock.patch.dict(_COMPILERS_LOC, unidirectional_tis_compiler):
6069
network = MISTIS_NETWORK_PLUGIN(mistis_dict)
6170

6271
assert isinstance(network, paths.MISTISNetwork)
63-
assert len(network.sampling_transitions) == 1
64-
assert len(network.transitions) == 1
65-
assert list(network.transitions) == [(state_A, state_B)]
72+
assert len(network.sampling_transitions) == 2
73+
assert len(network.transitions) == 2
74+
assert list(network.transitions) == [(state_A, state_B),
75+
(state_B, state_A)]
6676

6777
def test_build_tis_network(cv_and_states, unidirectional_tis_compiler):
6878
cv, state_A, state_B = cv_and_states

0 commit comments

Comments
 (0)