From 97ddf6e7c19211c2560bca27742deb1aea4c273b Mon Sep 17 00:00:00 2001 From: AliceMazzoleni99 Date: Thu, 17 Sep 2026 09:27:05 +0200 Subject: [PATCH] error when compiling with warnings (#376) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - error upon warning when building documentation (warnings often indicate malrendered documentation) - fixed some warnings Co-authored-by: Erik Fröjdh --- docs/CMakeLists.txt | 2 +- docs/src/python/file/pyClusterFile.rst | 2 +- python/aare/calibration.py | 9 ++++++--- python/src/bind_calibration.hpp | 19 ++++++++++++++++++- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index df589419..d83b6f29 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -36,7 +36,7 @@ add_custom_target( docs COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} COMMAND - ${SPHINX_EXECUTABLE} -a -b html + ${SPHINX_EXECUTABLE} -W -a -b html -Dbreathe_projects.aare=${CMAKE_CURRENT_BINARY_DIR}/xml -c "${SPHINX_BUILD}" ${SPHINX_BUILD}/src ${SPHINX_BUILD}/html COMMENT "Generating documentation with Sphinx") diff --git a/docs/src/python/file/pyClusterFile.rst b/docs/src/python/file/pyClusterFile.rst index d6f3c8b9..b406cab3 100644 --- a/docs/src/python/file/pyClusterFile.rst +++ b/docs/src/python/file/pyClusterFile.rst @@ -3,7 +3,7 @@ ClusterFile =========== The :func:`ClusterFile` factory is the main interface for reading and writing - cluster files. Use ``mode="r"`` to read, ``mode="w"`` to truncate and +cluster files. Use ``mode="r"`` to read, ``mode="w"`` to truncate and write, or ``mode="a"`` to append. The format does not store the cluster dimensions, value type, coordinate type, diff --git a/python/aare/calibration.py b/python/aare/calibration.py index b7a23e74..20f8c77b 100644 --- a/python/aare/calibration.py +++ b/python/aare/calibration.py @@ -5,9 +5,12 @@ def load_calibration(fname, hg0=False): """ Load calibration data from a file. - Parameters: - fname (str): Path to the calibration file. - hg0 (bool): If True, load HG0 calibration data instead of G0. + Parameters + ---------- + fname : str + Path to the calibration file. + hg0 : bool + If True, load HG0 calibration data instead of G0. """ gains = 3 diff --git a/python/src/bind_calibration.hpp b/python/src/bind_calibration.hpp index a4a3f160..c9479e8a 100644 --- a/python/src/bind_calibration.hpp +++ b/python/src/bind_calibration.hpp @@ -73,10 +73,27 @@ py::array_t pybind_calculate_pedestal_g0( } void bind_calibration(py::module &m) { + py::options options; + options.disable_function_signatures(); + m.def("apply_calibration", &pybind_apply_calibration, py::arg("raw_data").noconvert(), py::kw_only(), py::arg("pd").noconvert(), py::arg("cal").noconvert(), - py::arg("n_threads") = 4); + py::arg("n_threads") = 4, + R"( + Apply the calibration to the raw data and return the result as a 3D array of doubles. + + Parameters + ---------- + raw_data : array_like + 3D array of shape ``(frames, rows, cols)``. + pd : array_like + Pedestal array. + cal : array_like + Calibration array. + n_threads : int, optional + Number of threads to use. Defaults to 4. + )"); m.def("apply_calibration", &pybind_apply_calibration, py::arg("raw_data").noconvert(), py::kw_only(),