Skip to content

Commit 85b3ff5

Browse files
authored
Changes for 1.1.0 (#99)
1 parent b6d6e46 commit 85b3ff5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+4093
-2457
lines changed

.github/workflows/coverage.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
- name: Install package with test dependencies
3434
run: python -m pip install ".[test]"
3535

36+
- name: Get acc-models-lhc
37+
run: git clone https://gitlab.cern.ch/acc-models/acc-models-lhc.git --depth 1
38+
3639
- name: Run all tests
3740
run: make alltests
3841

.github/workflows/cron.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@ jobs:
4141
- name: Install package with test dependencies
4242
run: python -m pip install ".[test]"
4343

44+
- name: Get acc-models-lhc
45+
run: git clone https://gitlab.cern.ch/acc-models/acc-models-lhc.git --depth 1
46+
4447
- name: Run Tests
4548
run: make alltests

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,8 @@ jobs:
5858
- name: Install package
5959
run: python -m pip install ".[test]"
6060

61+
- name: Get acc-models-lhc
62+
run: git clone https://gitlab.cern.ch/acc-models/acc-models-lhc.git --depth 1
63+
6164
- name: Run Tests
6265
run: make slowtests

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,4 +252,6 @@ Temporary Items
252252
# Sphinx build directory and sphinx-gallery generated documents
253253
doc_build/
254254
docs/gallery/
255-
docs/gen_modules/
255+
docs/gen_modules/
256+
257+
acc-models-lhc/

docs/api/cpymadtools.rst

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,46 @@ The ``cpymadtools`` subpackage is a collection of utilities to conveniently hand
88
.. automodule:: pyhdtoolkit.cpymadtools.constants
99
:members:
1010

11-
.. automodule:: pyhdtoolkit.cpymadtools.correctors
11+
.. automodule:: pyhdtoolkit.cpymadtools.coupling
1212
:members:
1313

14-
.. automodule:: pyhdtoolkit.cpymadtools.coupling
14+
.. automodule:: pyhdtoolkit.cpymadtools.lhc
1515
:members:
1616

17-
.. automodule:: pyhdtoolkit.cpymadtools.errors
17+
.. automodule:: pyhdtoolkit.cpymadtools.lhc._coupling
1818
:members:
1919

20-
.. automodule:: pyhdtoolkit.cpymadtools.generators
20+
.. automodule:: pyhdtoolkit.cpymadtools.lhc._elements
2121
:members:
2222

23-
.. automodule:: pyhdtoolkit.cpymadtools.lhc
23+
.. automodule:: pyhdtoolkit.cpymadtools.lhc._errors
2424
:members:
2525

26-
.. automodule:: pyhdtoolkit.cpymadtools.matching
26+
.. automodule:: pyhdtoolkit.cpymadtools.lhc._misc
2727
:members:
2828

29-
.. automodule:: pyhdtoolkit.cpymadtools.orbit
29+
.. automodule:: pyhdtoolkit.cpymadtools.lhc._powering
3030
:members:
3131

32-
.. automodule:: pyhdtoolkit.cpymadtools.parameters
32+
.. automodule:: pyhdtoolkit.cpymadtools.lhc._queries
3333
:members:
3434

35-
.. automodule:: pyhdtoolkit.cpymadtools.ptc
35+
.. automodule:: pyhdtoolkit.cpymadtools.lhc._routines
36+
:members:
37+
38+
.. automodule:: pyhdtoolkit.cpymadtools.lhc._setup
3639
:members:
3740

38-
.. automodule:: pyhdtoolkit.cpymadtools.setup
41+
.. automodule:: pyhdtoolkit.cpymadtools.lhc._twiss
42+
:members:
43+
44+
.. automodule:: pyhdtoolkit.cpymadtools.matching
45+
:members:
46+
47+
.. automodule:: pyhdtoolkit.cpymadtools.parameters
48+
:members:
49+
50+
.. automodule:: pyhdtoolkit.cpymadtools.ptc
3951
:members:
4052

4153
.. automodule:: pyhdtoolkit.cpymadtools.track

docs/quickstart.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Then using the `~pyhdtoolkit.cpymadtools` apis goes as:
9393
In the `~pyhdtoolkit.cpymadtools` one will find modules to:
9494

9595
* Encompass existing ``MAD-X`` commands, such as for example :ref:`matching <cpymadtools-matching>` or :ref:`tracking <cpymadtools-track>`;
96-
* Perform useful routines with a clean pythonic interface (for instance :ref:`betatron coupling <cpymadtools-coupling>` calculation and handling, :ref:`errors assignments <cpymadtools-errors>` or :ref:`table querying <cpymadtools-utils>`);
96+
* Perform useful routines with a clean pythonic interface (for instance :ref:`betatron coupling <cpymadtools-coupling>` calculation and handling or :ref:`table querying <cpymadtools-utils>`);
9797
* Run :ref:`(HL)LHC <cpymadtools-lhc>` specific functionality, mostly tailored to my work.
9898

9999
One can find many examples of the `~pyhdtoolkit.cpymadtools` apis' use in the :ref:`gallery <gallery>` section of this documentation.

docs/release.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ Release Notes
33

44
The full list of releases can be found in the GitHub repository's `releases page <https://github.com/fsoubelet/PyhDToolkit/releases>`_.
55

6+
Version 1.1.0
7+
-------------
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
12+
releases/v1.1.0
13+
614
Version 1.0.0
715
-------------
816

docs/releases/v1.1.0.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
.. _release_1.1.0:
2+
3+
1.1.0
4+
-----
5+
6+
Release `1.1.0` brings some changes to match the adapted extracted API for `beamopticsanalysis/cpymadtools`.
7+
Code using ``pyhdtoolkit`` will need to be adapted.
8+
9+
Breaking Changes
10+
~~~~~~~~~~~~~~~~
11+
12+
* The `~pyhdtoolkit.cpymadtools.correctors`, `~pyhdtoolkit.cpymadtools.errors`, `~pyhdtoolkit.cpymadtools.orbit` and `~pyhdtoolkit.cpymadtools.setup` modules has been removed and their functionality included in `~pyhdtoolkit.cpymadtools.lhc`, as it was ``LHC``-specific.
13+
* The `~pyhdtoolkit.plotting.generators` module has been made private.
14+
15+
Bug Fixes
16+
~~~~~~~~~
17+
18+
* The `~pyhdtoolkit.cpymadtools.lhc.prepare_lhc_run2` function now properly calls the found sequence file.
19+
* The `~pyhdtoolkit.cpymadtools.utils.get_table_tfs` function now avoids using the `.dframe()` method of tables and converts them to a dict, then to a DataFrame to export. The previous implementation would sometimes crash on certain element names, or in cases of sliced sequences.
20+
21+
Enhancements
22+
~~~~~~~~~~~~
23+
24+
* The `~pyhdtoolkit.cpymadtools.lhc.do_kmodulation` function now accepts ``kwargs`` that will be passed down to the ``TWISS`` call.
25+
26+
Maintenance
27+
~~~~~~~~~~~
28+
29+
* Documentation has been updated for all new APIs. Refer to the gallery for example uses.
30+
* The `~pyhdtoolkit.cpymadtools._generators` being now private, they have been removed from the public API documentation.
31+
* Tests and internal API usehave been adapted.
32+
* Some style parameters in `~pyhdtoolkit.plotting.styles.paper` have been adapted.
33+
* The `~pyhdtoolkit.cpymadtools.lhc` module has been split up into many smaller *private* modules. The functionality of the APIs is unchanged, and they are still exposed at the `~pyhdtoolkit.cpymadtools.lhc` level.
34+
35+
36+
See `v1.1.0 release notes on GitHub <https://github.com/fsoubelet/PyhDToolkit/releases/tag/1.1.0>`_ and the `full changes since v1.0.0 <https://github.com/fsoubelet/PyhDToolkit/compare/1.0.0...1.1.0>`_.

examples/demo_acd_tracking_spectra.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from pyhdtoolkit.plotting.styles import _SPHINX_GALLERY_PARAMS
3030
from pyhdtoolkit.utils import logging
3131

32-
logging.config_logger(level="warning")
32+
logging.config_logger(level="error")
3333
plt.rcParams.update(_SPHINX_GALLERY_PARAMS) # for readability of this tutorial
3434

3535
###############################################################################
@@ -164,6 +164,6 @@
164164
# The use of the following functions, methods, classes and modules is shown
165165
# in this example:
166166
#
167-
# - `~.cpymadtools.lhc`: `~.lhc.make_lhc_beams`, `~.lhc.re_cycle_sequence`, `~.lhc.make_lhc_thin`, `~.lhc.install_ac_dipole_as_kicker`
167+
# - `~.cpymadtools.lhc`: `~.lhc._setup.make_lhc_beams`, `~.lhc._setup.re_cycle_sequence`, `~.lhc._setup.make_lhc_thin`, `~.lhc._elements.install_ac_dipole_as_kicker`
168168
# - `~.cpymadtools.matching`: `~.matching.match_tunes_and_chromaticities`
169169
# - `~.cpymadtools.track`: `~.track.track_single_particle`

examples/demo_aperture.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from pyhdtoolkit.plotting.styles import _SPHINX_GALLERY_PARAMS
2020
from pyhdtoolkit.utils import logging
2121

22-
logging.config_logger(level="warning")
22+
logging.config_logger(level="error")
2323
plt.rcParams.update(_SPHINX_GALLERY_PARAMS) # for readability of this tutorial
2424

2525
###############################################################################
@@ -42,9 +42,7 @@
4242
madx.call("lhc/aper_tol.b1.madx")
4343

4444
madx.command.twiss()
45-
madx.command.aperture(
46-
cor=0.002, dp=8.6e-4, halo="{6,6,6,6}", bbeat=1.05, dparx=0.14, dpary=0.14
47-
)
45+
madx.command.aperture(cor=0.002, dp=8.6e-4, halo="{6,6,6,6}", bbeat=1.05, dparx=0.14, dpary=0.14)
4846

4947
###############################################################################
5048
# We can now determine the exact position of the IP5 point and plot the LHC
@@ -84,5 +82,5 @@
8482
# The use of the following functions, methods, classes and modules is shown
8583
# in this example:
8684
#
87-
# - `~.cpymadtools.lhc`: `~.lhc.make_lhc_beams`
85+
# - `~.cpymadtools.lhc`: `~.lhc._setup.make_lhc_beams`
8886
# - `~.plotting.aperture`: `~.plotting.aperture.plot_aperture`

0 commit comments

Comments
 (0)