Skip to content

Commit

Permalink
Merge branch 'topic/default/after-fluidfft-0.4.0' into 'branch/default'
Browse files Browse the repository at this point in the history
Update after new fluidfft

See merge request fluiddyn/fluidsim!377
  • Loading branch information
paugier committed Feb 24, 2024
2 parents 0a4e5da + bf2f909 commit 2fdb75d
Show file tree
Hide file tree
Showing 7 changed files with 217 additions and 233 deletions.
22 changes: 3 additions & 19 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ validate_code:
- job: "image:build"
optional: true
script:
- echo "CI_COMMIT_HG_BRANCH $CI_COMMIT_HG_BRANCH"
- echo "CI_COMMIT_BRANCH $CI_COMMIT_BRANCH"
- nox -s validate_code


Expand Down Expand Up @@ -175,32 +173,18 @@ test-release:examples:
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_TEST_RELEASE == "1"'
variables:
FLUIDFFT_TRANSONIC_BACKEND: "python"
script:
- python -m venv .venv
- . .venv/bin/activate
- pip install fluidfft
- pip install lib
- pip install ".[mpi,fft,test]"
- cd doc/examples
- make tests
- make tests_mpi
- nox -s test-examples


pages:
stage: doc
needs:
- job: "image:build"
optional: true
variables:
FLUIDFFT_TRANSONIC_BACKEND: "python"
script:
- python -m venv .venv
- . .venv/bin/activate
- pip install fluidfft --no-deps
- pdm sync -G doc -G fft -G test --no-self
- pip install . --config-settings=setup-args=-Dtransonic-backend=python --no-deps
- pdm sync -G doc -G fft -G test -G dev --no-self
- pdm run pip install . --config-settings=setup-args=-Dtransonic-backend=python --no-deps
- pdm run xvfb-run --auto-servernum sphinx-build -W -b html -d doc/_build/doctrees doc doc/_build/html
- mkdir -p public/$CI_COMMIT_REF_NAME
- rsync -rvc --delete doc/_build/html/* public/$CI_COMMIT_REF_NAME/
Expand Down
8 changes: 0 additions & 8 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,6 @@

todo_include_todos = True

# CSS selector which modifies the sphinx-copybutton feature
copybutton_selector = ",".join(
[
f"div.highlight-{css_class} div.highlight pre"
for css_class in ("python", "ipython3", "default")
]
)

nb_execution_raise_on_error = True
nb_execution_show_tb = True
nb_merge_streams = True
Expand Down
4 changes: 2 additions & 2 deletions doc/examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

PYTEST_ARGS?=test_run_examples.py

tests:
test:
rm -f .coverage
pytest $(PYTEST_ARGS) -v --cov --cov-config=.coveragerc --durations=10
coverage html
@echo "Code coverage analysis complete. View detailed report:"
@echo "file:https://${PWD}/htmlcov/index.html"

tests_mpi:
test_mpi:
mpirun -np 2 pytest $(PYTEST_ARGS) -v --durations=10

install_requirements_tests:
Expand Down
1 change: 0 additions & 1 deletion doc/examples/test_run_examples.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import unittest
import os
from pathlib import Path
import shutil

import pytest
Expand Down
10 changes: 1 addition & 9 deletions doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,9 @@ Fluidsim is sensitive to environment variables:

## Fluidfft

Fluidsim uses Fluidfft to compute Fourier transforms. Fluidfft can be installed in
different modes. Have a look at the
Fluidsim uses Fluidfft to compute Fourier transforms. Have a look at the
[fluidfft documentation](http:https://fluidfft.readthedocs.io/en/latest/install.html).

```{todo}
Fluidfft should be fully reorganized so that we can write here something simple
and nice.
```

## MPI simulations and mpi4py

Fluidsim can use [mpi4py] (which depends on a [MPI] implementation) for parallel
Expand Down
18 changes: 17 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,24 @@ def test_with_fft_and_pythran(session):
print_times("tests")


@nox.session(name="test-examples")
def test_examples(session):
"""Execute the examples using pytest"""

command = "pdm sync --clean -G test -G mpi -G fft -G dev --no-self"
session.run_always(*command.split(), external=True)

session.install(".")
session.install("fluidfft-fftwmpi")

session.chdir("doc/examples")
session.run("make", "test", external=True)
session.run("make", "test_mpi", external=True)


@nox.session
def doc(session):
"""Build the documentation"""
print_times = TimePrinter()
command = "pdm sync -G doc -G fft -G test --no-self"
session.run_always(*command.split(), external=True)
Expand All @@ -147,7 +163,7 @@ def _get_version_from_pyproject(path=Path.cwd()):
if isinstance(path, str):
path = Path(path)

if not path.name == "pyproject.toml":
if path.name != "pyproject.toml":
path /= "pyproject.toml"

in_project = False
Expand Down
Loading

0 comments on commit 2fdb75d

Please sign in to comment.