1.2.0
Release 1.2.0
brings some new features and dependency changes.
Changes
The
pyhdtoolkit.plotting.envelope
functionsplot_envelope
andplot_stay_clear
have been removed. They are replaced by a new one,plot_beam_envelope
, which handles all enveloppe calculations directly from theMAD-X
instance. Documentation and examples have been updated.
Enhancements
The
pyhdtoolkit.plotting.aperture
module has a new function,plot_physical_apertures
, to try and plot the physical apertures of elements on the given axis.The
pyhdtoolkit.plotting.utils
module has a new function,draw_confidence_ellipse
, to plot the covariance ellipse of two arrays.The
pyhdtoolkit.plotting.layout.plot_machine_layout
function (and those relying on it) can now plot octupole patches.The
pyhdtoolkit.plotting.layout.plot_machine_layout
function (and those relying on it) can now handle single values given for ylimits of different elements in the machine layout. For instance nowk1l_lim=5e-2
is valid and equivalent tok1l_lim=(-5e-2, 5e-2)
.An experimental utility function was added to split a complex-valued columns from a dataframe into two real-valued ones. It might join the public API in a future release, and is for now available as
split_complex_columns
.An experimental utility function was added to add noise to the
LHC
IR BPMs in a given dataframe column. It might join the public API in a future release, and is for now available asadd_noise_to_ir_bpms
.An experimental utility function was added to add noise to the
LHC
arc BPMs in a given dataframe column. It might join the public API in a future release, and is for now available asadd_noise_to_arc_bpms
.The functions in the
pyhdtoolkit.cpymadtools.ptc
module can now be given values for thePTC
universe creation and called commands parameters through keyword arguments. The documentation has been updated with information on the available parameters.
Bug Fixes
The
pyhdtoolkit.plotting.layout.plot_machine_layout
function now only adds a legend for element patches of a certain type if at least one element was drawn.The
pyhdtoolkit.plotting.layout.plot_machine_layout
function now tries to properly determine legend locations based on which elements were drawn.
Documentation
The documentation generated by
Sphinx
should now properly display short type hints instead of the full expanded ones.Some example pages have been updated to use the minimal requirement of provided args for the functions in
matching
.Some typos that were left in a few docstrings have been corrected.
Maintenance
The
madx
argument is now positional only in all APIs involving it (APIs incpymadtools
andplotting
).The
numpy
dependency is now capped at version<1.24.0
, as when using this new version somematplotlib
functions are broken.Various type hints from the
typing
module, such asDict
orList
, have been superseeded by the default, now-standard builtins (such asdict
orlist
).
See v1.2.0 release notes on GitHub and the full changes since v1.1.1.