[pre-commit.ci] pre-commit autoupdate#15
Closed
pre-commit-ci[bot] wants to merge 55 commits into0.16.xfrom
Closed
Conversation
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.
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)
a52a476 to
27fb87e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
updates: