Pyhdtoolkit

Latest version: v1.7.0

Safety actively analyzes 710445 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 6 of 9

0.11.0

Added:
- A `cpymadtools.utils` module with convenience functions for `cpymad.mad.Madx` objects, for now containing a single function `get_table_tfs` which turns an internal `MAD-X` table into a `TfsDataFrame.
- The `get_amplitude_detuning` and `get_rdts` functions in the `cpymadtools.ptc` module now contain extensive docstrings detailing their inner workings as well as parameters used in internal `MAD-X` commands.
- Both functions above now have a `fringe` argument defaulting to `False` in order to enable fringe field calculations.
- Both functions above now transmit keyword arguments to respectively `ptc_normal` and `ptc_twiss`.

0.10.0

Added:
- The `track_single_particle` function in the `cpymadtools.track` module can now take a sequence defining observation points as argument.
- The `track_single_particle` function in the `cpymadtools.track` module can now take keyword arguments to be transmitted to the `TRACK` command in `MAD-X`.

Changed:
- The `track_single_particle` function in the `cpymadtools.track` module now defaults initial tracking coordinates to all 0.
- The `track_single_particle` function in the `cpymadtools.track` module now returns a dictionary, with one keys per defined observation point and as a value the corresponding track table. The special case where `ONETABLE` s given to `TRACK` 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.

0.9.2

Added:
- A `match_no_coupling_through_ripkens` function in the `cpymadtools.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 for `matplotlib`, which is sometimes where it will look when running `plt.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 the `cpymadtools.latwiss` module now uses clearer markers to indicate the machine survey, properly matches the colormaps of the plotted dipoles and the colorbar when using `show_elements=True` and lets the user config handle `savefig` options.

0.9.1

Added:
- An `install_mpl_style` function in the `utils.defaults` module to create a `phd.mplstyle` file in `matplotlib`'s stylelib directory, making the style callable through `plt.style.use("phd")`.

Changed:
- The `PLOT_PARAMS` dictionary in `utils.defaults` has been updated.

Removed:
- The `numba` library's used has been removed, easing the package's dependencies.


Additional dependencies are `pydantic`, `rich` and `pendulum`. The `llvmlite` dependency is also added explicitely, though it is a dependency of `numba` and the version constraint is here to guarantee `pyhdtoolkit` will build on Python 3.9.
Tests now include Python 3.9.

0.9.0

Added:
- A `misalign_lhc_ir_quadrupoles` function in the `cpymadtools.errors` module to conveniently apply `EALIGN` to IR quadrupoles.
- A `misalign_lhc_triplets` function in the `cpymadtools.errors`, convenience wrapper around the aforementioned one for triplets.
- A `correct_lhc_orbit` function in the `cpymadtools.orbit` module to perform orbit correction using `MCB.*` elements in the LHC.
- A `vary_independent_ir_quadrupoles` function in the `cpymadtools.special` to conveniently send the `vary` commands for the desired quadrupoles in the IRs.
- A `tune` module in `cpymadtools` with currently a `make_footprint_table` function that creates a `DYNAP` setup according to parameters and returns the generated table.
- An `utils.htc_monitor` module with functionality to query the HTCondor queue, process the returned data and nicely display it. To be ran directly, but different functionality can be imported.

Changed:
- The `telescopic_squeeze` parameter in `match_tunes_and_chromaticities` now defaults to True, to reflect the LHC scenario as of Run III.
- The `get_ips_twiss` and `get_ir_twiss` functions have been moved from `cpymadtools.special` to `cpymadtools.twiss`.

Fixed:
- Fixed an issue in `plot_latwiss` where the function would sometimes mishandle the `xlimits` argument.
- Fixed a mistake in `apply_lhc_rigidity_waist_shift_knob` where the `side` argument would be ignored if uppercase.

Additional dependencies are `pydantic`, `rich` and `pendulum`. The `llvmlite` dependency is also added explicitely, though it is a dependency of `numba` and the version constraint is here to guarantee `pyhdtoolkit` will build on Python 3.9.
Tests now include Python 3.9.

0.8.5

Release 0.8.5 brings minor fixes and changes.

Fixed:
- The `match _tunes_and_chromaticities` now properly behaves if some of the targets are set to 0.

Changed:
- The default behavior in lattice slicing is changed to have `makedipedge` as `False`, which compensates the effect of the default slicing style `TEAPOT`.

Page 6 of 9

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.