|
| 1 | +from paths_cli.parameters import ( |
| 2 | + MULTI_INIT_SNAP, MULTI_NETWORK, OUTPUT_FILE, INPUT_FILE |
| 3 | +) |
| 4 | + |
| 5 | +@MULTI_INIT_SNAP.clicked() |
| 6 | +@MULTI_NETWORK.clicked() |
| 7 | +@OUTPUT_FILE.clicked() |
| 8 | +@INPUT_FILE.clicked() |
| 9 | +def bootstrap_init(init_frame, network, output_file, input_file): |
| 10 | + ... |
| 11 | + |
| 12 | +def _update_init_frames(transitions, init_frames): |
| 13 | + transition_to_init_frame = {} |
| 14 | + for transition in transitions: |
| 15 | + # raise error if not TIS transition |
| 16 | + transition_to_init_frame[transition] = None |
| 17 | + for snap in init_frames: |
| 18 | + if init_frame.initial_state(snap): |
| 19 | + transition_to_init_frame[transition] = snap |
| 20 | + break |
| 21 | + return transition_to_init_frame |
| 22 | + |
| 23 | + |
| 24 | +def bootstrap_init_main(init_frames, networks, output_file): |
| 25 | + all_transitions = {trans for trans in network.sampling_transitions |
| 26 | + for network in networks} |
| 27 | + trans_to_init_frame = _update_init_frames(all_transitions, init_frames) |
| 28 | + missing = {trans for trans, frame in trans_to_init_frame.items() |
| 29 | + if frame is None} |
| 30 | + # TODO warn about missing initial frames |
| 31 | + found = set(trans_to_init_frame) - missing |
| 32 | + completed = set() |
| 33 | + for transition in found: |
| 34 | + ... |
| 35 | + |
0 commit comments