Skip to content

Commit 083cb98

Browse files
authored
Generalise example
Hard coded path doesn't work generally, make path relative to containing project.
1 parent 0560f82 commit 083cb98

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

examples/calculations/submit_train.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@
1414
metadata = {"options": {"resources": {"num_machines": 1}}}
1515
code = load_code("janus@localhost")
1616

17+
ROOT_DIR = Path(__file__).resolve().parents[2]
18+
1719
# All the other parameters we want them from the config file
1820
# We want to pass it as a AiiDA data type for the provenance
19-
mlip_config = JanusConfigfile(
20-
Path("~/aiida-mlip/tests/calculations/configs/mlip_train.yml")
21-
.expanduser()
22-
.resolve()
23-
)
21+
mlip_config = JanusConfigfile(ROOT_DIR / "tests/calculations/configs/mlip_train.yml")
2422

2523
# Define calculation to run
2624
TrainCalc = CalculationFactory("mlip.train")

0 commit comments

Comments
 (0)