Skip to content

Commit 5b2fb2a

Browse files
committed
some reorg on bootstrap-init
1 parent 9af1445 commit 5b2fb2a

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

paths_cli/commands/bootstrap_init.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import click
22
from paths_cli import OPSCommandPlugin
33
from paths_cli.parameters import (
4-
INIT_SNAP, MULTI_NETWORK, OUTPUT_FILE, INPUT_FILE, ENGINE
4+
INIT_SNAP, SCHEME, ENGINE, OUTPUT_FILE, INPUT_FILE
55
)
66
from paths_cli.param_core import OPSStorageLoadSingle, Option
77

@@ -21,11 +21,11 @@
2121
@INIT_STATE.clicked(required=True)
2222
@FINAL_STATE.clicked(required=True)
2323
@INIT_SNAP.clicked()
24-
@MULTI_NETWORK.clicked()
24+
@SCHEME.clicked()
2525
@ENGINE.clicked()
2626
@OUTPUT_FILE.clicked()
2727
@INPUT_FILE.clicked()
28-
def bootstrap_init(init_state, final_state, network, engine, init_snap,
28+
def bootstrap_init(initial_state, final_state, scheme, engine, init_frame,
2929
output_file, input_file):
3030
"""Use ``FullBootstrapping`` to create initial conditions for TIS.
3131
@@ -37,12 +37,14 @@ def bootstrap_init(init_state, final_state, network, engine, init_snap,
3737
Note that intermediate sampling in this is not saved to disk.
3838
"""
3939
storage = INPUT_FILE.get(input_file)
40-
network = MULTI_NETWORK.get(storage, network)
41-
init_state = INIT_STATE.get(storage, init_state)
42-
final_state = FINAL_STATE.get(storage, final_stage)
40+
scheme = SCHEME.get(storage, scheme)
41+
network = scheme.network
42+
engine = ENGINE.get(storage, engine)
43+
init_state = INIT_STATE.get(storage, initial_state)
44+
final_state = FINAL_STATE.get(storage, final_state)
4345
transition = network.transitions[(init_state, final_state)]
4446
bootstrap_init_main(
45-
init_frame=INIT_SNAP.get(storage, init_snap),
47+
init_frame=INIT_SNAP.get(storage, init_frame),
4648
network=network,
4749
engine=engine,
4850
transition=transition,
@@ -52,8 +54,9 @@ def bootstrap_init(init_state, final_state, network, engine, init_snap,
5254

5355
def bootstrap_init_main(init_frame, network, engine, transition,
5456
output_storage):
57+
import openpathsampling as paths
5558
all_states = set(network.initial_states) | set(network.final_states)
56-
allowed_states = {transition.initial_state, transition.final_state}
59+
allowed_states = {transition.stateA, transition.stateB}
5760
forbidden_states = list(all_states - allowed_states)
5861
try:
5962
extra_ensembles = network.ms_outers
@@ -62,7 +65,7 @@ def bootstrap_init_main(init_frame, network, engine, transition,
6265

6366
bootstrapper = paths.FullBootstrapping(
6467
transition=transition,
65-
snaphot=init_frame,
68+
snapshot=init_frame,
6669
engine=engine,
6770
forbidden_states=forbidden_states,
6871
extra_ensembles=extra_ensembles,

0 commit comments

Comments
 (0)