From 91cfde457c3af0ed297dfd6518027cedd3c29c2f Mon Sep 17 00:00:00 2001 From: Nico Date: Thu, 5 Dec 2024 18:20:47 +0100 Subject: [PATCH] make f2 output an array --- .github/workflows/build_osx.yml | 66 --------------------------------- qmctorch/utils/algebra_utils.py | 3 +- 2 files changed, 2 insertions(+), 67 deletions(-) delete mode 100644 .github/workflows/build_osx.yml diff --git a/.github/workflows/build_osx.yml b/.github/workflows/build_osx.yml deleted file mode 100644 index fa66a2d7..00000000 --- a/.github/workflows/build_osx.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: build_OSX - -on: [push] - -jobs: - build: - name: build and test on mac os - runs-on: macos-latest - - strategy: - fail-fast: false - matrix: - version: ['3.8', '3.10'] - include: - - os: macos-latest - CONDA_OS: osx-64 - - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.0 - with: - access_token: ${{ github.token }} - - uses: actions/checkout@v4 - - name: Setup conda - uses: conda-incubator/setup-miniconda@v3 - with: - miniconda-version: "latest" - auto-update-conda: true - python-version: ${{ matrix.version }} - conda-channels: anaconda - - - name: Install conda packages - run: | - conda install h5py -c conda-forge - conda install pytorch::pytorch -c pytorch - - - name: Install the package - run: python -m pip install .[test] - - - - name: Test with single thread - env: - CONDA_PREFIX: /usr/share/miniconda - run: coverage run -m pytest tests - - - name: Combine all coverage results - run: coverage combine - - - run: coverage report - - - name: Coveralls Parallel - run: coveralls --service=github - env: - GITHUB_TOKEN: ${{ secrets.github_token }} - COVERALLS_FLAG_NAME: python-${{ matrix.version }} - COVERALLS_PARALLEL: true - - finish: - needs: build - runs-on: ubuntu-latest - steps: - - name: Coveralls Finished - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.github_token }} - parallel-finished: true diff --git a/qmctorch/utils/algebra_utils.py b/qmctorch/utils/algebra_utils.py index 726c5e53..914d14c4 100644 --- a/qmctorch/utils/algebra_utils.py +++ b/qmctorch/utils/algebra_utils.py @@ -1,4 +1,5 @@ import torch +import numpy as np from scipy.special import factorial2 as f2 def btrace(M): @@ -53,7 +54,7 @@ def double_factorial(input): List: values of the double factorial """ output = f2(input) - return [1 if o==0 else o for o in output] + return np.array([1 if o==0 else o for o in output]) class BatchDeterminant(torch.autograd.Function):