Erik Fröjdh 89b7a9ef20 Split the python bindings into parallel translation units
python/src/module.cpp was one translation unit instantiating every cluster
size and value type; it compiled for 38 s and was the critical path of the
whole build. The bindings now live in bind_io.cpp (files, geometry, pixel
maps, calibration, test probes), bind_hist.cpp, bind_pedestal.cpp,
bind_fit.cpp, bind_eta.cpp and one bind_cluster_NxN.cpp per cluster size,
with the entry points declared in bindings.hpp and called from module.cpp
in the same order as before. The DEFINE_CLUSTER_BINDINGS macros moved to
bind_cluster_common.hpp.

Headers that several units include needed small fixes: allocate_image_data
and define_corner_enum are inline, the file-reader entry point is not, and
np_helper.hpp, bind_Defs.hpp, bind_FastPedestal.hpp,
bind_PedestalTrackingPixelHistogram.hpp and bind_ClusterFileSink.hpp now
include what they use, in particular pybind11/stl/filesystem.h for the
std::filesystem::path arguments they bind (previously supplied by include
order in module.cpp).

The module's exported names, types and docstrings are identical (verified
by dumping all 1948 of them), both test suites pass, and a clean Release
build with tests drops from 68 s to 42 s; the longest unit now takes 13 s
and the remaining 19 s is pybind11's LTO link.
2026-10-06 21:50:33 +02:00
2026-06-15 11:36:03 +02:00
2026-10-06 14:49:25 +02:00
2026-09-24 09:09:37 +02:00
2026-09-24 09:09:37 +02:00
2026-10-06 21:28:48 +02:00
2026-09-24 09:09:37 +02:00
2026-10-06 14:49:25 +02:00
2026-09-24 09:09:37 +02:00
2026-10-06 14:49:25 +02:00
2026-09-24 09:09:37 +02:00
2024-11-11 19:59:55 +01:00
2025-03-20 12:52:04 +01:00
2025-11-20 09:01:28 +01:00
2026-10-06 14:49:25 +02:00
2026-09-24 09:09:37 +02:00
2026-09-24 09:09:37 +02:00
2026-09-30 16:55:00 +02:00

aare

Data analysis library for PSI hybrid detectors

Documentation

Detailed documentation including installation can be found in Documentation

License

This project is licensed under the MPL-2.0 license. See the LICENSE file or https://www.mozilla.org/en-US/MPL/ for details.

Two files contain code from other projects and keep their original licenses:

  • include/aare/ProducerConsumerQueue.hpp is Apache-2.0, from folly by Meta Platforms.
  • src/NumpyHelpers.cpp is MIT, from libnpy by Leon Merten Lohse.

The full license texts are in the LICENSES directory.

The Python wheels and conda packages also contain Minuit2 (LGPL-2.1-or-later), {fmt} and nlohmann/json (MIT), and pybind11 (BSD-3-Clause), which CMake downloads at build time. See THIRD-PARTY-NOTICES.txt for their notices.

Build and install

Prerequisites

  • cmake >= 3.14
  • C++17 compiler (gcc >= 8)
  • python >= 3.10

Development install (for Python)

git clone git@github.com:slsdetectorgroup/aare.git --branch=v1 #or using http...
mkdir build
cd build

#configure using cmake
cmake ../aare -DAARE_PYTHON_BINDINGS=ON 

#build (replace 4 with the number of threads you want to use)
make -j4 

Now you can use the Python module from your build directory

import aare
f = aare.File('Some/File/I/Want_to_open_master_0.json')

To run from other folders either add the path to your conda environment using conda-build or add the module to your PYTHONPATH

export PYTHONPATH=path_to_aare/aare/build:$PYTHONPATH

Install using conda/mamba

#enable your env first!
conda install aare -c slsdetectorgroup # installs latest version

Install to a custom location and use in your project

Working example in: https://github.com/slsdetectorgroup/aare-examples

#build and install aare 
git clone git@github.com:slsdetectorgroup/aare.git --branch=v1 #or using http...
mkdir build
cd build

#configure using cmake
cmake ../aare -DCMAKE_INSTALL_PREFIX=/where/to/put/aare

#build (replace 4 with the number of threads you want to use)
make -j4 

#install
make install


#Now configure your project
 cmake .. -DCMAKE_PREFIX_PATH=SOME_PATH

Local build of conda pkgs

conda build . --variants="{python: [3.11, 3.12, 3.13]}"

Developer's guide

We are looking forward to your contributions via pull requests!

If you want to fix an existing bug or propose a new feature:

  1. Install pre-commit python package and setup it pre-commit install
  2. Create a new branch with git branch branch_name
  3. Implement your changes and make a commit (pre-commit will check your code automatically)
  4. Push your commit and open a pull request if needed
Languages
Jupyter Notebook 60.1%
C++ 34.8%
Python 4.3%
CMake 0.8%