Skip to content

Remove bug in error reporting - #412

Merged
gubaidulinvadim merged 1 commit into
mainfrom
fix-bug-error-reporting
Sep 14, 2026
Merged

Remove bug in error reporting#412
gubaidulinvadim merged 1 commit into
mainfrom
fix-bug-error-reporting

Conversation

@JeanLucPons

@JeanLucPons JeanLucPons commented Sep 14, 2026

Copy link
Copy Markdown
Member

This bug fix error reporting when wrong lattice element was passed.

  File "/operation/common/miniconda/envs/jlp-py312/lib/python3.12/site-packages/pyaml/lattice/simulator.py", line 427, in get_at_elems
    raise PyAMLException(f"{name} not found in lattice:{self._cfg.lattice}")
                                                        ^^^^^^^^^
AttributeError: 'Simulator' object has no attribute '_cfg'

to:

    bpm_elt = self.get_at_elems(bpm)[0]
              ^^^^^^^^^^^^^^^^^^^^^^
  File "/operation/common/miniconda/envs/jlp-py312/lib/python3.12/site-packages/pyaml/lattice/simulator.py", line 427, in get_at_elems
    raise PyAMLException(f"{name} not found in lattice:{self._lattice}")
pyaml.common.exception.PyAMLException: BPM-C04-01 not found in lattice:config/sr/lattices/ebs.mat

@gubaidulinvadim gubaidulinvadim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find!

@gubaidulinvadim

Copy link
Copy Markdown
Member

@JeanLucPons @gupichon the smoke test is failing, I don't think this is related to this PR, so I will merge. Is this a known issue?

>       raise PyAMLConfigException(message) from None
E       pyaml.common.exception.PyAMLConfigException: Validation failed for class: 'pyaml_cs_oa.controlsystem.ConfigModel'.
E       Field 'backend' is invalid:
E         error: Extra inputs are not permitted
E         got: 'EPICS'

@gubaidulinvadim
gubaidulinvadim merged commit 7b40970 into main Sep 14, 2026
3 of 4 checks passed
@gubaidulinvadim
gubaidulinvadim deleted the fix-bug-error-reporting branch September 14, 2026 11:39
@JeanLucPons

Copy link
Copy Markdown
Member Author

@JeanLucPons @gupichon the smoke test is failing, I don't think this is related to this PR, so I will merge. Is this a known issue?

>       raise PyAMLConfigException(message) from None
E       pyaml.common.exception.PyAMLConfigException: Validation failed for class: 'pyaml_cs_oa.controlsystem.ConfigModel'.
E       Field 'backend' is invalid:
E         error: Extra inputs are not permitted
E         got: 'EPICS'

@gubaidulinvadim @gupichon
No this is link to my previous comment, that dt4acc is using BESSY2 example in pyaml directory.
It should use example working with fixed backend release.

@TeresiaOlsson

Copy link
Copy Markdown
Member

@JeanLucPons @gupichon the smoke test is failing, I don't think this is related to this PR, so I will merge. Is this a known issue?

>       raise PyAMLConfigException(message) from None
E       pyaml.common.exception.PyAMLConfigException: Validation failed for class: 'pyaml_cs_oa.controlsystem.ConfigModel'.
E       Field 'backend' is invalid:
E         error: Extra inputs are not permitted
E         got: 'EPICS'

@gubaidulinvadim @gupichon No this is link to my previous comment, that dt4acc is using BESSY2 example in pyaml directory. It should use example working with fixed backend release.

There should be no pyaml_cs_oa.controlsystem.ConfigModel anymore in the latest release. So maybe it is just using an old release and the version can now be updated?

@JeanLucPons

Copy link
Copy Markdown
Member Author

@TeresiaOlsson
A ._cfg was still there is pyaml simulator. No problem, for the moment, with pyaml-cs-oa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants