From 24368405bd01ed696c4873cf891e2e3f5a265028 Mon Sep 17 00:00:00 2001 From: Felix Soubelet Date: Tue, 27 Jan 2026 15:47:28 +0100 Subject: [PATCH 1/5] require extra for pytz from pandas --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7e11954..68de5cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ classifiers = [ dependencies = [ "numpy >= 1.24", "scipy >= 1.10", - "pandas >= 2.1", + "pandas[timezone] >= 2.1", "matplotlib >= 3.8", "tfs-pandas >= 3.8", "generic-parser >= 1.1", From 2404078a86a82c8cd08878c67efdb403d320d905 Mon Sep 17 00:00:00 2001 From: Felix Soubelet Date: Tue, 27 Jan 2026 15:48:39 +0100 Subject: [PATCH 2/5] patch version and changelog --- CHANGELOG.md | 58 ++++++++++++++++++++++++++++++----------------- pylhc/__init__.py | 2 +- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7aeed8e..d8de761 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # pylhc Changelog +## Version 0.8.3 + +Explicitely require the `pytz` package as a dependency since it is no longer a hard dependency of `pandas 3.x`, which we relied on.g + ## Version 0.8.2 Dropped support for `Python 3.9`. @@ -7,38 +11,44 @@ Dropped support for `Python 3.9`. ## Version 0.8.1 Fixed: - - add FILL and JSON_FILE to output table of kickgroup summary - - catch empty kickgroups gracefully - - adapt for moving the `.sdds` and `.json` files to backup folders on `nfs` - - addtional checks/warning/dict-keys for old versions of the `.json` files + +- add FILL and JSON_FILE to output table of kickgroup summary +- catch empty kickgroups gracefully +- adapt for moving the `.sdds` and `.json` files to backup folders on `nfs` +- addtional checks/warning/dict-keys for old versions of the `.json` files ## Version 0.8.0 Fixed: - - replaced `get_loc` with `get_indexer` to be compatible with `pandas` > 2.0 + +- replaced `get_loc` with `get_indexer` to be compatible with `pandas` > 2.0 Added: - - `beamprocess` option to Machine Settings Info, to allow manual override. + +- `beamprocess` option to Machine Settings Info, to allow manual override. Removed: - - `hdf5` reader/writer for `tfs` as this is already in `tfs-pandas` + +- `hdf5` reader/writer for `tfs` as this is already in `tfs-pandas` ## Version 0.7.4 Changes in Machine Settings Info - - Default behaviour for no knobs given: extract None. - - Old behaviour of extracting all restored by giving `knobs = ["all"]` - - Option `["default"]` available for default knobs. - - Additional debug logging + +- Default behaviour for no knobs given: extract None. +- Old behaviour of extracting all restored by giving `knobs = ["all"]` +- Option `["default"]` available for default knobs. +- Additional debug logging ## Version 0.7.3 Fixes: - - LSA to MADX sign convention - - Better trim naming - - check madx names for allowed characters - - option to init all variables - - machine settings info takes ISO time + +- LSA to MADX sign convention +- Better trim naming +- check madx names for allowed characters +- option to init all variables +- machine settings info takes ISO time ## Version 0.7.2 @@ -59,9 +69,10 @@ Added a flag to the `info` functionality of `pylhc.kickgroups` to display a copy ## Version 0.6.1 Bugfixes in KickGroups: - - Better error message when there are no kicks in group. - - Find correct planes in lists of data. - - Renamed functions to `list` and `info`. + +- Better error message when there are no kicks in group. +- Find correct planes in lists of data. +- Renamed functions to `list` and `info`. ## Version 0.6.0 @@ -76,10 +87,10 @@ Removed `irnl_rdt_correction`. Is now in https://github.com/pylhc/irnl_rdt_corre Minor bugfixes in `machine_settings_info`. - Added: - - `time` and `start_time` can now be given as `AccDatetime`-objects. + - `time` and `start_time` can now be given as `AccDatetime`-objects. - Fixed: - - `trims` variable is initialized as `None`. Was not initialized if no + - `trims` variable is initialized as `None`. Was not initialized if no trims were found, but used later on. @@ -102,9 +113,11 @@ The return values are now organized into a dictionary. Release `0.3.0` brings the following: Added: + - Non-linear correction script for the (HL)LHC Insertion Regions Resonance Driving Terms, including feed-down effects. Changed: + - The package's license has been moved from `GPLv3` to `MIT`. Note: if one wishes to extend the `IRNL` correction script to a different accelerator, @@ -117,16 +130,19 @@ there are valuable pointers in the following This is the first release of `pylhc` since its `omc3` dependency is available on `PyPI`. Added: + - BPM calibration script to get calibration factors from different BPMs - Proper mocking of CERN TN packages (functionality imported from `omc3`) Changed: + - Minimum required `tfs-pandas` version is now `3.0.2` - Minimum required `generic-parser` version is now `1.0.8` - Minimum required `omc3` version is now `0.2.0` - Extras related to the CERN TN are now installed with `python -m pip install pylhc[cern]` Removed: + - The `HTCondor` and `AutoSix` functionality have been removed and extracted to another package at https://github.com/pylhc/submitter diff --git a/pylhc/__init__.py b/pylhc/__init__.py index 89ca177..7e469e2 100644 --- a/pylhc/__init__.py +++ b/pylhc/__init__.py @@ -11,7 +11,7 @@ __title__ = "pylhc" __description__ = "An accelerator physics script collection for the OMC team at CERN." __url__ = "https://github.com/pylhc/pylhc" -__version__ = "0.8.2" +__version__ = "0.8.3" __author__ = "pylhc" __author_email__ = "pylhc@github.com" __license__ = "MIT" From 5cc64a0542c9e1db5f777ace2b0b9e2c26cccc48 Mon Sep 17 00:00:00 2001 From: Felix Soubelet Date: Thu, 29 Jan 2026 17:27:42 +0100 Subject: [PATCH 3/5] doc configuration fixes as in https://github.com/pylhc/omc3/pull/564 --- doc/entrypoints/analysis.rst | 7 +------ doc/entrypoints/bpm_calibration.rst | 4 +--- doc/entrypoints/kickgroups.rst | 2 -- doc/entrypoints/lsa_to_madx.rst | 2 -- doc/entrypoints/machine_info.rst | 6 ------ doc/modules/calibration.rst | 6 ------ doc/modules/constants.rst | 16 +--------------- doc/modules/data_extract.rst | 8 +------- 8 files changed, 4 insertions(+), 47 deletions(-) diff --git a/doc/entrypoints/analysis.rst b/doc/entrypoints/analysis.rst index 0767a94..361735a 100644 --- a/doc/entrypoints/analysis.rst +++ b/doc/entrypoints/analysis.rst @@ -1,11 +1,6 @@ Analysis Tools -************************** +************** .. automodule:: pylhc.bsrt_analysis - :members: - :noindex: - .. automodule:: pylhc.forced_da_analysis - :members: - :noindex: diff --git a/doc/entrypoints/bpm_calibration.rst b/doc/entrypoints/bpm_calibration.rst index c905a97..5d0b501 100644 --- a/doc/entrypoints/bpm_calibration.rst +++ b/doc/entrypoints/bpm_calibration.rst @@ -1,6 +1,4 @@ BPM Calibration -************************** +*************** .. automodule:: pylhc.bpm_calibration - :members: - :noindex: diff --git a/doc/entrypoints/kickgroups.rst b/doc/entrypoints/kickgroups.rst index a99ef1e..c0d5840 100644 --- a/doc/entrypoints/kickgroups.rst +++ b/doc/entrypoints/kickgroups.rst @@ -2,5 +2,3 @@ KickGroup Informations ********************** .. automodule:: pylhc.kickgroups - :members: - :noindex: diff --git a/doc/entrypoints/lsa_to_madx.rst b/doc/entrypoints/lsa_to_madx.rst index 925c1f6..795620e 100644 --- a/doc/entrypoints/lsa_to_madx.rst +++ b/doc/entrypoints/lsa_to_madx.rst @@ -2,5 +2,3 @@ LSA Knobs to MAD-X Expressions Converter **************************************** .. automodule:: pylhc.lsa_to_madx - :members: - :noindex: diff --git a/doc/entrypoints/machine_info.rst b/doc/entrypoints/machine_info.rst index 323c10e..8fb58e0 100644 --- a/doc/entrypoints/machine_info.rst +++ b/doc/entrypoints/machine_info.rst @@ -2,11 +2,5 @@ Machine Information Tools ************************* .. automodule:: pylhc.machine_settings_info - :members: - :noindex: - .. automodule:: pylhc.bsrt_logger - :members: - :noindex: - diff --git a/doc/modules/calibration.rst b/doc/modules/calibration.rst index 3aa963c..cde78b1 100644 --- a/doc/modules/calibration.rst +++ b/doc/modules/calibration.rst @@ -2,11 +2,5 @@ BPM Calibration Utilities ************************** .. automodule:: pylhc.calibration.beta - :members: - :noindex: - .. automodule:: pylhc.calibration.dispersion - :members: - :noindex: - diff --git a/doc/modules/constants.rst b/doc/modules/constants.rst index 5ffab80..21feaa6 100644 --- a/doc/modules/constants.rst +++ b/doc/modules/constants.rst @@ -1,27 +1,13 @@ Constants Definitions -************************** +********************* .. automodule:: pylhc.constants.general - :members: - :noindex: - .. automodule:: pylhc.constants.forced_da_analysis - :members: - :noindex: - .. automodule:: pylhc.constants.kickgroups - :members: - :noindex: - .. automodule:: pylhc.constants.machine_settings_info - :members: - :noindex: - .. automodule:: pylhc.constants.calibration - :members: - :noindex: diff --git a/doc/modules/data_extract.rst b/doc/modules/data_extract.rst index f32f943..a477d34 100644 --- a/doc/modules/data_extract.rst +++ b/doc/modules/data_extract.rst @@ -1,12 +1,6 @@ Data Extraction -************************** +*************** .. automodule:: pylhc.data_extract.lsa - :members: - :noindex: - .. automodule:: pylhc.data_extract.timber - :members: - :noindex: - From 42c8b913c366234c360794fea78016da4cf4b6bf Mon Sep 17 00:00:00 2001 From: Felix Soubelet Date: Thu, 29 Jan 2026 17:27:55 +0100 Subject: [PATCH 4/5] doc configuration fixes as in https://github.com/pylhc/omc3/pull/564 --- doc/conf.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index a973ebc..292b068 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -81,10 +81,7 @@ def about_package(init_posixpath: pathlib.Path) -> dict: # templates_path = ['_templates'] # The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# -# source_suffix = ['.rst', '.md'] -source_suffix = ".rst" +source_suffix = {".rst": "restructuredtext"} # The master toctree document. master_doc = "index" @@ -140,8 +137,8 @@ def about_package(init_posixpath: pathlib.Path) -> dict: html_theme_options = { "collapse_navigation": False, - "display_version": True, - "logo_only": False, + #'display_version': True, # show version in the sidebar (currently not working: https://github.com/readthedocs/sphinx_rtd_theme/issues/1624) + 'logo_only': True, # if True, display only logo image, no project name "navigation_depth": 2, "style_external_links": True, } @@ -248,10 +245,20 @@ def about_package(init_posixpath: pathlib.Path) -> dict: "PyQt5.QtCore", "PyQt5.QtWidgets", "matplotlib.backends.backend_qt5agg", + "jpype" "pjlsa", "pytimber", ] +autodoc_default_options = { + "members": True, # include members + "undoc-members": True, # add all members, even if they have no docstring + "show-inheritance": True, # e.g. ``class LHC(Accelerator)`` shows ``BaseClass: Accelerator`` + # "no-index-entry": True, # don't add an index entry (toc_object_entries below works better for our use case) +} + +toc_object_entries = False # do not create entries for domain objects (e.g. functions, classes, attributes, etc.). + # -- Instersphinx Configuration ---------------------------------------------- # Example configuration for intersphinx: refer to the Python standard library. From bd4f112de7ceda4837c5bd18cab4208c9eca3165 Mon Sep 17 00:00:00 2001 From: Felix Soubelet Date: Thu, 29 Jan 2026 17:28:27 +0100 Subject: [PATCH 5/5] seems we also need <9.0 sphinx behavior on autodoc --- doc/conf.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index 292b068..0c92c7d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -77,6 +77,11 @@ def about_package(init_posixpath: pathlib.Path) -> dict: napoleon_preprocess_types = True napoleon_attr_annotations = True +# This is to keep the class-based autodoc implementation from sphinx < 9.0 +# It allows us to build on members which needs other runtimes (such as some +# members requiring the JVM to be running for inspection due to jpype) +autodoc_use_legacy_class_based = True + # Add any paths that contain templates here, relative to this directory. # templates_path = ['_templates']