Skip to content

Commit

Permalink
cleanup for TIS compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
dwhswenson committed Aug 22, 2024
1 parent fba6fd5 commit 0efe35c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 77 deletions.
21 changes: 0 additions & 21 deletions paths_cli/compiling/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,27 +88,6 @@ def mistis_trans_info(dct):
dct = dct.copy()
dct['trans_info'] = dct.pop('interface_sets')
return dct
# interface_sets = dct.pop('interface_sets')
# volume_compiler = compiler_for('volume')
# interface_set_compiler = compiler_for('interface_set')

# trans_info = []
# for iset in interface_sets:
# initial_state = volume_compiler(iset.pop("initial_state"))
# final_state = volume_compiler(iset.pop("final_state"))
# iset['type'] = iset.get('type', 'volume-interface-set')
# interface_set = interface_set_compiler(iset)
# trans_info.append((initial_state, interface_set, final_state))

# dct['trans_info'] = trans_info
# return dct


def tis_trans_info(dct):
# remap TIS into MISTIS format
dct = dct.copy()
remapped = {'interface_sets': [dct]}
return mistis_trans_info(remapped)


TPS_NETWORK_PLUGIN = NetworkCompilerPlugin(
Expand Down
56 changes: 0 additions & 56 deletions paths_cli/tests/compiling/test_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,62 +27,6 @@ def unidirectional_tis_compiler(cv_and_states):
),
}

# def check_unidirectional_tis(results, state_A, state_B, cv):
# assert len(results) == 1
# trans_info = results['trans_info']
# assert len(trans_info) == 1
# assert len(trans_info[0]) == 3
# trans = trans_info[0]
# assert isinstance(trans, tuple)
# assert trans[0] == state_A
# assert trans[2] == state_B
# assert isinstance(trans[1], paths.VolumeInterfaceSet)
# ifaces = trans[1]
# assert ifaces.cv == cv
# assert ifaces.minvals == float("-inf")
# np.testing.assert_allclose(ifaces.maxvals,
# [0, np.pi / 10.0, np.pi / 5.0])


# def test_mistis_trans_info(cv_and_states, mistis_dict,
# unidirectional_tis_compiler):
# cv, state_A, state_B = cv_and_states
# patch_base = 'paths_cli.compiling.networks'
# with mock.patch.dict(_COMPILERS_LOC, unidirectional_tis_compiler):
# results = mistis_trans_info(mistis_dict)

# check_unidirectional_tis(results, state_A, state_B, cv)
# paths.InterfaceSet._reset()


# def test_tis_trans_info(cv_and_states):
# cv, state_A, state_B = cv_and_states
# dct = {
# 'initial_state': "A",
# 'final_state': "B",
# 'cv': 'cv',
# 'minvals': 'float("-inf")',
# 'maxvals': 'np.array([0, 0.1, 0.2]) * np.pi',
# }

# compiler = {
# 'cv': mock_compiler('cv', named_objs={'cv': cv}),
# 'volume': mock_compiler('volume', named_objs={
# "A": state_A, "B": state_B
# }),
# 'interface_set': mock_compiler(
# 'interface_set',
# type_dispatch={
# 'volume-interface-set': VOLUME_INTERFACE_SET_PLUGIN
# }
# ),
# }
# with mock.patch.dict(_COMPILERS_LOC, compiler):
# results = tis_trans_info(dct)

# check_unidirectional_tis(results, state_A, state_B, cv)
# paths.InterfaceSet._reset()


def test_build_tps_network(cv_and_states):
_, state_A, state_B = cv_and_states
Expand Down

0 comments on commit 0efe35c

Please sign in to comment.