|
2 | 2 | InstanceCompilerPlugin, Builder, Parameter |
3 | 3 | ) |
4 | 4 | from paths_cli.compiling.tools import custom_eval |
5 | | -from paths_cli.compiling.plugins import NetworkCompilerPlugin, CategoryPlugin |
| 5 | +from paths_cli.compiling.plugins import ( |
| 6 | + NetworkCompilerPlugin, CategoryPlugin, InterfaceSetPlugin |
| 7 | +) |
6 | 8 | from paths_cli.compiling.root_compiler import compiler_for |
| 9 | +from paths_cli.compiling.json_type import ( |
| 10 | + json_type_ref, json_type_list, json_type_eval |
| 11 | +) |
| 12 | + |
| 13 | + |
| 14 | +INITIAL_STATES_PARAM = Parameter( |
| 15 | + 'initial_states', compiler_for('volume'), |
| 16 | + json_type=json_type_list(json_type_ref('volume')), |
| 17 | + description="initial states for this transition", |
| 18 | +) |
7 | 19 |
|
8 | | -build_interface_set = InstanceCompilerPlugin( |
| 20 | + |
| 21 | +INITIAL_STATE_PARAM = Parameter( |
| 22 | + 'initial_state', compiler_for('volume'), |
| 23 | + json_type=json_type_list(json_type_ref('volume')), |
| 24 | + description="initial state for this transition", |
| 25 | +) |
| 26 | + |
| 27 | + |
| 28 | +FINAL_STATES_PARAM = Parameter( |
| 29 | + 'final_states', compiler_for('volume'), |
| 30 | + json_type=json_type_list(json_type_ref('volume')), |
| 31 | + description="final states for this transition", |
| 32 | +) |
| 33 | + |
| 34 | + |
| 35 | +FINAL_STATE_PARAM = Parameter( |
| 36 | + 'final_state', compiler_for('volume'), |
| 37 | + json_type=json_type_list(json_type_ref('volume')), |
| 38 | + description="final state for this transition", |
| 39 | +) |
| 40 | + |
| 41 | + |
| 42 | +build_interface_set = InterfaceSetPlugin( |
9 | 43 | builder=Builder('openpathsampling.VolumeInterfaceSet'), |
10 | 44 | parameters=[ |
11 | | - Parameter('cv', compiler_for('cv'), description="the collective " |
12 | | - "variable for this interface set"), |
13 | | - Parameter('minvals', custom_eval), # TODO fill in JSON types |
14 | | - Parameter('maxvals', custom_eval), # TODO fill in JSON types |
| 45 | + Parameter('cv', compiler_for('cv'), json_type=json_type_ref('cv'), |
| 46 | + description=("the collective variable for this interface " |
| 47 | + "set")), |
| 48 | + Parameter('minvals', custom_eval, |
| 49 | + json_type=json_type_list(json_type_eval("Float")), |
| 50 | + description=("minimum value(s) for interfaces in this" |
| 51 | + "interface set")), |
| 52 | + Parameter('maxvals', custom_eval, |
| 53 | + json_type=json_type_list(json_type_eval("Float")), |
| 54 | + description=("maximum value(s) for interfaces in this" |
| 55 | + "interface set")), |
15 | 56 | ], |
16 | | - name='interface-set' |
| 57 | + name='interface-set', |
| 58 | + description="Interface set used in transition interface sampling.", |
17 | 59 | ) |
18 | 60 |
|
19 | 61 |
|
@@ -47,34 +89,29 @@ def tis_trans_info(dct): |
47 | 89 |
|
48 | 90 | TPS_NETWORK_PLUGIN = NetworkCompilerPlugin( |
49 | 91 | builder=Builder('openpathsampling.TPSNetwork'), |
50 | | - parameters=[ |
51 | | - Parameter('initial_states', compiler_for('volume'), |
52 | | - description="initial states for this transition"), |
53 | | - Parameter('final_states', compiler_for('volume'), |
54 | | - description="final states for this transition") |
55 | | - ], |
56 | | - name='tps' |
| 92 | + parameters=[INITIAL_STATES_PARAM, FINAL_STATES_PARAM], |
| 93 | + name='tps', |
| 94 | + description=("Network for transition path sampling (two state TPS or " |
| 95 | + "multiple state TPS)."), |
57 | 96 | ) |
58 | 97 |
|
59 | 98 |
|
60 | | -MISTIS_NETWORK_PLUGIN = NetworkCompilerPlugin( |
61 | | - parameters=[Parameter('trans_info', mistis_trans_info)], |
62 | | - builder=Builder('openpathsampling.MISTISNetwork'), |
63 | | - name='mistis' |
64 | | -) |
| 99 | +# MISTIS_NETWORK_PLUGIN = NetworkCompilerPlugin( |
| 100 | +# parameters=[Parameter('trans_info', mistis_trans_info)], |
| 101 | +# builder=Builder('openpathsampling.MISTISNetwork'), |
| 102 | +# name='mistis' |
| 103 | +# ) |
65 | 104 |
|
66 | 105 |
|
67 | | -TIS_NETWORK_PLUGIN = NetworkCompilerPlugin( |
68 | | - builder=Builder('openpathsampling.MISTISNetwork'), |
69 | | - parameters=[Parameter('trans_info', tis_trans_info)], |
70 | | - name='tis' |
71 | | -) |
| 106 | +# TIS_NETWORK_PLUGIN = NetworkCompilerPlugin( |
| 107 | +# builder=Builder('openpathsampling.MISTISNetwork'), |
| 108 | +# parameters=[Parameter('trans_info', tis_trans_info)], |
| 109 | +# name='tis' |
| 110 | +# ) |
72 | 111 |
|
73 | 112 | # old names not yet replaced in testing THESE ARE WHY WE'RE DOUBLING! GET |
74 | 113 | # RID OF THEM! (also, use an is-check) |
75 | 114 | build_tps_network = TPS_NETWORK_PLUGIN |
76 | | -build_mistis_network = MISTIS_NETWORK_PLUGIN |
77 | | -build_tis_network = TIS_NETWORK_PLUGIN |
78 | 115 |
|
79 | 116 |
|
80 | 117 | NETWORK_COMPILER = CategoryPlugin(NetworkCompilerPlugin, aliases=['networks']) |
0 commit comments