From 48e66877fad33cafba7f0dbdd4fee152c82c7cdf Mon Sep 17 00:00:00 2001 From: Wolf Byttner Date: Fri, 5 Apr 2024 20:46:19 +0100 Subject: [PATCH] Bump Numpy version and fix complex type --- .github/workflows/tests.yaml | 8 ++++++-- .gitignore | 1 + requirements.txt | 20 ++++++++++---------- requirements/docs.txt | 30 +++++++++++++++--------------- requirements/extra.txt | 19 ++++++------------- traja/tests/test_trajectory.py | 2 +- traja/trajectory.py | 2 +- 7 files changed, 40 insertions(+), 42 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 046c4ec3..9e15a6c0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -14,15 +14,18 @@ jobs: strategy: matrix: os: ["ubuntu-latest", "windows-latest"] + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] steps: - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 + - name: Set up Miniconda ${{ matrix.python-version }} + uses: conda-incubator/setup-miniconda@v2 with: activate-environment: test channels: conda-forge,defaults environment-file: environment.yml - python-version: 3.8 + python-version: ${{ matrix.python-version }} auto-activate-base: false + cache-dependencies: true - shell: bash -l {0} run: | conda info @@ -44,6 +47,7 @@ jobs: conda install pytest py.test . --cov-report=xml --cov=traja -vvv - name: Upload coverage to Codecov + if: ${{ matrix.python-version }} == '3.8' uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index c3f65827..679af2c0 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,4 @@ docs/source/reference # Model parameter files *.pt +.python-version diff --git a/requirements.txt b/requirements.txt index 263feb79..7a3de661 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ pandas>=1.2.0 -numpy==1.18.5 -matplotlib -shapely -scipy>=1.4.1 -fastdtw -networkx -seaborn -torch -statsmodels -scikit-learn \ No newline at end of file +numpy>=1.22.0 +matplotlib>=3.3.3 +shapely>=1.7.1 +scipy>=1.2.1 +fastdtw>=0.3.0 +networkx>=2.0 +seaborn>=0.11.0 +torch>=1.7.0 +statsmodels>=0.12.0 +scikit-learn>=0.24.0 \ No newline at end of file diff --git a/requirements/docs.txt b/requirements/docs.txt index 7a8b4307..2a2c5934 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,17 +1,17 @@ pandas>=1.2.0 numpy==1.18.5 -matplotlib -shapely -scipy -scikit-learn -sphinx -sphinx-gallery -sphinx_rtd_theme -fastdtw -networkx -seaborn -torch -pytest -pytest-cov -codecov -ipython +matplotlib>=3.3.3 +shapely>=1.7.1 +scipy>=1.2.1 +scikit-learn>=0.24.0 +sphinx>=3.4.3 +sphinx-gallery>=0.9.0 +sphinx_rtd_theme>=0.5.1 +fastdtw>=0.3.0 +networkx>=2.0 +seaborn>=0.11.0 +torch>=1.7.0 +pytest>=6.2.2 +pytest-cov>=2.11.1 +codecov>=2.1.11 +ipython>=7.20.0 diff --git a/requirements/extra.txt b/requirements/extra.txt index 9193415a..9c494ac1 100644 --- a/requirements/extra.txt +++ b/requirements/extra.txt @@ -1,16 +1,9 @@ # extended list of package dependencies to reach full functionality -pytest -h5py -ipython -pre-commit -shapely -scipy>=1.4.1 -scikit-learn -fastdtw -networkx -seaborn -torch -h5py -numba>=0.50.0 +pytest>=6.2.2 +h5py>=2.10.0 +ipython>=7.19.0 +pre-commit>=2.9.3 +h5py>=2.10.0 +numba>=0.50.1 pyDOE2>=1.3.0 \ No newline at end of file diff --git a/traja/tests/test_trajectory.py b/traja/tests/test_trajectory.py index 864889bd..b64800df 100644 --- a/traja/tests/test_trajectory.py +++ b/traja/tests/test_trajectory.py @@ -1,7 +1,7 @@ import numpy as np import numpy.testing as npt import pytest -from pandas.util.testing import assert_series_equal +from pandas.testing import assert_series_equal import traja diff --git a/traja/trajectory.py b/traja/trajectory.py index a28c2305..51f672e1 100644 --- a/traja/trajectory.py +++ b/traja/trajectory.py @@ -668,7 +668,7 @@ def generate( if random: # Accumulate angular errors - coords = np.zeros(n, dtype=np.complex) + coords = np.zeros(n, dtype=complex) angle = 0 for i in range(n - 1): angle += angular_errors[i]