diff --git a/.github/workflows/ci-mac.yml b/.github/workflows/ci-mac.yml index f599880b..c1467266 100644 --- a/.github/workflows/ci-mac.yml +++ b/.github/workflows/ci-mac.yml @@ -54,76 +54,6 @@ concurrency: #BUILD_TYPE: Release jobs: - macos: - name: CI ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - cxx_compiler: ["$(brew --prefix llvm@18)/bin/clang++"] - llvm: ["$(brew --prefix llvm@18)"] - boost: ["$(brew --prefix boost)"] - libomp: ["$(brew --prefix libomp)"] - os: ["macos-12"] - - # env does not work here because is resolved as string and not command - # env: - # CXX: ${{ matrix.cxx_compiler }} - - steps: - - - uses: actions/setup-python@v3 - with: - python-version: '3.12' - - - name: checkout main repository - uses: actions/checkout@v4 - with: - submodules: recursive - lfs: false - - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: super-ci-mac-2 # name for the cache - - # uninstall clang 15 - - run: brew uninstall llvm@15 - - - run: brew install coreutils llvm@18 - - - run: brew install libomp boost - - - run: pip install meson meson-python ninja pytest numpy - - # LDFLAGS="-L/opt/homebrew/opt/libomp/lib" CPPFLAGS="-I/opt/homebrew/opt/libomp/include" - - name: configure meson - run: | - BOOST_ROOT=${{ matrix.boost }} CXX=${{ matrix.llvm }}/bin/clang++ LDFLAGS="-L${{ matrix.llvm }}/lib/c++ -L${{ matrix.llvm }}/lib -L${{ matrix.boost }}/lib" CPPFLAGS="-I${{ matrix.llvm }}/include -I${{ matrix.boost }}/include" meson setup builddir/; meson configure builddir -Dpython.install_env=auto - - - name: compile project - run: meson compile -C builddir/ - - - name: test (cpp) - run: meson test -C builddir/ --print-errorlogs - - - name: install project - run: sudo meson install -C builddir/ - - - name: install pip requirements - run: pip install -r requirements.txt - - - name: test (pytest) - run: pytest -v - - - name: 'Upload error log' - uses: actions/upload-artifact@v4 - if: failure() - with: - name: ${{matrix.container}}_testlog - path: builddir/meson-logs/meson-log.txt - retention-days: 5 - macos_arm: name: CI ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -162,7 +92,6 @@ jobs: - run: pip install meson meson-python ninja pytest numpy - # LDFLAGS="-L/opt/homebrew/opt/libomp/lib" CPPFLAGS="-I/opt/homebrew/opt/libomp/include" - name: configure meson run: | meson setup builddir -Dpython.install_env=auto diff --git a/src/themachinethatgoesping/tools/.docstrings/helper.doc.hpp b/src/themachinethatgoesping/tools/.docstrings/helper.doc.hpp index 8fc357d4..f74c0f45 100644 --- a/src/themachinethatgoesping/tools/.docstrings/helper.doc.hpp +++ b/src/themachinethatgoesping/tools/.docstrings/helper.doc.hpp @@ -1,4 +1,4 @@ -//sourcehash: c10033c746c08995b3cc73b4e3a6ca5535af9fff92a9e4064818334037d0a889 +//sourcehash: 9e52974b63da8f3ce7627008f66e807c37ee88c968b30ff423515d475050c669 /* This file contains docstrings for use in the Python bindings. @@ -67,6 +67,8 @@ static const char *__doc_themachinethatgoesping_tools_helper_compare_containers static const char *__doc_themachinethatgoesping_tools_helper_float_equals = R"doc()doc"; +static const char *__doc_themachinethatgoesping_tools_helper_float_is_finite_and_not_zero = R"doc()doc"; + static const char *__doc_themachinethatgoesping_tools_helper_get_from_map_with_default = R"doc()doc"; static const char *__doc_themachinethatgoesping_tools_helper_int_as_string = R"doc()doc"; diff --git a/src/themachinethatgoesping/tools/helper.hpp b/src/themachinethatgoesping/tools/helper.hpp index 4248b36f..6d0f98e1 100644 --- a/src/themachinethatgoesping/tools/helper.hpp +++ b/src/themachinethatgoesping/tools/helper.hpp @@ -23,7 +23,7 @@ namespace themachinethatgoesping { namespace tools { namespace helper { -template +template inline t_out substract_set_zero_if_negative(t_in1 a, t_in2 b) { return a > b ? a - b : 0; @@ -228,12 +228,18 @@ inline bool compare_containers(const t_container1& c1, const t_container2& c2) } template -bool float_equals(t_float a, t_float b, t_float epsilon = 0.0001) +bool float_equals(t_float a, t_float b, t_float epsilon = t_float(0.0001)) { return std::abs(a - b) < epsilon || (std::isnan(a) && std::isnan(b)) || (std::isinf(a) && std::isinf(b)); } +template +bool float_is_finite_and_not_zero(t_float a, t_float epsilon = t_float(0.0001)) +{ + return std::isfinite(a) && std::abs(a) > epsilon; +} + } // namespace helper } // namespace tools } // namespace themachinethatgoesping diff --git a/subprojects/packagefiles/xtensor-python/include/meson.build b/subprojects/packagefiles/xtensor-python/include/meson.build index 2ddf22f1..a2e4bf79 100644 --- a/subprojects/packagefiles/xtensor-python/include/meson.build +++ b/subprojects/packagefiles/xtensor-python/include/meson.build @@ -4,7 +4,7 @@ # list and install headers headers = [ - 'pyarray.hpp', + 'pytensor.hpp', 'pyarray_backstrides.hpp', 'pycontainer.hpp', 'pynative_casters.hpp',