Skip to content

Commit 22c0f45

Browse files
committed
Use BeamLine.from_file to read from file
1 parent 4e722cc commit 22c0f45

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

examples/test_external_examples.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import argparse
2-
import yaml
32

43
from pals import BeamLine
54

@@ -14,12 +13,8 @@ def main():
1413
)
1514
args = parser.parse_args()
1615
example_file = args.path
17-
# Read YAML data from file
18-
with open(example_file, "r") as file:
19-
data = yaml.safe_load(file)
20-
# Parse and validate YAML data
21-
print(f"Parsing data from {example_file}...")
22-
BeamLine(**data)
16+
# Parse and validate YAML data from file
17+
BeamLine.from_file(example_file)
2318

2419

2520
if __name__ == "__main__":

0 commit comments

Comments
 (0)