Skip to content

[pre-commit.ci] pre-commit autoupdate#15

Closed
pre-commit-ci[bot] wants to merge 55 commits into0.16.xfrom
pre-commit-ci-update-config
Closed

[pre-commit.ci] pre-commit autoupdate#15
pre-commit-ci[bot] wants to merge 55 commits into0.16.xfrom
pre-commit-ci-update-config

Conversation

@pre-commit-ci
Copy link
Copy Markdown
Contributor

@pre-commit-ci pre-commit-ci bot commented Mar 9, 2026

In particular, calling a `Accelerator.elts()` (deprecated) instead of
`Accelerator.elts` (new) raises a specific error.
- Lazy import of `cloudpickle` module
- Use ``Tk`` GUI to select the pickling/unpickling paths.
- Better typing.
intersphinx-mapping should point to a specific pandas version.

See also: pandas-dev/pandas#64028
eg SimulationOutput.plot('v_cav_mv') does not raise error anymore
It simply calls all the stored SimulationOutput `plot` methods and sets
appropriate legend entries.
Use `Accelerator.is_unpickled` attribute.
When the appropriate pickle_path si given in the `TOML`, we unpickle (if
file is found), or we pickle when calling `Accelerator.keep()` (if file
is not found)
All pickle paths defined in the `TOML` are used. If one does not match
an Accelerator name and is an existing file, we append it to the
Accelerators list.
Takes the role of Accelerator.name
Also implemented a parsing function. Allows to link in the `TOML` the
various pickled/unpickled Accelerators to the proper FaultScenario.
Accelerator.id concatenates FaultScenario index and Accelerator.name
In particular, only load necessary pickles.
AdrienPlacais and others added 25 commits March 4, 2026 09:33
Currently, the kernel must be restarted for unpickling to correctly
work. This is because a new BeamCalculator with a different name is
created at the second execution, so the proper SimulationOutput cannot
be retrieved in the simulation_outputs dictionary.
This was the subdir where results were saved, like `0_Envelope1D` or
`1_TraceWin`. Now, we just pass `BeamCalculator.id`. Same purpose, same
values, but easier to understand and maintain.
Two main modifications:
    - `BeamCalculatorsFactory` follows singleton pattern.
    - `BeamCalculatorsFactory._cache` keeps the created `BeamCalculator`
into memory. If a new solver is asked with the same arguments, we return
cached version instead.

Now, we can make consecutive executions of the code without re-creating
the same solver: `0_Envelope1D`, `1_Envelope1D`, `2_Envelope1D`, etc. In
particular, useful for unpickling and reusing the SimulationOutput in
Accelerators!
Useful during optimization process to avoid pickling several times a
partially fixed linac.
New argument (and associated private attribute) `skip_optimization`.
In particular, handle rephasing, logging, etc to skipped optimizations.
Can plot arbitrary number of accelerators.
Fixes two bugs:
   - `dict` in `TraceWin` kwargs were not hashable
   - Bad design led to always returning the same BeamCalculator in tests
      - This fix is only a patch.
In particular, the reset of BeamCalculator/BeamCalculatorsFactory to
avoid interferences between tests
Was also necessary to refactor how error plots data is calculated.
3.14 un-parenthesizes multiple exceptions, which is not 3.12 compatible
updates:
- [github.com/psf/black-pre-commit-mirror: 26.1.0 → 26.3.1](psf/black-pre-commit-mirror@26.1.0...26.3.1)
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from a52a476 to 27fb87e Compare March 16, 2026 22:03
@AdrienPlacais AdrienPlacais changed the base branch from main to 0.16.x April 13, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant