Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/BESSY2_example/BESSY2Orbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ devices:
vcorr_array_name: VCorr
name: DEFAULT_ORBIT_CORRECTION
singular_values: 16
response_matrix: file:orm.json
response_matrix: ${path:orm.json}
- type: pyaml.rf.rf_plant
name: RF
masterclock: (MCLKHX251C:freq)[KHz]
Expand Down
2 changes: 1 addition & 1 deletion examples/BESSY2_example/BESSY2Tune.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ devices:
name: DEFAULT_TUNE_CORRECTION
quad_array_name: QForTune
betatron_tune_name: BETATRON_TUNE
response_matrix: file:trm.json
response_matrix: ${path:trm.json}
- type: pyaml.tuning_tools.tune_response_matrix
name: DEFAULT_TUNE_RESPONSE_MATRIX
quad_array_name: QForTune
Expand Down
4 changes: 2 additions & 2 deletions examples/SOLEIL_examples/tuning_tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
name: DEFAULT_TUNE_CORRECTION
quad_array_name: QCORR
betatron_tune_name: BETATRON_TUNE
response_matrix: file:trm.json
response_matrix: ${path:trm.json}
- type: pyaml.tuning_tools.tune_response_matrix
name: DEFAULT_TUNE_RESPONSE_MATRIX
quad_array_name: QCORR
Expand Down Expand Up @@ -40,4 +40,4 @@
vcorr_array_name: VCORR
name: DEFAULT_ORBIT_CORRECTION
singular_values: 16
response_matrix: file:orm.json
response_matrix: ${path:file:orm.json}
12 changes: 6 additions & 6 deletions pyaml/accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,27 +275,27 @@ def from_dict(config_dict: dict, ignore_external=False) -> "Accelerator":
return Factory.build(config_dict, ignore_external)

@staticmethod
def load(filename: str, use_fast_loader: bool = False, ignore_external=False) -> "Accelerator":
def load(filename: str, include_locations: bool = False, ignore_external=False) -> "Accelerator":
"""
Load an accelerator from a config file.

Parameters
----------
filename : str
Configuration file name, yaml or json.
use_fast_loader : bool
Use fast yaml loader. When specified,
no line number are reported in case of error,
include_locations : bool
When False, use faster loader but no line number
are reported in case of error,
only the element name that triggered the error
will be reported in the exception)
will be reported in the exception
ignore_external : bool
Ignore external modules and return None for object that
cannot be created. pydantic schema that support that an
object is not created should handle None fields.
"""
manager = ConfigurationManager()
try:
manager.add(filename, use_fast_loader=use_fast_loader)
manager.add(filename, include_locations=include_locations)
except UnsupportedConfigurationRootError as ex:
raise PyAMLConfigException(
"Accelerator.load() expects a 'pyaml.accelerator' root configuration. "
Expand Down
Loading
Loading