Skip to content

Commit d79b139

Browse files
committed
Run evaluation only if directory exists
1 parent 3d96406 commit d79b139

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ You can either use the TPS shooting baselines [provided by us](https://github.co
5454

5555
```bash
5656
python tps_baseline_mueller.py
57-
# For this to work, you need to specify which baselines to run by changing the all_paths variable in the script
58-
python eval/evaluate_mueller.py
57+
PYTHONPATH='.' python eval/evaluate_mueller.py
5958
```
6059

6160
to generate and evaluate transitions for the Müller-Brown toy-potential or use
@@ -65,12 +64,12 @@ python tps_baseline.py --mechanism two-way-shooting --num_paths 1000 --states ph
6564
# num_steps compiles multiple MD steps into a single one. This makes sampling faster but increases startup time. Only really worth it for long running simulations
6665
python tps_baseline.py --mechanism two-way-shooting --num_paths 100 --fixed_length 1000 --states phi-psi --num_steps 50
6766
python tps_baseline.py --mechanism two-way-shooting --num_paths 1000 --states rmsd
68-
python eval/evaluate_tps.py
67+
PYTHONPATH='.' python eval/evaluate_tps.py
6968
```
7069

7170
for ALDP respectively.
7271

73-
**Note:** In both cases, you might need to change the paths that you want to evaluate in `evaluate_mueller.py` or `evaluate_tps.py`.
72+
**Note:** In both cases, you might want to change the paths that you want to generate and evaluate in the baseline or evaluation scripts.
7473

7574
## Run our method
7675
To sample trajectories with our method, we provide ready to go config files in `configs/`. You can run them with

eval/evaluate_tps.py

+5
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ def load(path):
130130
('two-way-shooting-fixed-length-cv', './out/baselines/alanine-two-way-shooting-1000steps', 0),
131131
]
132132

133+
all_paths = [(name, path, warmup) for name, path, warmup in all_paths if os.path.exists(path)]
134+
print('Running script for the following paths:')
135+
[print(name, path) for name, path, warmup in all_paths]
136+
assert len(all_paths) > 0, 'No paths found, please consider running tps_baseline_mueller.py first.'
137+
133138
# print relevant statistics:
134139
for name, file_path, _warmup in all_paths:
135140
with open(f'{file_path}/stats.json', 'r') as fp:

0 commit comments

Comments
 (0)