From d621ca3e4b94a4a1b7515b81c1028b0736eeb9e4 Mon Sep 17 00:00:00 2001 From: paugier Date: Wed, 3 Jan 2024 18:01:45 +0100 Subject: [PATCH 01/13] Update docker/hgrc --- docker/hgrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker/hgrc b/docker/hgrc index f0dae9bb..31f4fdfc 100644 --- a/docker/hgrc +++ b/docker/hgrc @@ -2,6 +2,7 @@ [ui] # name and email, e.g. # username = Jane Doe +username = appuser editor = emacs -nw -Q # We recommend enabling tweakdefaults to get slight improvements to @@ -20,9 +21,14 @@ rebase = absorb = evolve = topic = +hggit = [extdiff] cmd.meld = [trusted] users = root + +[alias] +lg = log -G +up = up -v From 1faadd9f338a84a8c6c5169c627a6b9ef94e89c4 Mon Sep 17 00:00:00 2001 From: paugier Date: Wed, 3 Jan 2024 18:02:15 +0100 Subject: [PATCH 02/13] Add nox to the Docker image --- .gitlab-ci.yml | 6 +++--- docker/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 734c6c5b..e1e67a82 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,9 +21,9 @@ CI image: stage: image tags: - container-registry-push - rules: - - if: '$CI_PIPELINE_SOURCE == "schedule"' - - if: '$CI_BUILD_IMAGES == "1"' + # rules: + # - if: '$CI_PIPELINE_SOURCE == "schedule"' + # - if: '$CI_BUILD_IMAGES == "1"' image: name: gcr.io/kaniko-project/executor:debug entrypoint: [ "" ] diff --git a/docker/Dockerfile b/docker/Dockerfile index 6097b67a..e39ae893 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -59,4 +59,4 @@ RUN wget https://foss.heptapod.net/fluiddyn/fluidfft/raw/branch/default/doc/inst RUN chmod +x install_pfft.sh RUN ./install_pfft.sh -RUN pip install -U pip pdm tox tox-pdm --user +RUN pip install -U pip pdm nox tox tox-pdm --user From c4b4cacff40a29262b70b145a442edefea2230d4 Mon Sep 17 00:00:00 2001 From: paugier Date: Wed, 3 Jan 2024 21:34:46 +0100 Subject: [PATCH 03/13] Try pdm scripts and nox for linting --- .gitlab-ci.yml | 10 ++++------ .hgignore | 1 + Makefile | 13 ++++++++----- noxfile.py | 10 ++++++++++ pyproject.toml | 7 +++++++ 5 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 noxfile.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e1e67a82..4779ab72 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,9 +21,9 @@ CI image: stage: image tags: - container-registry-push - # rules: - # - if: '$CI_PIPELINE_SOURCE == "schedule"' - # - if: '$CI_BUILD_IMAGES == "1"' + rules: + - if: '$CI_PIPELINE_SOURCE == "schedule"' + - if: '$CI_BUILD_IMAGES == "1"' image: name: gcr.io/kaniko-project/executor:debug entrypoint: [ "" ] @@ -54,9 +54,7 @@ validate_code: - job: "CI image" optional: true script: - - pdm install -G dev --no-self - - pdm run make lint - - pdm run make black_check + - nox validate_code tests: stage: test diff --git a/.hgignore b/.hgignore index 33d33ea1..23c603e0 100644 --- a/.hgignore +++ b/.hgignore @@ -18,6 +18,7 @@ __pycache__ .pytest_cache/ .mypy_cache/ .coverage/ +.nox bench/launcher_* bench/SLURM* diff --git a/Makefile b/Makefile index 4dfef067..267752d4 100644 --- a/Makefile +++ b/Makefile @@ -37,10 +37,16 @@ shortlog: @hg log -M -r$(RELEASE): --template '- {desc|firstline} (:rev:`{node|short}`)\n' black: - black -l 82 fluidsim scripts bench doc lib --exclude "/(__pythran__|__python__|__numba__|doc/_build|\.ipynb_checkpoints/*)/" + pdm black black_check: - black --check -l 82 fluidsim scripts bench doc lib --exclude "/(__pythran__|__python__|__numba__|doc/_build|\.ipynb_checkpoints/*)/" + pdm black_check + +lint: + pdm lint + +validate_code: + pdm validate_code tests: pytest -v lib @@ -84,9 +90,6 @@ _report_coverage: coverage: _tests_coverage _report_coverage -lint: - pylint -rn --rcfile=pylintrc --jobs=$(shell nproc) fluidsim --exit-zero - define _init_coverage rm -rf .coverage mkdir -p .coverage diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 00000000..795549b2 --- /dev/null +++ b/noxfile.py @@ -0,0 +1,10 @@ +import os +import nox + +os.environ.update({"PDM_IGNORE_SAVED_PYTHON": "1"}) + + +@nox.session +def validate_code(session): + session.run_always("pdm", "install", "-G", "dev", "--no-self", external=True) + session.run("pdm", "validate_code", external=True) diff --git a/pyproject.toml b/pyproject.toml index 6ff185e0..98cdb2b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -162,6 +162,13 @@ dev = [ "-e fluidsim-core @ file:///${PROJECT_ROOT}/lib", ] +[tool.pdm.scripts] +black = 'black -l 82 fluidsim scripts bench doc lib --exclude "/(__pythran__|__python__|__numba__|doc/_build|\.ipynb_checkpoints/*)/"' +lint = {shell="pylint -rn --rcfile=pylintrc --jobs=$(nproc) fluidsim --exit-zero"} +black_check = 'black --check -l 82 fluidsim scripts bench doc lib --exclude "/(__pythran__|__python__|__numba__|doc/_build|\.ipynb_checkpoints/*)/"' +validate_code = {composite = ["black_check", "lint"]} + + [tool.coverage.run] source = [ "./fluidsim", From c6189c2a238cf69ecf9bcc7e34e483a0c5605eb6 Mon Sep 17 00:00:00 2001 From: paugier Date: Wed, 3 Jan 2024 22:25:12 +0100 Subject: [PATCH 04/13] Nox for test-coverage without fft and pythran --- .gitlab-ci.yml | 12 ++++++++++-- noxfile.py | 13 +++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4779ab72..2af9bba2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -54,7 +54,7 @@ validate_code: - job: "CI image" optional: true script: - - nox validate_code + - nox -s validate_code tests: stage: test @@ -62,4 +62,12 @@ tests: - job: "CI image" optional: true script: - - tox -e py39,py39-fft,codecov + - tox -e py39-fft,codecov + +test_without_fft_and_pythran: + stage: test + needs: + - job: "CI image" + optional: true + script: + - nox -s test_without_fft_and_pythran diff --git a/noxfile.py b/noxfile.py index 795549b2..bc10b26f 100644 --- a/noxfile.py +++ b/noxfile.py @@ -8,3 +8,16 @@ def validate_code(session): session.run_always("pdm", "install", "-G", "dev", "--no-self", external=True) session.run("pdm", "validate_code", external=True) + + +@nox.session +def test_without_fft_and_pythran(session): + command = "pdm install -G dev -G test -G mpi -G scipy --no-self" + session.run_always(*command.split(), external=True) + session.install(".", "--config-settings=setup-args=-Dtransonic-backend=python") + session.run( + "make", + "_tests_coverage", + external=True, + env={"TRANSONIC_BACKEND": "python", "TRANSONIC_NO_REPLACE": "1"}, + ) From 1db33a632d10664f07f40b3fa25fe8be99a9c778 Mon Sep 17 00:00:00 2001 From: paugier Date: Thu, 4 Jan 2024 09:43:56 +0100 Subject: [PATCH 05/13] report_coverage in .gitlab-ci.yml --- .gitlab-ci.yml | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2af9bba2..67c762cb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ stages: - image - lint - test + - report variables: CODECOV_TOKEN: 4d2d8534-60ec-48b3-bf55-93b92f25913d @@ -54,15 +55,17 @@ validate_code: - job: "CI image" optional: true script: + - echo "CI_COMMIT_HG_BRANCH $CI_COMMIT_HG_BRANCH" + - echo "CI_COMMIT_BRANCH $CI_COMMIT_BRANCH" - nox -s validate_code -tests: - stage: test - needs: - - job: "CI image" - optional: true - script: - - tox -e py39-fft,codecov +# tests: +# stage: test +# needs: +# - job: "CI image" +# optional: true +# script: +# - tox -e py39-fft,codecov test_without_fft_and_pythran: stage: test @@ -71,3 +74,15 @@ test_without_fft_and_pythran: optional: true script: - nox -s test_without_fft_and_pythran + artifacts: + paths: + - .coverage/* + expire_in: 10 mins + +report_coverage: + stage: report + rules: + - when: on_success + script: + - pip install coverage + - make _report_coverage From 2cef935d44976a72d0878a720a513d3f3ac7d04a Mon Sep 17 00:00:00 2001 From: paugier Date: Thu, 4 Jan 2024 11:35:07 +0100 Subject: [PATCH 06/13] test_with_fft_and_pythran with nox --- .gitlab-ci.yml | 23 ++++++++++++++++------- noxfile.py | 14 +++++++++++++- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67c762cb..f2ad046e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,6 +49,7 @@ CI image: --cleanup --destination registry.heptapod.net:443/fluiddyn/fluidsim/ci/$CI_COMMIT_HG_BRANCH:stable + validate_code: stage: lint needs: @@ -59,13 +60,6 @@ validate_code: - echo "CI_COMMIT_BRANCH $CI_COMMIT_BRANCH" - nox -s validate_code -# tests: -# stage: test -# needs: -# - job: "CI image" -# optional: true -# script: -# - tox -e py39-fft,codecov test_without_fft_and_pythran: stage: test @@ -79,6 +73,19 @@ test_without_fft_and_pythran: - .coverage/* expire_in: 10 mins +test_with_fft_and_pythran: + stage: test + needs: + - job: "CI image" + optional: true + script: + - nox -s test_with_fft_and_pythran + artifacts: + paths: + - .coverage/* + expire_in: 10 mins + + report_coverage: stage: report rules: @@ -86,3 +93,5 @@ report_coverage: script: - pip install coverage - make _report_coverage + - rm -rf .coverage/* + diff --git a/noxfile.py b/noxfile.py index bc10b26f..9322eb70 100644 --- a/noxfile.py +++ b/noxfile.py @@ -12,7 +12,7 @@ def validate_code(session): @nox.session def test_without_fft_and_pythran(session): - command = "pdm install -G dev -G test -G mpi -G scipy --no-self" + command = "pdm install -G dev -G test -G mpi -G scipy --no-self" session.run_always(*command.split(), external=True) session.install(".", "--config-settings=setup-args=-Dtransonic-backend=python") session.run( @@ -21,3 +21,15 @@ def test_without_fft_and_pythran(session): external=True, env={"TRANSONIC_BACKEND": "python", "TRANSONIC_NO_REPLACE": "1"}, ) + + +@nox.session +def test_with_fft_and_pythran(session): + # first install fluidfft without Pythran compilation + session.install("fluidfft", env={"FLUIDFFT_TRANSONIC_BACKEND": "python"}) + + command = "pdm install -G dev -G test -G fft -G mpi -G scipy --no-self" + session.run_always(*command.split(), external=True) + session.install(".") + + session.run("make", "_tests_coverage", external=True) From de43e6e5cc6600b242a75948fc095f3c6ab72878 Mon Sep 17 00:00:00 2001 From: paugier Date: Thu, 4 Jan 2024 11:47:13 +0100 Subject: [PATCH 07/13] COVERAGE_DIR: .coverage_$CI_COMMIT_SHA --- .gitlab-ci.yml | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f2ad046e..6ce2cc19 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,10 +5,19 @@ stages: - report variables: - CODECOV_TOKEN: 4d2d8534-60ec-48b3-bf55-93b92f25913d + # CODECOV_TOKEN: 4d2d8534-60ec-48b3-bf55-93b92f25913d + COVERAGE_DIR: .coverage_$CI_COMMIT_SHA image: registry.heptapod.net:443/fluiddyn/fluidsim/ci/default:stable +# ugly workaround https://gitlab.com/gitlab-org/gitlab/-/issues/370052#note_1207556577 +workflow: + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS + when: never + - if: $CI_COMMIT_BRANCH + # check_bug: # image: fluiddyn/python3-stable:lastest # script: @@ -68,22 +77,26 @@ test_without_fft_and_pythran: optional: true script: - nox -s test_without_fft_and_pythran + - mkdir $COVERAGE_DIR + - cp -r .coverage/* $COVERAGE_DIR artifacts: paths: - - .coverage/* - expire_in: 10 mins + - $COVERAGE_DIR/* + expire_in: 60 mins -test_with_fft_and_pythran: - stage: test - needs: - - job: "CI image" - optional: true - script: - - nox -s test_with_fft_and_pythran - artifacts: - paths: - - .coverage/* - expire_in: 10 mins +# test_with_fft_and_pythran: +# stage: test +# needs: +# - job: "CI image" +# optional: true +# script: +# - nox -s test_with_fft_and_pythran +# - mkdir $COVERAGE_DIR +# - cp -r .coverage/* $COVERAGE_DIR +# artifacts: +# paths: +# - $COVERAGE_DIR/* +# expire_in: 60 mins report_coverage: @@ -91,7 +104,7 @@ report_coverage: rules: - when: on_success script: + - mv $COVERAGE_DIR .coverage - pip install coverage - - make _report_coverage - - rm -rf .coverage/* - + - coverage combine + - coverage report From 42b35caa41d652612f49f425dbc8297178628374 Mon Sep 17 00:00:00 2001 From: paugier Date: Thu, 4 Jan 2024 14:22:54 +0100 Subject: [PATCH 08/13] Rebuild Docker image --- .gitlab-ci.yml | 33 ++++++++++++++++----------------- docker/Dockerfile | 2 +- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6ce2cc19..341fa5ff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,6 @@ stages: - report variables: - # CODECOV_TOKEN: 4d2d8534-60ec-48b3-bf55-93b92f25913d COVERAGE_DIR: .coverage_$CI_COMMIT_SHA image: registry.heptapod.net:443/fluiddyn/fluidsim/ci/default:stable @@ -31,9 +30,9 @@ CI image: stage: image tags: - container-registry-push - rules: - - if: '$CI_PIPELINE_SOURCE == "schedule"' - - if: '$CI_BUILD_IMAGES == "1"' + # rules: + # - if: '$CI_PIPELINE_SOURCE == "schedule"' + # - if: '$CI_BUILD_IMAGES == "1"' image: name: gcr.io/kaniko-project/executor:debug entrypoint: [ "" ] @@ -84,19 +83,19 @@ test_without_fft_and_pythran: - $COVERAGE_DIR/* expire_in: 60 mins -# test_with_fft_and_pythran: -# stage: test -# needs: -# - job: "CI image" -# optional: true -# script: -# - nox -s test_with_fft_and_pythran -# - mkdir $COVERAGE_DIR -# - cp -r .coverage/* $COVERAGE_DIR -# artifacts: -# paths: -# - $COVERAGE_DIR/* -# expire_in: 60 mins +test_with_fft_and_pythran: + stage: test + needs: + - job: "CI image" + optional: true + script: + - nox -s test_with_fft_and_pythran + - mkdir $COVERAGE_DIR + - cp -r .coverage/* $COVERAGE_DIR + artifacts: + paths: + - $COVERAGE_DIR/* + expire_in: 60 mins report_coverage: diff --git a/docker/Dockerfile b/docker/Dockerfile index e39ae893..1a1269c2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -59,4 +59,4 @@ RUN wget https://foss.heptapod.net/fluiddyn/fluidfft/raw/branch/default/doc/inst RUN chmod +x install_pfft.sh RUN ./install_pfft.sh -RUN pip install -U pip pdm nox tox tox-pdm --user +RUN pip install -U pip pdm nox --user From 989b64e91203743f626ef39ec7d9b4f215234ba7 Mon Sep 17 00:00:00 2001 From: paugier Date: Thu, 4 Jan 2024 14:23:14 +0100 Subject: [PATCH 09/13] Update Github Actions --- .github/workflows/{ci.yml => ci-linux.yml} | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) rename .github/workflows/{ci.yml => ci-linux.yml} (61%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci-linux.yml similarity index 61% rename from .github/workflows/ci.yml rename to .github/workflows/ci-linux.yml index 8c3dd66c..e2ca95cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci-linux.yml @@ -1,4 +1,4 @@ -name: CI +name: CI Linux on: - push @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9, "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11"] steps: - name: apt install @@ -25,8 +25,14 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tox tox-gh-actions - - name: Test with tox + pip install pdm nox + - name: Test with nox run: | cp .github/workflows/.fluidfft-site.cfg $HOME - tox + nox -s test_without_fft_and_pythran + nox -s test_with_fft_and_pythran + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true # optional (default = false) + verbose: true # optional (default = false) From 70ee4d7216197ec848cc5a1354844b0b3681dd7d Mon Sep 17 00:00:00 2001 From: paugier Date: Thu, 4 Jan 2024 14:38:26 +0100 Subject: [PATCH 10/13] Remove tox.ini! --- .gitlab-ci.yml | 6 +++--- tox.ini | 52 -------------------------------------------------- 2 files changed, 3 insertions(+), 55 deletions(-) delete mode 100644 tox.ini diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 341fa5ff..4a03a7ca 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,9 +30,9 @@ CI image: stage: image tags: - container-registry-push - # rules: - # - if: '$CI_PIPELINE_SOURCE == "schedule"' - # - if: '$CI_BUILD_IMAGES == "1"' + rules: + - if: '$CI_PIPELINE_SOURCE == "schedule"' + - if: '$CI_BUILD_IMAGES == "1"' image: name: gcr.io/kaniko-project/executor:debug entrypoint: [ "" ] diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 1da44d0e..00000000 --- a/tox.ini +++ /dev/null @@ -1,52 +0,0 @@ -# Tox (http://tox.testrun.org/) is a tool for running tests in -# multiple virtualenvs. This configuration file will run the test -# suite on all supported python versions. To use it, "pip install tox" -# and then run "tox" from this directory. -# http://tox.readthedocs.io/en/latest/config.html -# -# To run tox faster, check out Detox -# (https://pypi.python.org/pypi/detox), which runs your tox runs in -# parallel. To use it, "pip install detox" and then run "detox" from -# this directory. -[tox] -envlist = - py{39,310,311}-pythran-fft - codecov -isolated_build = True - -[gh-actions] -python = - 3.9: py39-pythran-fft - 3.10: py310-pythran-fft - 3.11: py311-pythran-fft - -[testenv] -setenv = - FLUIDSIM_PATH = {toxinidir}/tmp_fluidsim_path - FLUIDDYN_PATH_SCRATCH = {toxinidir}/tmp_scratch - # no need to compile fluidfft files for these tests - FLUIDFFT_TRANSONIC_BACKEND = python - pythran: FLUIDSIM_TRANSONIC_BACKEND = pythran - !pythran: DISABLE_PYTHRAN = 1 -sitepackages = False -allowlist_externals = make -extras = - test - mpi - fft: fft -commands = - make _tests_coverage - -[testenv:codecov] -passenv = CODECOV_TOKEN -setenv = - CI_COMMIT_BRANCH = {env:CI_COMMIT_BRANCH:env:CI_COMMIT_HG_BRANCH} -sitepackages = True -deps = - codecov -allowlist_externals = make -skip_install = true -commands = - make _report_coverage - codecov --file .coverage/coverage.xml --commit {env:CI_COMMIT_SHA} \ - --branch {env:CI_COMMIT_BRANCH} --name Heptapod{env:CI_JOB_ID} From 41f6f245e4eae74fbc44e35469538db8dbb9bdc3 Mon Sep 17 00:00:00 2001 From: paugier Date: Thu, 4 Jan 2024 15:05:32 +0100 Subject: [PATCH 11/13] Build doc in CI --- .github/workflows/ci-linux.yml | 3 +++ .gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++ .readthedocs.req | 1 - .readthedocs.yml | 23 ++++++++--------------- 4 files changed, 42 insertions(+), 16 deletions(-) delete mode 100644 .readthedocs.req diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index e2ca95cf..2421f42c 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -28,6 +28,9 @@ jobs: pip install pdm nox - name: Test with nox run: | + # needed to avoid a pdm/unearth bug + $(hg debuginstall -T '{pythonexe}') -m pip install hg-evolve hg-git --no-cache-dir --user + cp docker/hgrc $HOME/.hgrc cp .github/workflows/.fluidfft-site.cfg $HOME nox -s test_without_fft_and_pythran nox -s test_with_fft_and_pythran diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a03a7ca..bc76b566 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ stages: - lint - test - report + - doc variables: COVERAGE_DIR: .coverage_$CI_COMMIT_SHA @@ -107,3 +108,33 @@ report_coverage: - pip install coverage - coverage combine - coverage report + + +doc:build: + stage: doc + needs: + - job: "CI image" + optional: true + variables: + FLUIDFFT_TRANSONIC_BACKEND: "python" + script: + - python -m venv .venv + - . .venv/bin/activate + - pip install fluidfft + - pdm install -G doc -G fft -G test --no-self + - pip install . --config-settings=setup-args=-Dtransonic-backend=python + - pdm run xvfb-run --auto-servernum sphinx-build -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/ + # This directory can become too large leading to error. + # It can be purged with the botton "Clear runner caches" + # in https://foss.heptapod.net/fluiddyn/fluidsim/-/pipelines + - ls public + - echo "CI_COMMIT_REF_NAME="$CI_COMMIT_REF_NAME + - echo See https://fluiddyn.pages.heptapod.net/fluidsim/$CI_COMMIT_REF_NAME + artifacts: + name: "$CI_COMMIT_REF_NAME" + paths: + - public + expire_in: 5 days + when: always diff --git a/.readthedocs.req b/.readthedocs.req deleted file mode 100644 index e83fc10f..00000000 --- a/.readthedocs.req +++ /dev/null @@ -1 +0,0 @@ -./lib \ No newline at end of file diff --git a/.readthedocs.yml b/.readthedocs.yml index 5a643b7c..c925ba75 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,24 +1,17 @@ -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required version: 2 -# Set the version of Python and other tools you might need build: os: ubuntu-22.04 tools: python: "3.11" + jobs: + post_create_environment: + - pip install pdm pip -U + post_install: + - pdm use -f $READTHEDOCS_VIRTUALENV_PATH + - FLUIDFFT_TRANSONIC_BACKEND="python" pip install fluidfft + - pdm install -G doc -G fft -G test --no-self + - pip install . --config-settings=setup-args=-Dtransonic-backend=python -# Build documentation in the doc directory with Sphinx sphinx: configuration: doc/conf.py - -python: - install: - - requirements: .readthedocs.req - - method: pip - path: . - extra_requirements: - - doc - - fft From 81d3a8713a109226d332283deded341e5d72b220 Mon Sep 17 00:00:00 2001 From: paugier Date: Thu, 4 Jan 2024 15:42:21 +0100 Subject: [PATCH 12/13] Fix a Meson file --- fluidsim/solvers/sphere/sw1l/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fluidsim/solvers/sphere/sw1l/meson.build b/fluidsim/solvers/sphere/sw1l/meson.build index 91b97ae0..bcdcede5 100644 --- a/fluidsim/solvers/sphere/sw1l/meson.build +++ b/fluidsim/solvers/sphere/sw1l/meson.build @@ -1,4 +1,4 @@ -python_souces = [ +python_sources = [ '__init__.py', 'solver.py', 'state.py', From 361ed58a6da2e5e2264d82bb237dee7faf9c6ae5 Mon Sep 17 00:00:00 2001 From: paugier Date: Thu, 4 Jan 2024 16:53:18 +0100 Subject: [PATCH 13/13] README in md --- README.md | 100 +++++++++++++++++++++++++++++++++ README.rst | 147 ------------------------------------------------- pyproject.toml | 3 + 3 files changed, 103 insertions(+), 147 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/README.md b/README.md new file mode 100644 index 00000000..17465e1b --- /dev/null +++ b/README.md @@ -0,0 +1,100 @@ +# ![FluidSim](https://foss.heptapod.net/fluiddyn/fluidsim/raw/branch/default/doc/logo.svg) + +[![Latest version](https://badge.fury.io/py/fluidsim.svg)](https://pypi.python.org/pypi/fluidsim/) +![Supported Python versions](https://img.shields.io/pypi/pyversions/fluidsim.svg) +[![Documentation status](https://readthedocs.org/projects/fluidsim/badge/?version=latest)](http://fluidsim.readthedocs.org) +[![Chat room](https://img.shields.io/matrix/fluiddyn-users:matrix.org.svg)](https://matrix.to/#/#fluiddyn-users:matrix.org) +[![Code coverage](https://codecov.io/gh/fluiddyn/fluidsim/branch/branch%2Fdefault/graph/badge.svg)](https://codecov.io/gh/fluiddyn/fluidsim) +[![Heptapod CI](https://foss.heptapod.net/fluiddyn/fluidsim/badges/branch/default/pipeline.svg)](https://foss.heptapod.net/fluiddyn/fluidsim/-/pipelines) +[![Github Actions](https://github.com/fluiddyn/fluidsim/actions/workflows/ci.yml/badge.svg?branch=branch/default)](https://github.com/fluiddyn/fluidsim/actions) + +Fluidsim is an extensible framework for studying fluid dynamics with +numerical simulations using Python. Fluidsim is an object-oriented +library to develop solvers (mainly using pseudo-spectral methods) by +writing mainly Python code. The result is **very efficient** even +compared to a pure Fortran or C++ code since the time-consuming tasks +are performed by optimized compiled functions. + +**Documentation**: + +## Getting started + +To try fluidsim without installation: +[![Binder notebook](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/fluiddyn/fluidsim/branch%2Fdefault?urlpath=lab/tree/doc/ipynb) + +For a **basic installation** it should be sufficient to run: + + pip install fluidsim + +or with conda: + + conda install -c conda-forge fluidsim + +Much more detailed instructions are given in [the +documentation](https://fluidsim.readthedocs.io/en/latest/install.html). + +## How does it work? + +Fluidsim is a +[HPC](https://en.wikipedia.org/wiki/High-performance_computing) code. It +is part of the wider project +[FluidDyn](https://pypi.python.org/pypi/fluiddyn/) and its +pseudospectral solvers rely on the library +[fluidfft](http://fluidfft.readthedocs.io) to use very efficient FFT +libraries. Fluidfft is written in C++, Cython and Python. Fluidfft and +fluidsim take advantage of +[Pythran](https://github.com/serge-sans-paille/pythran), an +ahead-of-time compiler which produces very efficient binaries by +compiling Python via C++11. + +An advantage of a CFD code written mostly in Python is that, to run +simulations and analyze the results, the users communicate (possibly +interactively) together and with the machine with Python, which is +nowadays among the best languages to do these tasks. Moreover, it is +much simpler and faster than with pure Fortran or C++ codes to add any +complicated analysis or to write a modified solver. Fluidsim can also be +used to extend existing solvers with Python interfaces such as +[Basilisk](http://basilisk.fr). + +We have created fluidsim to be **easy and nice to use and to develop**, +**efficient** and **robust**. + +*Keywords and ambitions*: fluid dynamics research with Python (>=3.6); +modular, object-oriented, collaborative, tested and documented, free and +open-source software. + +## License + +FluidSim is distributed under the +[CeCILL](http://www.cecill.info/index.en.html) License, a GPL compatible +french license. + +## Metapapers and citations + +If you use FluidSim to produce scientific articles, please cite our +metapapers presenting the [FluidDyn +project](https://openresearchsoftware.metajnl.com/articles/10.5334/jors.237/), +[FluidFFT](https://openresearchsoftware.metajnl.com/articles/10.5334/jors.238/), +and +[FluidSim](https://openresearchsoftware.metajnl.com/articles/10.5334/jors.239/): + + @article{fluiddyn, doi = {10.5334/jors.237}, year = {2019}, publisher + = {Ubiquity Press, Ltd.}, volume = {7}, author = {Pierre Augier and + Ashwin Vishnu Mohanan and Cyrille Bonamy}, title = {{FluidDyn}: A + Python Open-Source Framework for Research and Teaching in Fluid + Dynamics by Simulations, Experiments and Data Processing}, journal = + {Journal of Open Research Software} } + + @article{fluidfft, doi = {10.5334/jors.238}, year = {2019}, publisher + = {Ubiquity Press, Ltd.}, volume = {7}, author = {Ashwin Vishnu + Mohanan and Cyrille Bonamy and Pierre Augier}, title = {{FluidFFT}: + Common {API} (C\$mathplusmathplus\$ and Python) for Fast Fourier + Transform {HPC} Libraries}, journal = {Journal of Open Research + Software} } + + @article{fluidsim, doi = {10.5334/jors.239}, year = {2019}, publisher + = {Ubiquity Press, Ltd.}, volume = {7}, author = {Mohanan, Ashwin + Vishnu and Bonamy, Cyrille and Linares, Miguel Calpe and Augier, + Pierre}, title = {{FluidSim}: {Modular}, {Object}-{Oriented} {Python} + {Package} for {High}-{Performance} {CFD} {Simulations}}, journal = + {Journal of Open Research Software} } diff --git a/README.rst b/README.rst deleted file mode 100644 index a9659cf5..00000000 --- a/README.rst +++ /dev/null @@ -1,147 +0,0 @@ -====== -|logo| -====== - -|release| |pyversions| |docs| |chat| |coverage| |heptapod_ci| |github_actions| - -.. |logo| image:: https://foss.heptapod.net/fluiddyn/fluidsim/raw/branch/default/doc/logo.svg - :alt: FluidSim - -.. |release| image:: https://badge.fury.io/py/fluidsim.svg - :target: https://pypi.python.org/pypi/fluidsim/ - :alt: Latest version - -.. |pyversions| image:: https://img.shields.io/pypi/pyversions/fluidsim.svg - :alt: Supported Python versions - -.. |docs| image:: https://readthedocs.org/projects/fluidsim/badge/?version=latest - :target: http://fluidsim.readthedocs.org - :alt: Documentation status - -.. |chat| image:: https://img.shields.io/matrix/fluiddyn-users:matrix.org.svg - :target: https://matrix.to/#/#fluiddyn-users:matrix.org - :alt: Chat room - -.. |coverage| image:: https://codecov.io/gh/fluiddyn/fluidsim/branch/branch%2Fdefault/graph/badge.svg - :target: https://codecov.io/gh/fluiddyn/fluidsim - :alt: Code coverage - -.. |heptapod_ci| image:: https://foss.heptapod.net/fluiddyn/fluidsim/badges/branch/default/pipeline.svg - :target: https://foss.heptapod.net/fluiddyn/fluidsim/-/pipelines - :alt: Heptapod CI - -.. |github_actions| image:: https://github.com/fluiddyn/fluidsim/actions/workflows/ci.yml/badge.svg?branch=branch/default - :target: https://github.com/fluiddyn/fluidsim/actions - :alt: Github Actions - -.. description - -.. |binder| image:: https://mybinder.org/badge_logo.svg - :target: https://mybinder.org/v2/gh/fluiddyn/fluidsim/branch%2Fdefault?urlpath=lab/tree/doc/ipynb - :alt: Binder notebook - -Fluidsim is an extensible framework for studying fluid dynamics with numerical -simulations using Python. Fluidsim is an object-oriented library to develop -solvers (mainly using pseudo-spectral methods) by writing mainly Python code. -The result is **very efficient** even compared to a pure Fortran or C++ code -since the time-consuming tasks are performed by optimized compiled functions. - -**Documentation**: https://fluidsim.readthedocs.io - -Getting started ---------------- - -To try fluidsim without installation: |binder| - -For a **basic installation** it should be sufficient to run:: - - pip install fluidsim - -or with conda:: - - conda install -c conda-forge fluidsim - -Much more detailed instructions are given in `the documentation -`__. - -How does it work? ------------------ - -Fluidsim is a `HPC `_ -code. It is part of the wider project `FluidDyn -`_ and its pseudospectral solvers rely -on the library `fluidfft `_ to use very -efficient FFT libraries. Fluidfft is written in C++, Cython and Python. -Fluidfft and fluidsim take advantage of `Pythran -`_, an ahead-of-time compiler -which produces very efficient binaries by compiling Python via C++11. - -An advantage of a CFD code written mostly in Python is that, to run simulations -and analyze the results, the users communicate (possibly interactively) -together and with the machine with Python, which is nowadays among the best -languages to do these tasks. Moreover, it is much simpler and faster than with -pure Fortran or C++ codes to add any complicated analysis or to write a -modified solver. Fluidsim can also be used to extend existing solvers with -Python interfaces such as `Basilisk `__. - -We have created fluidsim to be **easy and nice to use and to develop**, -**efficient** and **robust**. - -*Keywords and ambitions*: fluid dynamics research with Python (>=3.6); -modular, object-oriented, collaborative, tested and documented, free and -open-source software. - -License -------- - -FluidSim is distributed under the CeCILL_ License, a GPL compatible french -license. - -.. _CeCILL: http://www.cecill.info/index.en.html - -Metapapers and citations ------------------------- - -If you use FluidSim to produce scientific articles, please cite our metapapers -presenting the `FluidDyn project -`__, -`FluidFFT -`__, and -`FluidSim -`__: - -.. code :: - - @article{fluiddyn, - doi = {10.5334/jors.237}, - year = {2019}, - publisher = {Ubiquity Press, Ltd.}, - volume = {7}, - author = {Pierre Augier and Ashwin Vishnu Mohanan and Cyrille Bonamy}, - title = {{FluidDyn}: A Python Open-Source Framework for Research and Teaching in Fluid Dynamics - by Simulations, Experiments and Data Processing}, - journal = {Journal of Open Research Software} - } - - @article{fluidfft, - doi = {10.5334/jors.238}, - year = {2019}, - publisher = {Ubiquity Press, Ltd.}, - volume = {7}, - author = {Ashwin Vishnu Mohanan and Cyrille Bonamy and Pierre Augier}, - title = {{FluidFFT}: Common {API} (C$\mathplus\mathplus$ and Python) - for Fast Fourier Transform {HPC} Libraries}, - journal = {Journal of Open Research Software} - } - - @article{fluidsim, - doi = {10.5334/jors.239}, - year = {2019}, - publisher = {Ubiquity Press, Ltd.}, - volume = {7}, - author = {Mohanan, Ashwin Vishnu and Bonamy, Cyrille and Linares, Miguel - Calpe and Augier, Pierre}, - title = {{FluidSim}: {Modular}, {Object}-{Oriented} {Python} {Package} for - {High}-{Performance} {CFD} {Simulations}}, - journal = {Journal of Open Research Software} - } diff --git a/pyproject.toml b/pyproject.toml index 98cdb2b2..62c68f83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -178,6 +178,9 @@ data_file = ".coverage/coverage" omit = [ "*/try_*.py", "*/_old_*.py", + "**/__pythran__/*.py", + "**/__python__/*.py", + "**/__numba__/*.py", ] [tool.coverage.report] show_missing = true