Skip to content

Commit c83eea3

Browse files
committed
update all commands to use new plugins
1 parent 266432c commit c83eea3

6 files changed

Lines changed: 38 additions & 24 deletions

File tree

‎paths_cli/commands/append.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import click
2+
from paths_cli import OPSCommandPlugin
23
from paths_cli.parameters import (
34
INPUT_FILE, APPEND_FILE, MULTI_CV, MULTI_ENGINE, MULTI_VOLUME,
45
MULTI_NETWORK, MULTI_SCHEME, MULTI_TAG
@@ -55,6 +56,9 @@ def append(input_file, append_file, engine, cv, volume, network, scheme,
5556
storage.close()
5657

5758

58-
CLI = append
59-
SECTION = "Miscellaneous"
60-
REQUIRES_OPS = (1, 0)
59+
PLUGIN = OPSCommandPlugin(
60+
command=append,
61+
section="Miscellaneous",
62+
requires_ops=(1, 0),
63+
requires_cli=(0, 3)
64+
)

‎paths_cli/commands/contents.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,10 @@ def get_section_string_nameable(section, store, get_named):
113113
+ _item_or_items(n_unnamed))
114114
return out_str
115115

116-
CLI = contents
117-
SECTION = "Miscellaneous"
118-
REQUIRES_OPS = (1, 0)
119116

120-
plugin = OPSCommandPlugin(
117+
PLUGIN = OPSCommandPlugin(
121118
command=contents,
122119
section="Miscellaneous",
123120
requires_ops=(1, 0),
124-
requires_cli=(0, 4)
121+
requires_cli=(0, 3)
125122
)

‎paths_cli/commands/equilibrate.py‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import click
22
# import openpathsampling as paths
33

4+
from paths_cli import OPSCommandPlugin
45
from paths_cli.parameters import (
56
INPUT_FILE, OUTPUT_FILE, INIT_CONDS, SCHEME
67
)
@@ -58,6 +59,10 @@ def equilibrate_main(output_storage, scheme, init_conds, multiplier,
5859
return simulation.sample_set, simulation
5960

6061

61-
CLI = equilibrate
62-
SECTION = "Simulation"
63-
REQUIRES_OPS = (1, 2)
62+
PLUGIN = OPSCommandPlugin(
63+
command=equilibrate,
64+
section="Simulation",
65+
requires_ops=(1, 2),
66+
requires_cli=(0, 3)
67+
)
68+

‎paths_cli/commands/md.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import click
22

33
import paths_cli.utils
4+
from paths_cli import OPSCommandPlugin
45
from paths_cli.parameters import (INPUT_FILE, OUTPUT_FILE, ENGINE,
56
MULTI_ENSEMBLE, INIT_SNAP)
67

@@ -197,7 +198,10 @@ def md_main(output_storage, engine, ensembles, nsteps, initial_frame):
197198
'final_conditions')
198199
return trajectory, None
199200

200-
CLI = md
201-
SECTION = "Simulation"
202-
REQUIRES_OPS = (1, 0)
203201

202+
PLUGIN = OPSCommandPlugin(
203+
command=md,
204+
section="Simulation",
205+
requires_ops=(1, 0),
206+
requires_cli=(0, 3)
207+
)

‎paths_cli/commands/pathsampling.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import click
22
# import openpathsampling as paths
33

4+
from paths_cli import OPSCommandPlugin
45
from paths_cli.parameters import (
56
INPUT_FILE, OUTPUT_FILE, INIT_CONDS, SCHEME, N_STEPS_MC
67
)
@@ -37,10 +38,9 @@ def pathsampling_main(output_storage, scheme, init_conds, n_steps):
3738
return simulation.sample_set, simulation
3839

3940

40-
CLI = pathsampling
41-
SECTION = "Simulation"
42-
REQUIRES_OPS = (1, 0)
43-
44-
# pathsampling_plugin = paths_cli.CommandPlugin(command=pathsampling,
45-
# section="Simulation",
46-
# requires_ops=(1, 0))
41+
PLUGIN = OPSCommandPlugin(
42+
command=pathsampling,
43+
section="Simulation",
44+
requires_ops=(1, 0),
45+
requires_cli=(0, 3)
46+
)

‎paths_cli/commands/visit_all.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import click
22

33
import paths_cli.utils
4+
from paths_cli import OPSCommandPlugin
45
from paths_cli.parameters import (INPUT_FILE, OUTPUT_FILE, ENGINE, STATES,
56
INIT_SNAP)
67

@@ -41,6 +42,9 @@ def visit_all_main(output_storage, states, engine, initial_frame):
4142
return trajectory, None # no simulation object to return here
4243

4344

44-
CLI = visit_all
45-
SECTION = "Simulation"
46-
REQUIRES_OPS = (1, 0)
45+
PLUGIN = OPSCommandPlugin(
46+
command=visit_all,
47+
section="Simulation",
48+
requires_ops=(1, 0),
49+
requires_cli=(0, 3)
50+
)

0 commit comments

Comments
 (0)