From cfb90d180c930e43087018bb9ccebb797b4e9793 Mon Sep 17 00:00:00 2001 From: Felix Soubelet Date: Mon, 19 Aug 2024 09:07:10 +0200 Subject: [PATCH 1/3] explicitely import complexwarning as its not part of namespace --- omc3/correction/response_madx.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/omc3/correction/response_madx.py b/omc3/correction/response_madx.py index 79742251..874cfbcb 100644 --- a/omc3/correction/response_madx.py +++ b/omc3/correction/response_madx.py @@ -21,11 +21,12 @@ import zipfile import pandas as pd import tfs +from numpy.exceptions import ComplexWarning from optics_functions.coupling import coupling_via_cmatrix import omc3.madx_wrapper as madx_wrapper from omc3.optics_measurements.constants import (BETA, DISPERSION, F1001, F1010, - NORM_DISPERSION, PHASE_ADV, TUNE) + NORM_DISPERSION, PHASE_ADV, TUNE) from omc3.correction.constants import INCR from omc3.model.accelerators.accelerator import Accelerator, AccElementTypes from omc3.utils import logging_tools @@ -154,7 +155,7 @@ def _clean_up(temp_dir: Path, num_proc: int) -> None: def _load_madx_results( variables: List[str], - process_pool: multiprocessing.Pool, + process_pool, incr_dict: dict, temp_dir: Path ) -> Dict[str, tfs.TfsDataFrame]: @@ -213,7 +214,7 @@ def _create_fullresponse_from_dict(var_to_twiss: Dict[str, tfs.TfsDataFrame]) -> resp = np.divide(resp,resp[columns.index(f"{INCR}")]) Q_arr = np.column_stack((resp[columns.index(f"{TUNE}1"), 0, :], resp[columns.index(f"{TUNE}2"), 0, :])).T - with suppress_warnings(np.ComplexWarning): # raised as everything is complex-type now + with suppress_warnings(ComplexWarning): # raised as everything is complex-type now return { f"{PHASE_ADV}X": pd.DataFrame(data=resp[columns.index(f"{PHASE_ADV}X")], index=bpms, columns=keys).astype(np.float64), f"{PHASE_ADV}Y": pd.DataFrame(data=resp[columns.index(f"{PHASE_ADV}Y")], index=bpms, columns=keys).astype(np.float64), From c0e2532be9f78d1be7364aa8c13d841fecb65083 Mon Sep 17 00:00:00 2001 From: Felix Soubelet Date: Mon, 19 Aug 2024 09:07:25 +0200 Subject: [PATCH 2/3] patch version --- omc3/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omc3/__init__.py b/omc3/__init__.py index fa3fe948..2f58dcd9 100644 --- a/omc3/__init__.py +++ b/omc3/__init__.py @@ -11,7 +11,7 @@ __title__ = "omc3" __description__ = "An accelerator physics tools package for the OMC team at CERN." __url__ = "https://github.com/pylhc/omc3" -__version__ = "0.15.1" +__version__ = "0.15.2" __author__ = "pylhc" __author_email__ = "pylhc@github.com" __license__ = "MIT" From 4762dff59b6f2bbf51fea00abd71dc4de06ab85a Mon Sep 17 00:00:00 2001 From: JoschD <26184899+JoschD@users.noreply.github.com> Date: Mon, 19 Aug 2024 14:50:05 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 572c5863..4013d9c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # OMC3 Changelog +#### 2024-08-14 - v0.15.2 - _fesoubel_, _jdilly_ + +- Fixed: + - Numpy's `ComplexWarning` was not part of main namespace in v2.0, so we import it directly + #### 2024-08-14 - v0.15.1 - _fesoubel_ - Fixed: