Releases: fsoubelet/PyhDToolkit
Release 0.14.1
Release 0.14.1
is a minor version with no functionality change.
Both tracking functions ptc_track_particle
and track_single_particle
in respectively the cpymadtools.ptc
and cpymadtools.track
modules now log a warning when a string value is given to their sequence
argument.
Giving a value means the provided sequence will be USE
-ed in MAD-X
, leading to a loss of set errors, orbit corrections etc whch the user should be well aware of. This caveat has been added to the functions' docstrings.
An info level log has also been added at the start of each function for consistency with the rest of the package.
Release 0.14.0
Release 0.14.0 brings significant API changes, some of them backwards-incompatible.
Changed:
- Functions from the
cpymadtools.latwiss
module have into a class namedLatticePlotter
in thecpymadtools.plotters
module. - The old
AperturePlotter
class in thecpymadtools.plotters
module has been renamed toBeamEnvelopePlotter
to reflect its role, and functions in this class have also been renamed accordingly. - The old
TuneDiagramPlotter.plot_blank_tune_diagram
function in thecpymadtools.plotters
module has replaced theTuneDiagramPlotter.plot_tune_diagram
function and taken its name. - The
phd
matplotlib style has a new setting forlegend.framealpha
set at 0.9.
Added:
- A new
AperturePlotter
class in thecpymadtools.plotters
module replacing the old one, with functionality to plot the aperture tolerances as calculated from theAPERTURE
command inMAD-X
, jointly with the lattice layout. - A
CrossingSchemePlotter
class in thecpymadtools.plotters
module, with functionality to plot the orbit crossings at LHC IPs. - The new
TuneDiagramPlotter.plot_tune_diagram
function in thecpymadtools.plotters
module is now more customisable, can be given a title, a figure size, add legends, differentiate between resonance lines of different orders and given a specific order up to which to plot resonance lines.
Removed:
- The
cpymadtools.latwiss
module has been removed. - The old
TuneDiagramPlotter.plot_blank_tune_diagram
function in thecpymadtools.plotters
module has been removed.
Note: the class currently named DynamicAperturePlotter
in the cpymadtools.plotters
module is misleadingly named and will be renamed in a future release.
Release 0.13.3
Release 0.13.3 brings the following:
Changed:
- All functions in the
cpymadtools
module which offer thetelescopic_squeeze
argument now have it default toTrue
to reflect operational scenarios of Run III. - The
correct_lhc_orbit
function incpymadtools.orbit
now takes a requiredsequence
positional argument. - The
correct_lhc_orbit
function incpymadtools.orbit
now defaults itsmode
argument tomicado
like theCORRECT
command inMAD-X
does. - The
AperturePlotter.plot_aperture
function incpymadtools.plotters
now has a defaultfigsize
argument of(13, 20)
instead of15, 15
. - The minimum required version of
tfs-pandas
is now3.0.0
.
Added:
- The
plot_machine_layout
function incpymadtools.latwiss
now accepts keyword arguments which are transmitted tomatplotlib.pyplot.scatter
calls. - The
TuneDiagramPlotter.plot_blank_tune_diagram
function incpymadtools.plotters
now has afigsize
argument. - The package documentation has been expanded and now includes links to example jupyter notebooks runable with binder.
Fixed:
- All plotting functions in the
cpymadtools
module now have LaTeX-compatible text elements. - The
plot_latwiss
andplot_machine_survey
functions incpymadtools.latwiss
now properly detect element types fromTWISS
table properties and does not rely on naming anymore. - The
plot_machine_layout
function incpymadtools.latwiss
now correctly scales thecolorbar
to the full length of the machine and now to 1. - The
match_tunes_and_chromaticities
function incpymadtools.matching
now properly handles being given either only tune targets or only chromaticity targets. - The
BeamParameters
class inmodels.beam
now properly builds in all cases and has arepr
. - Fixed some calls to the
SELECT
command viacpymad
which might previously have had unintended side effects.
Release 0.13.2
Release 0.13.2
is a hotfix for the get_pattern_twiss
function in cpymadtoos.twiss
.
Starting with cpymad 1.9.0, Table.selected_rows()
now actually returns the indices of the selected elements rather than returning a boolean mask.
The previous (faulty) behavior had been worked around in get_pattern_twiss
, which is now an issue.
With this release, cpymad >= 1.9.0
which is now the minimum required version and the correct Table.selected_rows()
behavior is used.
Release 0.13.1
Release 0.13.1 is a hotfix for the AC dipole installation routines.
Both routines now use the implementation from omc3
's model_creator
and will provide similar results.
Release 0.13.0
Release 0.13.0 brings the following:
Changed:
- The
install_ac_dipole
function incpymadtools.special
is now namedinstall_ac_dipole_as_kicker
. Thiskicker
implementation cannot be used to affecttwiss
functions, only particle tracking.
Added:
- An
install_ac_dipole_as_matrix
functioncpymadtools.special
to install an AC Dipole element as amatrix
, which will reflect its effect ontwiss
functions (which the kicker implementation does not). Thismatrix
implementation cannot be used to influence particle tracking.
Fixed:
- The
install_ac_dipole_as_kicker
now properly sets the element location to avoid a negative drift (location taken fromomc3
'smodel_creator
) if the sequence wasn't previously made THIN (which it should). - The
install_ac_dipole_as_kicker
now makes ause, sequence=...
call after installing the element. Beware this means errors, correctors etc that were set / loaded will be lost.
Release 0.12.0
Release 0.12.0 brings the following:
Added:
- A
models
module incpymadtools
to hold variouspydantic
models for data manipulated in the library functions. - A
query_beam_attributes
function incpymadtools.parameters
that returns a parsed and validatedMADXBeam
with allBEAM
attributes from theMAD-X
process based on the currently defined beam. - A
ptc_twiss
function incpymadtools.ptc
to conveniently create thePTC
universe and perform a TWISS command according to the Ripken-Mais formalism. - A
ptc_track_particle
function incpymadtools.ptc
to conveniently create thePTC
universe and perform particle tracking similarly tocpymadtools.track.track_single_particle
. - A
get_footprint_lines
function incpymadtools.tune
to obtain the (Qx, Qy) points needed to plot the footprint based on theTfsDataFrame
returned bymake_footprint_table
. To be considered experimental. - A
get_footprint_patches
function incpymadtools.tune
to obtain a collection ofmatplotlib.patches.Polygon
elements needed to plot the footprint based on theTfsDataFrame
returned bymake_footprint_table
. To be considered experimental. - The
get_table_tfs
function incpmadtools.utils
now takes aheaders_table
argument to choose an internal table to use for headers.
Changed:
- The default
energy
value incpymadtools.special.make_lhc_beams
has been changed to 7000 [GeV] to reflect run III scenario. - The value for
npart
incpymadtools.special.make_lhc_beams
has been changed to 1.15e11 to reflect run III scenario. - The
make_footprint_table
incpymadtools.tune
now returns atfs.TfsDataFrame
instead of apandas.DataFrame
, the headers of which are populated with useful values for other functions. - The
beam_parameters
function incpymadtools.parameters
has been moved to theoptics.beam
module and renamedcompute_beam_parameters
. - The default
patch.linewidth
value in thephd
matplotlib style has been changed to 1.5.
Release 0.11.0
Release 0.11.0 brings the following:
Added:
- A
cpymadtools.utils
module with convenience functions forcpymad.mad.Madx
objects, for now containing a single functionget_table_tfs
which turns an internalMAD-X
table into a `TfsDataFrame. - The
get_amplitude_detuning
andget_rdts
functions in thecpymadtools.ptc
module now contain extensive docstrings detailing their inner workings as well as parameters used in internalMAD-X
commands. - Both functions above now have a
fringe
argument defaulting toFalse
in order to enable fringe field calculations. - Both functions above now transmit keyword arguments to respectively
ptc_normal
andptc_twiss
.
Release 0.10.0
Release 0.10.0 brings the following:
Added:
- The
track_single_particle
function in thecpymadtools.track
module can now take a sequence defining observation points as argument. - The
track_single_particle
function in thecpymadtools.track
module can now take keyword arguments to be transmitted to theTRACK
command inMAD-X
.
Changed:
- The
track_single_particle
function in thecpymadtools.track
module now defaults initial tracking coordinates to all 0. - The
track_single_particle
function in thecpymadtools.track
module now returns a dictionary, with one keys per defined observation point and as a value the corresponding track table. The special case whereONETABLE
s given toTRACK
as a keyword argument is handled, and then a single entry taken from the appropriate table with be found in the returned dictionary.
Tests have been added.
Release 0.9.2
Release 0.9.2 brings the following:
Added:
- A
match_no_coupling_through_ripkens
function in thecpymadtools.special
module as a 0-coupling matching routine through cross-term Ripken parameters at a given location.
Fixed:
- The
install_mpl_style
function now installs the.mplstyle
file also in the site-packages location formatplotlib
, which is sometimes where it will look when runningplt.style.use("phd")
.
-
The closest tune approach routine now properly makes use of
madx.batch()
to restore settings. -
The plotting functions in the
cpymadtools.latwiss
module have updated LaTeX-compatible labels. -
The
plot_survey
function in thecpymadtools.latwiss
module now uses clearer markers to indicate the machine survey, properly matches the colormaps of the plotted dipoles and the colorbar when usingshow_elements=True
and lets the user config handlesavefig
options.