From 463c823d1df39d62ab018e400f72b0b8baa9d9d0 Mon Sep 17 00:00:00 2001 From: Ethan Lew Date: Sun, 10 Mar 2024 20:41:30 -0700 Subject: [PATCH] allow weighted for more cases tmp: change setup python version to troubleshoot conda tmp: switch ubuntu image to 20.04 because of latest miniconda issues tmp: pin name and version in the gh actions tmp: pin more gh actions tmp: pin 2024 version tmp: change to ubuntu-latest, pin miniconda version tmp: fix indentation tmp: correct miniconda version name tmp: set miniconda version to latest tmp: remove conda path addition tmp: set mamba and python version tmp: reset to default conda solver tmp: redo environment for latest python tmp: play with the versions tmp: finish pinning environment, revert ci/cd tasks tmp: switch nbmake version, fix deep-koopman path --- .github/workflows/notebook.yml | 5 +- .github/workflows/python-package-conda.yml | 2 +- autokoopman/autokoopman.py | 3 +- environment.yml | 84 +++------------------- notebooks/deep-koopman.ipynb | 4 +- requirements.txt | 4 +- 6 files changed, 21 insertions(+), 81 deletions(-) diff --git a/.github/workflows/notebook.yml b/.github/workflows/notebook.yml index 81cecef..951eb7e 100644 --- a/.github/workflows/notebook.yml +++ b/.github/workflows/notebook.yml @@ -20,12 +20,11 @@ jobs: echo $CONDA/bin >> $GITHUB_PATH - name: Install dependencies run: | - conda env update --solver classic --file environment.yml --name base + conda env update --file environment.yml --name base - name: Test with pytest run: | pip install . conda install pytest - pip install nbmake==0.5 + pip install nbmake==1.5.3 pytest --nbmake "./notebooks/" - pytest diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index cfccc5e..fba4f49 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -20,7 +20,7 @@ jobs: echo $CONDA/bin >> $GITHUB_PATH - name: Install dependencies run: | - conda env update --solver classic --file environment.yml --name base + conda env update --file environment.yml --name base - name: Lint with flake8 run: | conda install flake8 diff --git a/autokoopman/autokoopman.py b/autokoopman/autokoopman.py index 6a9168c..f247f0f 100644 --- a/autokoopman/autokoopman.py +++ b/autokoopman/autokoopman.py @@ -449,14 +449,15 @@ def _sanitize_training_data( # convert the data to autokoopman trajectories if isinstance(training_data, TrajectoriesData): - assert scoring_weights is None, f"scoring weights must be None as interpolation is occuring" if not isinstance(training_data, UniformTimeTrajectoriesData): + assert scoring_weights is None, f"scoring weights must be None as interpolation is occuring" print( f"resampling trajectories as they need to be uniform time (sampling period {sampling_period})" ) training_data = training_data.interp_uniform_time(sampling_period) else: if not np.isclose(training_data.sampling_period, sampling_period): + assert scoring_weights is None, f"scoring weights must be None as interpolation is occuring" print( f"resampling trajectories because the sampling periods differ (original {training_data.sampling_period}, new {sampling_period})" ) diff --git a/environment.yml b/environment.yml index 688dcce..5282e13 100644 --- a/environment.yml +++ b/environment.yml @@ -3,77 +3,15 @@ channels: - conda-forge - defaults dependencies: - - blas=1.0 - - ca-certificates=2023.08.22 - - cffi=1.15.1 - - filelock=3.9.0 - - gmp=6.2.1 - - gmpy2=2.1.2 - - jinja2=3.1.2 - - libcxx=16.0.6 - - libffi=3.3 - - libopenblas=0.3.21 - - libprotobuf=3.20.3 - - libsqlite=3.43.2 - - libuv=1.44.2 - - libzlib=1.2.13 - - llvm-openmp=14.0.6 - - markupsafe=2.1.1 - - mpc=1.1.0 - - mpfr=4.0.2 - - ncurses=6.4 - - networkx=3.1 - - ninja=1.10.2 - - ninja-base=1.10.2 - - numpy-base=1.26.0 - - openssl=1.1.1w - - pip=23.3.1 - - pycparser=2.21 - - python=3.9.0 - - pytorch=2.0.1 - - readline=8.2 - - setuptools=68.2.2 - - sleef=3.5.1 - - sqlite=3.43.2 - - sympy=1.11.1 - - tk=8.6.13 - - typing-extensions=4.7.1 - - typing_extensions=4.7.1 - - tzdata=2023c - - wheel=0.41.2 - - xz=5.2.6 - - zlib=1.2.13 + - pysindy=1.3.0 + - pip=24.0 + - matplotlib>=3.3.4 + - sympy>=1.9 + - pandas>=1.1.5 + - pydata-sphinx-theme==0.7.2 + - conda-forge::scikit-learn - pip: - - attrs==22.2.0 - - cmake==3.25.2 - - contourpy==1.0.7 - - cycler==0.11.0 - - cython==0.29.33 - - decorator==5.1.1 - - derivative==0.5.3 - - exceptiongroup==1.1.0 - - fonttools==4.38.0 - - gpy==1.10.0 - - gpyopt==1.2.6 - - iniconfig==2.0.0 - - joblib==1.2.0 - - kiwisolver==1.4.4 - - matplotlib==3.6.3 - - mpmath==1.2.1 - - numpy==1.21.0 - - packaging==23.0 - - pandas==1.5.3 - - paramz==0.9.5 - - pillow==9.4.0 - - pluggy==1.0.0 - - pyparsing==3.0.9 - - pysindy==1.7.2 - - pytest==7.2.1 - - python-dateutil==2.8.2 - - pytz==2022.7.1 - - scikit-learn==1.0.2 - - scipy==1.10.0 - - six==1.16.0 - - threadpoolctl==3.1.0 - - tomli==2.0.1 - - tqdm==4.64.1 + - gpy==1.13.1 + - gpyopt==1.2.6 + - torch==2.2.1 + - sphinx_mdinclude==0.5.1 \ No newline at end of file diff --git a/notebooks/deep-koopman.ipynb b/notebooks/deep-koopman.ipynb index 9ac7cf3..2ce6f1f 100644 --- a/notebooks/deep-koopman.ipynb +++ b/notebooks/deep-koopman.ipynb @@ -96,6 +96,8 @@ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", + "import sys\n", + "sys.path.append(\"..\")\n", "# this is the convenience function\n", "from autokoopman import auto_koopman" ] @@ -248,7 +250,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" + "version": "3.9.0" } }, "nbformat": 4, diff --git a/requirements.txt b/requirements.txt index 7851b64..bc7f46d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,5 @@ pydata-sphinx-theme==0.7.2 sphinx_mdinclude==0.5.1 gpy==1.10.0 gpyopt==1.2.6 -torch==1.12.1 -pysindy==1.7.2 +torch==2.2.1 +scikit-learn==1.4.1.post1 \ No newline at end of file