Skip to content

Commit

Permalink
Merge pull request #153 from KVSlab/fixate-deps
Browse files Browse the repository at this point in the history
Fixate dependency versions
  • Loading branch information
hkjeldsberg authored Aug 27, 2024
2 parents c91d861 + 664f9ce commit 121c71e
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 27 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/check_and_test_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ on:
- cron: '0 8 * * *'

env:
CACHE_NUMBER: 11 # Increase to reset cache
CACHE_NUMBER: 12 # Increase to reset cache

jobs:
check-code:
name: Check code
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.8'
Expand Down Expand Up @@ -48,11 +48,13 @@ jobs:
defaults:
run: # https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.8'

- name: Setup and install with Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -63,19 +65,20 @@ jobs:
use-mamba: true
environment-file: environment-test.yml
id: mamba
- uses: actions/cache@v2

- uses: actions/cache@v3
with:
path: ${{ matrix.prefix }}
key: ${{ matrix.label }}-${{ github.run_id }}-${{ env.CACHE_NUMBER }}
restore-keys: ${{ matrix.label }}-
key: ${{ matrix.label }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment-test.yml') }}
restore-keys: ${{ matrix.label }}-${{ env.CACHE_NUMBER }}-

- run: mamba env update -n vampy -f environment-test.yml
if: steps.cache.outputs.cache-hit != 'true'

- name: Install VaMPy
run: python -m pip install .[test]
run: mamba run -n vampy python -m pip install '.[test]'

- name: Run tests
run: python -m pytest tests
run: mamba run -n vampy python -m pytest tests

- name: Upload coverage report to Codecov
if: matrix.os == 'ubuntu-latest'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
run: pip install -r requirements.txt

- name: Install VaMPy
run: python3 -m pip install .[test]
run: python3 -m pip install '.[test]'

# Build the book
- name: Build the book
Expand Down
11 changes: 5 additions & 6 deletions environment-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ channels:
dependencies:
- fenics
- morphman
- paramiko
- pip
- git
- python >=3.8
- expat==2.5 # Hotfix for https://gitlab.archlinux.org/archlinux/packaging/packages/paraview/-/issues/4
- pip==24.2
- pip:
- matplotlib
- scipy
- cppimport
- scipy==1.14.1
- numpy==1.24.4
- cppimport==22.8.2
- paramiko==3.4.1
- git+https://github.com/KVSlab/OasisMove
12 changes: 6 additions & 6 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ channels:
dependencies:
- fenics
- morphman
- paramiko
- pip
- git
- python >=3.8
- expat==2.5 # Hotfix for https://gitlab.archlinux.org/archlinux/packaging/packages/paraview/-/issues/4
- pip==24.2
- pip:
- scipy
- cppimport
- matplotlib
- scipy==1.14.1
- numpy==1.24.4
- cppimport==22.8.2
- paramiko==3.4.1
- git+https://github.com/mikaem/Oasis
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
jupyter-book
matplotlib
numpy
ghp-import
cppimport
scipy
sphinx==5.3.0
docutils==0.17.1
matplotlib==3.9.2
numpy==1.24.4
cppimport==3.4.1
scipy==1.14.1
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ def define_functions_and_iterate_dataset(time_to_average, dataset, dataset_avg,
print("=" * 10, "Starting post processing", "=" * 10)

counter = 0
tolerance = 1E-12
for data, data_avg in zip(dataset, dataset_avg):
counter += 1

Expand Down Expand Up @@ -402,14 +403,14 @@ def define_functions_and_iterate_dataset(time_to_average, dataset, dataset_avg,

# Compute length scale
t0 = Timer("Length scale")
length_scale.vector().set_local((nu ** 3 / eps) ** (1. / 4))
length_scale.vector().set_local((nu ** 3 / (eps + tolerance)) ** (1. / 4))
length_scale.vector().apply("insert")
length_scale_cycle_avg.vector().axpy(1, length_scale.vector())
t0.stop()

# Compute time scale
t0 = Timer("Time scale")
time_scale.vector().set_local((nu / eps) ** 0.5)
time_scale.vector().set_local((nu / (eps + tolerance)) ** 0.5)
time_scale.vector().apply("insert")
time_scale_cycle_avg.vector().axpy(1, time_scale.vector())
t0.stop()
Expand Down

0 comments on commit 121c71e

Please sign in to comment.