From fca17e65d28c937593ed5d122b60d60e3811218d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=B6jdh?= Date: Tue, 17 Mar 2026 10:49:52 +0100 Subject: [PATCH 1/3] Added conda/pypi buyilds for python 3.14 removed 3.11 (#287) In line with supporting the 3 latest versions of Python --- RELEASE.md | 1 + conda-recipe/conda_build_config.yaml | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 72a2c72..b69d5ee 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -16,6 +16,7 @@ - Use ``read_roi/rois`` to read multiple ROIs for one frame, the index of a specific ROI to only read that ROI - Use ``read_n_with_roi`` to read multiple frames for a specific ROI. - Note ``read_frame`` and ``read_n`` is not supported for multiple ROI's. +- Building conda/pypi pkgs for python 3.14. Removing 3.11 builds. ### Bugfixes: diff --git a/conda-recipe/conda_build_config.yaml b/conda-recipe/conda_build_config.yaml index 543bf00..42408d6 100644 --- a/conda-recipe/conda_build_config.yaml +++ b/conda-recipe/conda_build_config.yaml @@ -1,7 +1,7 @@ python: - - 3.11 - 3.12 - 3.13 + - 3.14 c_compiler: - gcc # [linux] diff --git a/pyproject.toml b/pyproject.toml index 2bb3816..d156e90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ license = { file = "LICENSE" } [tool.cibuildwheel] -build = "cp{311,312,313}-manylinux_x86_64" +build = "cp{312,313,314}-manylinux_x86_64" From d9ff73e8b2a70fe475959f94c1668a48633aedc6 Mon Sep 17 00:00:00 2001 From: AliceMazzoleni99 Date: Tue, 17 Mar 2026 16:54:06 +0100 Subject: [PATCH 2/3] added matterhorn transformation tests (#284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - added matterhorn transformation tests --------- Co-authored-by: Erik Fröjdh --- python/tests/test_Transformation.py | 58 +++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 python/tests/test_Transformation.py diff --git a/python/tests/test_Transformation.py b/python/tests/test_Transformation.py new file mode 100644 index 0000000..192083e --- /dev/null +++ b/python/tests/test_Transformation.py @@ -0,0 +1,58 @@ +import pytest +import numpy as np +from aare import CtbRawFile, transform + +@pytest.mark.withdata +def test_matterhorn10_16bit(test_data_path): + """Matterhorn10Transform 1 counter 16 bit dynamic range""" + with CtbRawFile(test_data_path / "raw/Matterhorn10/16bit_master_0.json", transform = transform.Matterhorn10Transform(dynamic_range=16, num_counters=1)) as f: + headers, frames = f.read_frame() + + assert frames.shape == (256, 256) + assert frames.dtype == np.uint16 + + expected_data = np.tile(np.arange(255, -1, -1,dtype=np.uint16), (256, 1)) # TODO: endianess issue ? + + assert np.all(frames == expected_data) + + +@pytest.mark.withdata +def test_matterhorn10_8bit(test_data_path): + """Matterhorn10Transform 1 counter 8 bit dynamic range""" + with CtbRawFile(test_data_path / "raw/Matterhorn10/8bit_master_1.json", transform = transform.Matterhorn10Transform(dynamic_range=8, num_counters=1)) as f: + headers, frames = f.read_frame() + + assert frames.shape == (256, 256) + assert frames.dtype == np.uint8 + + expected_data = np.tile(np.arange(255, -1, -1,dtype=np.uint8), (256, 1)) # TODO: endianess issue ? + + assert np.all(frames == expected_data) + + +@pytest.mark.withdata +def test_matterhorn10_4bit(test_data_path): + """ Matterhorn10Transform 1 counter 4 bit dynamic range """ + with CtbRawFile(test_data_path / "raw/Matterhorn10/newnewrun_4bit_1counter_master_0.json", transform = transform.Matterhorn10Transform(dynamic_range=4, num_counters=1)) as f: + headers, frames = f.read_frame() + + assert frames.shape == (256, 256) + assert frames.dtype == np.uint8 + + expected_data = np.tile(np.tile(np.arange(15, -1, -1, dtype=np.uint8), 16), (256, 1)) # TODO: endianess issue ? + + assert np.all(frames == expected_data) + +@pytest.mark.withdata +def test_matterhorn10_16bit_4counters(test_data_path): + """Matterhorn10Transform 4 counters 16 bit dynamic range""" + + with CtbRawFile(test_data_path / "raw/Matterhorn10/4counter_16bit_master_4.json", transform = transform.Matterhorn10Transform(dynamic_range=16, num_counters=4)) as f: + headers, frames = f.read_frame() + + assert frames.shape == (4*256, 256) + assert frames.dtype == np.uint16 + + expected_data = np.tile(np.arange(255, -1, -1,dtype=np.uint16), (4*256, 1)) # TODO: endianess issue ? + + assert np.all(frames == expected_data) From 81acab6091192effaaad86d725bc78c8fb858ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=B6jdh?= Date: Tue, 17 Mar 2026 17:22:36 +0100 Subject: [PATCH 3/3] bumped version number edited RELEASE.md (#288) Co-authored-by: Alice --- RELEASE.md | 20 +++++++++++--------- VERSION | 2 +- python/aare/__init__.py | 1 + python/aare/transform.py | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index b69d5ee..8762827 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,20 +1,22 @@ # Release notes -## head +## 2026.3.17 ### New Features: -- Expanding 24 to 32 bit data -- Decoding digital data from Mythen 302 -- added ``transform_eta_values``. Function transforms :math:`\eta` to uniform spatial coordinates. Should only be used for easier debugging. -- New to_string, string_to for aare +- Decoding transceiver data from Matterhorn10 ``transformed_data = aare.transform.Matterhorn10Transform(num_counters=2, dynamic_range=16)(data)`` +- Expanding 24 to 32 bit data ``aare._aare.expand24to32bit(data, offset=4)`` +- Decoding digital data from Mythen 302 ``transformed_data = aare.transform.Mythen302Transform(offset=4)(data)`` +- added ``aare.Interpolator.transform_eta_values``. Function transforms $`\eta`$-values to uniform spatial coordinates. Should only be used for easier debugging. +- New ``to_string``, ``string_to`` - Added exptime and period members to RawMasterFile including decoding -- Removed redundant arr.value(ix,iy...) on NDArray use arr(ix,iy...) -- Removed Print/Print_some/Print_all form NDArray (operator << still works) +- Removed redundant ``arr.value(ix,iy...)`` on NDArray use ``arr(ix,iy...)`` +- Removed Print/Print_some/Print_all form NDArray (operator ``<<`` still works) - Added const* version of .data() - reading multiple ROI's supported for aare. - - Use ``read_roi/rois`` to read multiple ROIs for one frame, the index of a specific ROI to only read that ROI - - Use ``read_n_with_roi`` to read multiple frames for a specific ROI. + - Use ``aare.RawFile.read_roi(roi_index=0)`` to read a specific ROI for the current frame + - Use ``aare.RawFile.read_rois()`` to read multiple ROIs for the current frame + - Use ``aare.RawFile.read_n_with_roi(num_frames = 2, roi_index = 0)`` to read multiple frames for a specific ROI. - Note ``read_frame`` and ``read_n`` is not supported for multiple ROI's. - Building conda/pypi pkgs for python 3.14. Removing 3.11 builds. diff --git a/VERSION b/VERSION index 1e01f05..a00b244 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2025.11.21 \ No newline at end of file +2026.3.17 \ No newline at end of file diff --git a/python/aare/__init__.py b/python/aare/__init__.py index ab3cd76..92d88db 100644 --- a/python/aare/__init__.py +++ b/python/aare/__init__.py @@ -2,6 +2,7 @@ # Make the compiled classes that live in _aare available from aare. from . import _aare +from . import transform from ._aare import File, RawMasterFile, RawSubFile, JungfrauDataFile from ._aare import Pedestal_d, Pedestal_f, ClusterFinder_Cluster3x3i, VarClusterFinder diff --git a/python/aare/transform.py b/python/aare/transform.py index e082bed..50435d0 100644 --- a/python/aare/transform.py +++ b/python/aare/transform.py @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MPL-2.0 import numpy as np from . import _aare -from aare import ReadoutMode +from aare._aare import ReadoutMode from aare._aare import Matterhorn10 class AdcSar04Transform64to16: