Skip to content

Commit 0bcada7

Browse files
Adapting to recent commits in main.
1 parent 292f5da commit 0bcada7

File tree

3 files changed

+33
-38
lines changed

3 files changed

+33
-38
lines changed

tests/config/sr.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
type: pyaml.pyaml
21
type: pyaml.accelerator
32
name: sr
43
energy: 6e9
Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
1-
type: pyaml.pyaml
2-
instruments:
3-
- type: pyaml.instrument
4-
name: sr
5-
energy: 6e9
6-
simulators:
7-
- type: pyaml.lattice.simulator
8-
lattice: sr/lattices/ebs.mat
9-
name: design
10-
data_folder: /data/store
11-
devices:
12-
- sr/quadrupoles/QF1AC01.yaml
13-
- type: pyaml.magnet.serialized_magnet
14-
name: mySeriesOfMagnets
15-
function: B1
16-
elements:
17-
- QF8B-C04
18-
- QF8D-C04
19-
- QD5D-C04
20-
- QF6D-C04
21-
- QF4D-C04
22-
model:
23-
type: pyaml.magnet.linear_serialized_model
24-
calibration_factors: 1.00504
25-
calibration_offsets: 0.0
26-
unit: m-1
27-
curves: sr/magnet_models/quadcurve.yaml
28-
powerconverters:
29-
type: tango.pyaml.attribute
30-
attribute: srmag/ps-corr-sh1/c01-a-ch1/current
31-
unit: A
32-
- sr/correctors/SH1AC01.yaml
33-
- sr/correctors/SH1AC02.yaml
1+
type: pyaml.accelerator
2+
name: sr
3+
energy: 6e9
4+
simulators:
5+
- type: pyaml.lattice.simulator
6+
lattice: sr/lattices/ebs.mat
7+
name: design
8+
data_folder: /data/store
9+
devices:
10+
- sr/quadrupoles/QF1AC01.yaml
11+
- type: pyaml.magnet.serialized_magnet
12+
name: mySeriesOfMagnets
13+
function: B1
14+
elements:
15+
- QF8B-C04
16+
- QF8D-C04
17+
- QD5D-C04
18+
- QF6D-C04
19+
- QF4D-C04
20+
model:
21+
type: pyaml.magnet.linear_serialized_model
22+
calibration_factors: 1.00504
23+
calibration_offsets: 0.0
24+
unit: m-1
25+
curves: sr/magnet_models/quadcurve.yaml
26+
powerconverters:
27+
type: tango.pyaml.attribute
28+
attribute: srmag/ps-corr-sh1/c01-a-ch1/current
29+
unit: A
30+
- sr/correctors/SH1AC01.yaml
31+
- sr/correctors/SH1AC02.yaml

tests/test_serialized_magnets.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import numpy as np
22
import pytest
33

4-
from pyaml.pyaml import pyaml,PyAML
4+
from pyaml.accelerator import Accelerator
55
from pyaml.configuration.factory import Factory
6-
from pyaml.instrument import Instrument
76

87

98
def check_no_diff(array:list[np.float64]) -> bool:
@@ -25,8 +24,7 @@ def check_no_diff(array:list[np.float64]) -> bool:
2524
indirect=["install_test_package"],
2625
)
2726
def test_config_load(sr_file, install_test_package):
28-
ml:PyAML = pyaml(sr_file)
29-
sr:Instrument = ml.get('sr')
27+
sr:Accelerator = Accelerator.load(sr_file)
3028
assert sr is not None
3129
magnets = [sr.design.get_element("QF8B-C04"),
3230
sr.design.get_element("QF8B-C04"),

0 commit comments

Comments
 (0)