Skip to content

Commit

Permalink
Try to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jan 27, 2024
1 parent 3329e4a commit e849a01
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 26 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ jobs:
steps:

- name: apt install
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages:
make libfftw3-dev libfftw3-mpi-dev libhdf5-openmpi-dev openmpi-bin libopenmpi-dev libopenblas-dev
version: 1.0
execute_install_scripts: true
run: |
sudo apt make install -y libfftw3-dev libfftw3-mpi-dev \
libhdf5-openmpi-dev openmpi-bin libopenmpi-dev \
libopenblas-dev
- name: Checkout
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
pip install -e . -v --no-build-isolation --no-deps
- name: Tests
run: |
pytest -v
pytest -v tests
2 changes: 1 addition & 1 deletion .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
pip install -e . -v --no-build-isolation --no-deps
- name: Tests
run: |
pytest -v
pytest -v tests
5 changes: 2 additions & 3 deletions doc/ipynb/tuto_fft2d_seq.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ If you really want performance, first benchmark the different methods for an arr

```{code-cell} ipython3
import numpy as np
from fluidfft.fft2d import methods_seq
from fluidfft import import_fft_class
from fluidfft import get_methods, import_fft_class
```

```{code-cell} ipython3
print(methods_seq)
print(get_methods(ndim=2, sequential=True))
```

We import a class and instantiate it:
Expand Down
5 changes: 2 additions & 3 deletions doc/ipynb/tuto_fft3d_seq.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ In this tutorial, we present how to use fluidfft to perform 3D fft in sequential

```{code-cell} ipython3
import numpy as np
from fluidfft.fft3d import methods_seq
from fluidfft import import_fft_class
from fluidfft import get_methods, import_fft_class
```

```{code-cell} ipython3
print(methods_seq)
print(get_methods(ndim=3, sequential=True))
```

We import a class and instantiate it:
Expand Down
7 changes: 7 additions & 0 deletions src/fluidfft/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def byte_align(values, *args):
"empty_aligned",
"get_module_fullname_from_method",
"get_plugins",
"get_methods",
"import_fft_class",
]

Expand Down Expand Up @@ -126,6 +127,12 @@ def get_plugins(reload=False, ndim=None, sequential=None):
)


def get_methods(ndim=None, sequential=None):
"""Get available methods"""
plugins = get_plugins(ndim=ndim, sequential=sequential)
return set(plug.name for plug in plugins)


def get_module_fullname_from_method(method):
"""Get the module name from a method string
Expand Down
15 changes: 3 additions & 12 deletions tests/test_plugins.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from importlib_metadata import entry_points

from fluidfft import get_plugins
from fluidfft import get_plugins, get_methods


methodss = {
Expand Down Expand Up @@ -37,23 +36,15 @@
}


def _methods_from_plugins(plugins):
return set(plug.name for plug in plugins)


def _get_methods(ndim=None, sequential=None):
return _methods_from_plugins(get_plugins(ndim=ndim, sequential=sequential))


def test_plugins():
plugins = get_plugins()
assert plugins

for ndim in (2, 3):
assert _get_methods(ndim=ndim) == methodss[(ndim, True)].union(
assert get_methods(ndim=ndim) == methodss[(ndim, True)].union(
methodss[(ndim, False)]
)
for sequential in (True, False):
assert methodss[(ndim, sequential)] == _get_methods(
assert methodss[(ndim, sequential)] == get_methods(
ndim=ndim, sequential=sequential
)

0 comments on commit e849a01

Please sign in to comment.