From f09dfde157786bfeff4b16387f31024f5522aed1 Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Thu, 21 May 2026 10:21:24 +0200 Subject: [PATCH 1/5] docstring --- slsDetectorSoftware/src/CallerSpecial.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/slsDetectorSoftware/src/CallerSpecial.cpp b/slsDetectorSoftware/src/CallerSpecial.cpp index dc2ae8c6c..ac75fab4c 100644 --- a/slsDetectorSoftware/src/CallerSpecial.cpp +++ b/slsDetectorSoftware/src/CallerSpecial.cpp @@ -1000,7 +1000,8 @@ std::string Caller::counters(int action) { std::ostringstream os; if (action == defs::HELP_ACTION) { os << "[i0] [i1] [i2]... \n\t[Mythen3] List of counters indices " - "enabled. Each element in list can be 0 - 2 and must be non " + "enabled, support both comma and/or space separation. Each " + "element in list can be 0 - 2 and must be non " "repetitive. Enabling counters sets vth dacs to remembered " "values and disabling sets them to disabled values." << '\n'; @@ -1198,7 +1199,8 @@ std::string Caller::rx_dbitlist(int action) { if (action == defs::HELP_ACTION) { os << "[all] or [none] or [i0] [i1] [i2]... \n\t[Ctb] List of digital " "signal bits enabled and rearranged according to the signals " - "(all samples of each signal is put together). If 'all' is used " + "(all samples of each signal is put together). Support both " + "comma and/or space separation. If 'all' is used " "instead of a list, all digital bits (64) enabled. Each element " "in list can be 0 - 63 and must be non repetitive. The option " "'none' will still spit out all data as is from the detector, " From 1e725bac992c004d5b602d21b0735ada87186650 Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Thu, 21 May 2026 10:24:10 +0200 Subject: [PATCH 2/5] Revert "docstring" This reverts commit f09dfde157786bfeff4b16387f31024f5522aed1. --- slsDetectorSoftware/src/CallerSpecial.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/slsDetectorSoftware/src/CallerSpecial.cpp b/slsDetectorSoftware/src/CallerSpecial.cpp index ac75fab4c..dc2ae8c6c 100644 --- a/slsDetectorSoftware/src/CallerSpecial.cpp +++ b/slsDetectorSoftware/src/CallerSpecial.cpp @@ -1000,8 +1000,7 @@ std::string Caller::counters(int action) { std::ostringstream os; if (action == defs::HELP_ACTION) { os << "[i0] [i1] [i2]... \n\t[Mythen3] List of counters indices " - "enabled, support both comma and/or space separation. Each " - "element in list can be 0 - 2 and must be non " + "enabled. Each element in list can be 0 - 2 and must be non " "repetitive. Enabling counters sets vth dacs to remembered " "values and disabling sets them to disabled values." << '\n'; @@ -1199,8 +1198,7 @@ std::string Caller::rx_dbitlist(int action) { if (action == defs::HELP_ACTION) { os << "[all] or [none] or [i0] [i1] [i2]... \n\t[Ctb] List of digital " "signal bits enabled and rearranged according to the signals " - "(all samples of each signal is put together). Support both " - "comma and/or space separation. If 'all' is used " + "(all samples of each signal is put together). If 'all' is used " "instead of a list, all digital bits (64) enabled. Each element " "in list can be 0 - 63 and must be non repetitive. The option " "'none' will still spit out all data as is from the detector, " From 7db29d55a7579d136a9cb3a93ca3dc953be14635 Mon Sep 17 00:00:00 2001 From: Leonid Lunin Date: Thu, 21 May 2026 15:56:23 +0200 Subject: [PATCH 3/5] CI: Use conda-build instead conda build (#1464) * repalce conda build with conda-build, bump actions versions * updated github actions versions to run on node 24 --------- Co-authored-by: Alice --- .github/workflows/build_documentation.yml | 6 +++--- .github/workflows/build_wheel.yml | 10 +++++----- .github/workflows/cmake.yaml | 4 ++-- .github/workflows/conda_deploy_library.yaml | 8 ++++---- .github/workflows/conda_deploy_slsdet.yaml | 8 ++++---- .github/workflows/conda_library.yaml | 8 ++++---- .github/workflows/conda_python.yaml | 8 ++++---- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml index be3dc4a62..ebbce9606 100644 --- a/.github/workflows/build_documentation.yml +++ b/.github/workflows/build_documentation.yml @@ -35,7 +35,7 @@ jobs: shell: "bash -l {0}" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 # Fetch all history for proper git operations token: ${{ secrets.GITHUB_TOKEN }} # Use the default token @@ -58,7 +58,7 @@ jobs: version: 1.0 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.12 cache: 'pip' @@ -84,7 +84,7 @@ jobs: --date "$(date +'%d.%m.%Y')" - name: Checkout gh-pages - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: ref: gh-pages path: gh-pages diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index 05e4dc66c..9e1d2df20 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -20,12 +20,12 @@ jobs: os: [ubuntu-latest,] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Build wheels run: pipx run cibuildwheel==3.2.1 - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl @@ -34,12 +34,12 @@ jobs: name: Build source distribution runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Build sdist run: pipx run build --sdist - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: cibw-sdist path: dist/*.tar.gz @@ -54,7 +54,7 @@ jobs: # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this) # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v7 with: # unpacks all CIBW artifacts into dist/ pattern: cibw-* diff --git a/.github/workflows/cmake.yaml b/.github/workflows/cmake.yaml index 773700f1c..1c4d7b0f6 100644 --- a/.github/workflows/cmake.yaml +++ b/.github/workflows/cmake.yaml @@ -14,8 +14,8 @@ jobs: runs-on: ubuntu-latest name: Configure and build using cmake steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: 3.12 cache: 'pip' diff --git a/.github/workflows/conda_deploy_library.yaml b/.github/workflows/conda_deploy_library.yaml index 6b5fb996e..68d046aff 100644 --- a/.github/workflows/conda_deploy_library.yaml +++ b/.github/workflows/conda_deploy_library.yaml @@ -21,10 +21,10 @@ jobs: shell: "bash -l {0}" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Get conda - uses: conda-incubator/setup-miniconda@v3.0.4 + uses: conda-incubator/setup-miniconda@v4 with: python-version: ${{ matrix.python-version }} channels: conda-forge @@ -38,10 +38,10 @@ jobs: - name: Build env: CONDA_TOKEN: ${{ secrets.CONDA_TOKEN }} - run: conda build conda-recipes/main-library --user slsdetectorgroup --token ${CONDA_TOKEN} --output-folder build_output + run: conda-build conda-recipes/main-library --user slsdetectorgroup --token ${CONDA_TOKEN} --output-folder build_output - name: Upload all Conda to github as artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: conda-packages path: build_output/** # Uploads all packages \ No newline at end of file diff --git a/.github/workflows/conda_deploy_slsdet.yaml b/.github/workflows/conda_deploy_slsdet.yaml index d25bffa74..4207132bf 100644 --- a/.github/workflows/conda_deploy_slsdet.yaml +++ b/.github/workflows/conda_deploy_slsdet.yaml @@ -21,10 +21,10 @@ jobs: shell: "bash -l {0}" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Get conda - uses: conda-incubator/setup-miniconda@v3.0.4 + uses: conda-incubator/setup-miniconda@v4 with: python-version: ${{ matrix.python-version }} channels: conda-forge @@ -38,10 +38,10 @@ jobs: - name: Build env: CONDA_TOKEN: ${{ secrets.CONDA_TOKEN }} - run: conda build conda-recipes/python-client --user slsdetectorgroup --token ${CONDA_TOKEN} --output-folder build_output + run: conda-build conda-recipes/python-client --user slsdetectorgroup --token ${CONDA_TOKEN} --output-folder build_output - name: Upload all Conda packages - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: conda-packages path: build_output/** # Uploads all packages \ No newline at end of file diff --git a/.github/workflows/conda_library.yaml b/.github/workflows/conda_library.yaml index 23f94d467..1086021c7 100644 --- a/.github/workflows/conda_library.yaml +++ b/.github/workflows/conda_library.yaml @@ -18,10 +18,10 @@ jobs: shell: "bash -l {0}" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Get conda - uses: conda-incubator/setup-miniconda@v3.0.4 + uses: conda-incubator/setup-miniconda@v4 with: python-version: ${{ matrix.python-version }} channels: conda-forge @@ -33,10 +33,10 @@ jobs: run: conda config --set anaconda_upload no - name: Build - run: conda build conda-recipes/main-library --output-folder build_output + run: conda-build conda-recipes/main-library --output-folder build_output - name: Upload all Conda packages - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: conda-packages path: build_output/** # Uploads all packages \ No newline at end of file diff --git a/.github/workflows/conda_python.yaml b/.github/workflows/conda_python.yaml index 4b12cb3ff..86c8b3907 100644 --- a/.github/workflows/conda_python.yaml +++ b/.github/workflows/conda_python.yaml @@ -18,10 +18,10 @@ jobs: shell: "bash -l {0}" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Get conda - uses: conda-incubator/setup-miniconda@v3.0.4 + uses: conda-incubator/setup-miniconda@v4 with: python-version: ${{ matrix.python-version }} channels: conda-forge @@ -33,10 +33,10 @@ jobs: run: conda config --set anaconda_upload no - name: Build - run: conda build conda-recipes/python-client --output-folder build_output + run: conda-build conda-recipes/python-client --output-folder build_output - name: Upload all Conda packages - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: conda-packages path: build_output/** # Uploads all packages \ No newline at end of file From 53d966d23b98de5986e05c63b1764a09ed6bd0a2 Mon Sep 17 00:00:00 2001 From: AliceMazzoleni99 Date: Wed, 27 May 2026 09:58:30 +0200 Subject: [PATCH 4/5] Fix/fmt install (#1468) * fmt_install for local libs code * fix: small python warning about escaped character \* in docstring * copy with -r in copy_lib.sh due to cmake directory --- CMakeLists.txt | 13 +------------ conda-recipes/main-library/copy_lib.sh | 2 +- python/slsdet/detector.py | 17 +++++++++++------ 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb5d5df0f..8830eb86e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -209,22 +209,11 @@ else() URL ${CMAKE_CURRENT_SOURCE_DIR}/libs/fmt/fmt-12.1.0.tar.gz # Compute hash: md5sum fmt-12.1.0.tar.gz URL_HASH MD5=92eb6f492e4838e5f024ce5207beafc7) + set(FMT_INSTALL ON CACHE BOOL "") FetchContent_MakeAvailable(fmt) set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON) endif() -# Export fmt -if(SLS_MASTER_PROJECT) - install(TARGETS fmt - EXPORT ${TARGETS_EXPORT_NAME} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - ) -endif() - - option(SLS_USE_HDF5 "HDF5 File format" OFF) option(SLS_BUILD_SHARED_LIBRARIES "Build shared libaries" OFF) option(SLS_USE_TEXTCLIENT "Text Client" ON) diff --git a/conda-recipes/main-library/copy_lib.sh b/conda-recipes/main-library/copy_lib.sh index 88beafdfe..8ca79f9ee 100755 --- a/conda-recipes/main-library/copy_lib.sh +++ b/conda-recipes/main-library/copy_lib.sh @@ -6,7 +6,7 @@ mkdir -p $PREFIX/bin mkdir -p $PREFIX/include/sls #Shared and static libraries -cp build/install/lib/* $PREFIX/lib/ +cp -r build/install/lib/* $PREFIX/lib/ #Binaries cp build/install/bin/sls_detector_acquire $PREFIX/bin/. diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 47ad9220d..a984fedd5 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -827,16 +827,21 @@ class Detector(CppDetectorApi): @property @element def txdelay(self): - """ + r""" [Eiger][Jungfrau][Moench][Mythen3] Set transmission delay for all modules in the detector using the step size provided. Note ---- - Sets up the following for every module:\n - \t\t[Eiger] txdelay_left to (2 \* mod_index \* n_delay), \n - \t\t[Eiger] txdelay_right to ((2 \* mod_index + 1) \* n_delay) and \n - \t\t[Eiger] txdelay_frame to (2 \* num_modules \* n_delay) \n - \t\t[Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules \* n_delay)\n\n + Sets up the following for every module: + + [Eiger] txdelay_left to (2 \* mod_index \* n_delay), + + [Eiger] txdelay_right to ((2 \* mod_index + 1) \* n_delay) and + + [Eiger] txdelay_frame to (2 \* num_modules \* n_delay) + + [Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules \* n_delay) + Please refer txdelay_left, txdelay_right and txdelay_frame for details. """ return self.getTransmissionDelay() From 4c02ce65ccc221ae6a36112c11abfc1364eaf7f7 Mon Sep 17 00:00:00 2001 From: AliceMazzoleni99 Date: Wed, 27 May 2026 10:36:16 +0200 Subject: [PATCH 5/5] generated python enums, moved ReturnCode to slsDetectorDefs class (#1467) --- python/src/enums.cpp | 12 ++++++++++++ .../slsDetectorServer_cpp/include/DetectorServer.h | 2 ++ .../slsDetectorServer_cpp/include/TCPInterface.h | 11 ++++++----- .../slsDetectorServer_cpp/src/TCPInterface.cpp | 14 ++++++++------ slsSupportLib/include/sls/sls_detector_defs.h | 6 +----- 5 files changed, 29 insertions(+), 16 deletions(-) diff --git a/python/src/enums.cpp b/python/src/enums.cpp index f00b8105a..d391fe0f2 100644 --- a/python/src/enums.cpp +++ b/python/src/enums.cpp @@ -27,6 +27,12 @@ void init_enums(py::module &m) { .value("GOTTHARD2", slsDetectorDefs::detectorType::GOTTHARD2) .value("XILINX_CHIPTESTBOARD", slsDetectorDefs::detectorType::XILINX_CHIPTESTBOARD) + .value("MATTERHORN", slsDetectorDefs::detectorType::MATTERHORN) + .export_values(); + + py::enum_(Defs, "ReturnCode") + .value("OK", slsDetectorDefs::ReturnCode::OK) + .value("FAIL", slsDetectorDefs::ReturnCode::FAIL) .export_values(); py::enum_(Defs, "boolFormat") @@ -50,6 +56,12 @@ void init_enums(py::module &m) { .value("Y", slsDetectorDefs::dimension::Y) .export_values(); + py::enum_(Defs, "FrequencyUnit") + .value("Hz", slsDetectorDefs::FrequencyUnit::Hz) + .value("kHz", slsDetectorDefs::FrequencyUnit::kHz) + .value("MHz", slsDetectorDefs::FrequencyUnit::MHz) + .export_values(); + py::enum_(Defs, "frameDiscardPolicy") .value("NO_DISCARD", slsDetectorDefs::frameDiscardPolicy::NO_DISCARD) .value("DISCARD_EMPTY_FRAMES", diff --git a/slsDetectorServers/slsDetectorServer_cpp/include/DetectorServer.h b/slsDetectorServers/slsDetectorServer_cpp/include/DetectorServer.h index 7f1a6eb89..6773f17ba 100644 --- a/slsDetectorServers/slsDetectorServer_cpp/include/DetectorServer.h +++ b/slsDetectorServers/slsDetectorServer_cpp/include/DetectorServer.h @@ -25,6 +25,8 @@ struct UDPInfo { uint32_t dstip{}; }; +using ReturnCode = slsDetectorDefs::ReturnCode; + template class DetectorServer { public: diff --git a/slsDetectorServers/slsDetectorServer_cpp/include/TCPInterface.h b/slsDetectorServers/slsDetectorServer_cpp/include/TCPInterface.h index 9538a3e42..6d3ea2c29 100644 --- a/slsDetectorServers/slsDetectorServer_cpp/include/TCPInterface.h +++ b/slsDetectorServers/slsDetectorServer_cpp/include/TCPInterface.h @@ -19,8 +19,8 @@ class TCPInterface { public: ~TCPInterface(); - TCPInterface(std::function - &processFunction_, + TCPInterface(std::function &processFunction_, const uint16_t portNumber = DEFAULT_TCP_CNTRL_PORTNO); /// @brief creates tcp thread @@ -40,11 +40,12 @@ class TCPInterface { * @param function_id The ID of the function recived by the server and to * be executed */ - ReturnCode processReceivedData(const detFuncs function_id, - ServerInterface &socket); + slsDetectorDefs::ReturnCode processReceivedData(const detFuncs function_id, + ServerInterface &socket); /// @brief map of function IDs and corresponding functions - std::function + std::function processFunction; /// @brief TCP/IP port number for the detector server diff --git a/slsDetectorServers/slsDetectorServer_cpp/src/TCPInterface.cpp b/slsDetectorServers/slsDetectorServer_cpp/src/TCPInterface.cpp index 9d2d7911e..ea54d2f5a 100644 --- a/slsDetectorServers/slsDetectorServer_cpp/src/TCPInterface.cpp +++ b/slsDetectorServers/slsDetectorServer_cpp/src/TCPInterface.cpp @@ -8,8 +8,8 @@ namespace sls { TCPInterface::TCPInterface( - std::function - &processFunction_, + std::function &processFunction_, const uint16_t portNumber_) : processFunction(processFunction_), portNumber(portNumber_), server(portNumber_) { @@ -53,7 +53,7 @@ void TCPInterface::startTCPServerClientConnection() { auto returncode = processReceivedData( static_cast(function_id), socket); - if (returncode == FAIL) { + if (returncode == slsDetectorDefs::ReturnCode::FAIL) { throw RuntimeError(fmt::format( "Error processing command with fnum: {}", getFunctionNameFromEnum((enum detFuncs)function_id))); @@ -76,14 +76,16 @@ void TCPInterface::startTCPServerClientConnection() { LOG(logINFOBLUE) << "Exiting TCP Server"; } -ReturnCode TCPInterface::processReceivedData(const detFuncs function_id, - ServerInterface &socket) { +slsDetectorDefs::ReturnCode +TCPInterface::processReceivedData(const detFuncs function_id, + ServerInterface &socket) { LOG(logDEBUG1) << "calling function fnum: " << function_id << " (" << getFunctionNameFromEnum((enum detFuncs)function_id) << ")"; - ReturnCode returncode = processFunction(function_id, socket); + slsDetectorDefs::ReturnCode returncode = + processFunction(function_id, socket); LOG(logDEBUG1) << "Function " << getFunctionNameFromEnum((enum detFuncs)function_id) diff --git a/slsSupportLib/include/sls/sls_detector_defs.h b/slsSupportLib/include/sls/sls_detector_defs.h index 283eb2f5e..9e996f891 100644 --- a/slsSupportLib/include/sls/sls_detector_defs.h +++ b/slsSupportLib/include/sls/sls_detector_defs.h @@ -89,9 +89,6 @@ // NOLINTEND(cppcoreguidelines-macro-usage) #ifdef __cplusplus -// TODO: why are all these defs inside a class? - why not static -enum ReturnCode { OK = 0, FAIL = 1 }; - class slsDetectorDefs { public: #endif @@ -111,8 +108,7 @@ class slsDetectorDefs { // slsDetectorDefs instead of grouped in a class }; - /** return values */ - enum { OK, FAIL }; + enum ReturnCode { OK, FAIL }; enum boolFormat { TrueFalse, OnOff, OneZero };