diff --git a/.github/workflows/ci_pipeline.yml b/.github/workflows/ci_pipeline.yml index e9b59cb75b..2030fafa97 100644 --- a/.github/workflows/ci_pipeline.yml +++ b/.github/workflows/ci_pipeline.yml @@ -41,9 +41,10 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - python: ['3.8', '3.9', '3.10'] env: ['base', 'fenics', 'mpi4py', 'petsc'] + python: ['3.8', '3.9', '3.10', '3.11', '3.12'] defaults: run: @@ -60,6 +61,10 @@ jobs: create-args: >- python=${{ matrix.python }} + - name: Install additional packages as needed + run: | + micromamba install -y --file etc/environment-tests.yml --freeze-installed + - name: Run pytest for CPU stuff run: | echo "print('Loading sitecustomize.py...') @@ -82,6 +87,77 @@ jobs: data_3.10 coverage_${{ matrix.env }}_3.10.dat + project_cpu_tests_linux: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + env: + - AllenCahn_Bayreuth + - AsympConv + - DAE + - FastWaveSlowWave + # - GPU + - Hamiltonian + - matrixPFASST + - parallelSDC + - parallelSDC_reloaded + - PinTSimE + - RDC + - Resilience + - SDC_showdown + - Second_orderSDC + - soft_failure + - TOMS + python: ['3.8', '3.9', '3.10', '3.11', '3.12'] + exclude: + - env: parallelSDC + python: '3.11' + - env: parallelSDC + python: '3.12' + + defaults: + run: + shell: bash -l {0} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Conda environment with Micromamba + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: "pySDC/projects/${{ matrix.env }}/environment.yml" + create-args: >- + python=${{ matrix.python }} + + - name: Install additional packages as needed + run: | + micromamba install -y --file etc/environment-tests.yml --freeze-installed + + - name: Run pytest for CPU stuff + run: | + echo "print('Loading sitecustomize.py...') + import coverage + coverage.process_startup() " > sitecustomize.py + coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/projects/${{ matrix.env }}/tests + + - name: Make coverage report + run: | + mv data data_${{ matrix.python }} + coverage combine + mv .coverage coverage_${{ matrix.env }}_${{ matrix.python }}.dat + + - name: Uploading artifacts + uses: actions/upload-artifact@v3 + if: matrix.python == '3.10' + with: + name: cpu-test-artifacts + path: | + data_3.10 + coverage_${{ matrix.env }}_3.10.dat + user_libpressio_tests: runs-on: ubuntu-latest @@ -108,7 +184,7 @@ jobs: source /opt/spack/share/spack/setup-env.sh spack load libpressio - coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/tests -m libpressio + coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/projects/compression/tests -m libpressio - name: Make coverage report run: | @@ -156,7 +232,7 @@ jobs: echo "print('Loading sitecustomize.py...') import coverage coverage.process_startup() " > sitecustomize.py - coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/tests -m monodomain + coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/projects/Monodomain/tests -m monodomain - name: Make coverage report run: | @@ -215,6 +291,7 @@ jobs: needs: - lint - user_cpu_tests_linux + - project_cpu_tests_linux - user_libpressio_tests - user_monodomain_tests_linux # - wait_for_gitlab @@ -230,7 +307,7 @@ jobs: - name: Install Conda environment with Micromamba uses: mamba-org/setup-micromamba@v1 with: - environment-file: "etc/environment-base.yml" + environment-file: "etc/environment-postprocess.yml" - name: Downloading artifacts uses: actions/download-artifact@v3 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0ea0d6a70a..500d94c020 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,5 +15,6 @@ This follows a specific OOP framework, you can look at the page on [custom imple 4. [Naming Conventions](./docs/contrib/03_naming_conventions.md) 5. [Custom Implementations](./docs/contrib/04_custom_implementations.md) 6. [Documenting Code](./docs/contrib/05_documenting_code.md) +7. [Adding a project](./docs/contrib/06_new_project.md) :arrow_left: [Back to main page](./README.md) diff --git a/docs/contrib/05_documenting_code.md b/docs/contrib/05_documenting_code.md index bbbee8cbe3..efae0b56ad 100644 --- a/docs/contrib/05_documenting_code.md +++ b/docs/contrib/05_documenting_code.md @@ -90,4 +90,4 @@ A more detailed example is given [here ...](https://sphinxcontrib-napoleon.readt :arrow_left: [Back to custom implementations](./04_custom_implementations.md) --- :arrow_up: [Contributing Summary](./../../CONTRIBUTING.md) --- -:arrow_right: [Next to a cute picture of cat](https://www.vecteezy.com/photo/2098203-silver-tabby-cat-sitting-on-green-background) \ No newline at end of file +:arrow_right: [Next to Adding a new project](./06_new_project.md) diff --git a/docs/contrib/06_new_project.md b/docs/contrib/06_new_project.md new file mode 100644 index 0000000000..059da620a5 --- /dev/null +++ b/docs/contrib/06_new_project.md @@ -0,0 +1,57 @@ +# Adding a project to pySDC (and automatic testing) + +When you do a project with pySDC we appreciate it if you merge it back to the main repository. +We are committed to keeping your work reproducible and prevent it from fading into oblivion. +To that end, please write extensive tests for your code and add them to the project. +See the [contribution guide](./../../CONTRIBUTING.md) for general advice on testing etc. +This guide will detail only how to add a project to pySDC. + +## Add a directory in 'pySDC/projects' + +First, create a new directory in `pySDC/projects` with the name of your project. +The code of the new project should go into that newly created directory. + +## Add an environment-file + +The testing pipeline uses [micromamba]() +and requires an environment file for setup. +This includes the dependencies that are required for your project to run. +The file needs to be named `environment.yml` and needs to follow the structure shown below: + +```yaml +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - numpy +``` + +The list of dependencies can be extended as needed. +The name should stay `pySDC`. The channels cover most of the usual packages. +If a package is needed that cannot be found in those channels by conda (or mamba), +please add the correct channel to the list. + +## Add tests to the project + +In order to automatically find the tests of your project, please add the tests to a subdirectory called `tests` in the directory of your project. +Furthermore, the files should start with `test_` and the functions should also start with that. +For more information see the documentation of pytest on [test discovery](). + +## Add the project to the continuous integration pipeline + +To run the tests of all projects in parallel, the projects are explicitly mentioned in the CI-file. +In order to run the tests of your project, please add the name of your project **as your directory is named** +in the [CI-File]() +in the job `project_cpu_tests_linux` in the list `strategy/matrix/env`. + +## Getting a DOI of pySDC for publication + +If your project is published and you need a dedicated pySDC version with a DOI, please get in touch with us and/or open a new issue. +We will help you with this as soon as possible. +Note that a final DOI is usually only necessary once a paper is accepted and the final proofs are due. +We strongly encourage to describe and cite the current version of pySDC already during initial submission, though. + +:arrow_left: [Back to Documenting Code](./05_documenting_code.md) --- +:arrow_up: [Contributing Summary](./../../CONTRIBUTING.md) --- +:arrow_right: [Next to a cute picture of cat](https://www.vecteezy.com/photo/2098203-silver-tabby-cat-sitting-on-green-background) \ No newline at end of file diff --git a/etc/environment-base.yml b/etc/environment-base.yml index 97f7fbeb62..6ee1d85923 100644 --- a/etc/environment-base.yml +++ b/etc/environment-base.yml @@ -9,9 +9,3 @@ dependencies: - sympy>=1.0 - numba>=0.35 - dill>=0.2.6 - - pytest - - pytest-benchmark - - pytest-timeout - - pytest-order - - coverage[toml] - - sphinx diff --git a/etc/environment-cupy.yml b/etc/environment-cupy.yml index c847cfc5a7..dab002f58e 100644 --- a/etc/environment-cupy.yml +++ b/etc/environment-cupy.yml @@ -7,8 +7,4 @@ dependencies: - scipy>=0.17.1 - matplotlib>=3.0 - dill>=0.2.6 - - pytest - - pytest-cov - - pytest-timeout - - pytest-order - cupy diff --git a/etc/environment-fenics.yml b/etc/environment-fenics.yml index 443a45ef9e..8604b24a97 100644 --- a/etc/environment-fenics.yml +++ b/etc/environment-fenics.yml @@ -9,7 +9,3 @@ dependencies: - dill>=0.2.6 - fenics>=2019.1.0 - mpi4py<=3.1.4 - - pytest - - pytest-cov - - pytest-timeout - - pytest-order diff --git a/etc/environment-mpi4py.yml b/etc/environment-mpi4py.yml index e7539720f0..c33d3f6b6d 100644 --- a/etc/environment-mpi4py.yml +++ b/etc/environment-mpi4py.yml @@ -5,11 +5,8 @@ channels: dependencies: - numpy>=1.15.4 - scipy>=0.17.1 - - matplotlib>=3.0,<=3.5.3 + - matplotlib>=3.0 - dill>=0.2.6 - mpich - mpi4py-fft>=2.0.2 - mpi4py>=3.0.0 - - pytest - - pytest-cov - - pytest-timeout diff --git a/etc/environment-petsc.yml b/etc/environment-petsc.yml index 7b5b4f3900..cc22fd7145 100644 --- a/etc/environment-petsc.yml +++ b/etc/environment-petsc.yml @@ -10,7 +10,3 @@ dependencies: - mpich - petsc4py<3.20 - mpi4py>=3.0.0 - - pytest - - pytest-cov - - pytest-timeout - - pytest-order diff --git a/etc/environment-postprocess.yml b/etc/environment-postprocess.yml new file mode 100644 index 0000000000..88926a7cbe --- /dev/null +++ b/etc/environment-postprocess.yml @@ -0,0 +1,12 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - coverage[toml] + - sphinx + - numpy + - scipy + - matplotlib + - dill + - numba diff --git a/etc/environment-tests.yml b/etc/environment-tests.yml new file mode 100644 index 0000000000..e96ec1050c --- /dev/null +++ b/etc/environment-tests.yml @@ -0,0 +1,10 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - pytest + - pytest-benchmark + - pytest-timeout + - pytest-order + - coverage[toml] diff --git a/pySDC/playgrounds/12th_PinT_Workshop/environment-tutorial.yml b/pySDC/playgrounds/12th_PinT_Workshop/environment-tutorial.yml index f8ce023019..7384dd9512 100644 --- a/pySDC/playgrounds/12th_PinT_Workshop/environment-tutorial.yml +++ b/pySDC/playgrounds/12th_PinT_Workshop/environment-tutorial.yml @@ -5,7 +5,7 @@ channels: dependencies: - numpy>=1.15.4 - scipy>=0.17.1 - - matplotlib>=3.0,<=3.5.3 + - matplotlib>=3.0 - dill>=0.2.6 - mpich - mpi4py>=3.0.0 diff --git a/pySDC/projects/AllenCahn_Bayreuth/environment.yml b/pySDC/projects/AllenCahn_Bayreuth/environment.yml new file mode 100644 index 0000000000..91f3ae538f --- /dev/null +++ b/pySDC/projects/AllenCahn_Bayreuth/environment.yml @@ -0,0 +1,11 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - mpi4py>=3.0.0 + - mpi4py-fft>=2.0.2 + - matplotlib>=3.0 + - dill>=0.2.6 + - scipy>=0.17.1 + diff --git a/pySDC/tests/test_projects/__init__.py b/pySDC/projects/AllenCahn_Bayreuth/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/__init__.py rename to pySDC/projects/AllenCahn_Bayreuth/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_AC/test_simple_forcing.py b/pySDC/projects/AllenCahn_Bayreuth/tests/test_simple_forcing.py similarity index 100% rename from pySDC/tests/test_projects/test_AC/test_simple_forcing.py rename to pySDC/projects/AllenCahn_Bayreuth/tests/test_simple_forcing.py diff --git a/pySDC/tests/test_projects/test_AC/test_temp_forcing.py b/pySDC/projects/AllenCahn_Bayreuth/tests/test_temp_forcing.py similarity index 100% rename from pySDC/tests/test_projects/test_AC/test_temp_forcing.py rename to pySDC/projects/AllenCahn_Bayreuth/tests/test_temp_forcing.py diff --git a/pySDC/projects/AsympConv/environment.yml b/pySDC/projects/AsympConv/environment.yml new file mode 100644 index 0000000000..998ab0efa2 --- /dev/null +++ b/pySDC/projects/AsympConv/environment.yml @@ -0,0 +1,8 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - matplotlib>=3.0 + - scipy>=0.17.1 + - dill>=0.2.6 diff --git a/pySDC/tests/test_projects/test_AC/__init__.py b/pySDC/projects/AsympConv/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/test_AC/__init__.py rename to pySDC/projects/AsympConv/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_asympconv/test_PFASST.py b/pySDC/projects/AsympConv/tests/test_PFASST.py similarity index 100% rename from pySDC/tests/test_projects/test_asympconv/test_PFASST.py rename to pySDC/projects/AsympConv/tests/test_PFASST.py diff --git a/pySDC/projects/DAE/environment.yml b/pySDC/projects/DAE/environment.yml new file mode 100644 index 0000000000..3d332962d4 --- /dev/null +++ b/pySDC/projects/DAE/environment.yml @@ -0,0 +1,8 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - numpy + - scipy>=0.17.1 + - dill>=0.2.6 diff --git a/pySDC/tests/test_projects/test_DAE/test_DAEMesh.py b/pySDC/projects/DAE/tests/test_DAEMesh.py similarity index 100% rename from pySDC/tests/test_projects/test_DAE/test_DAEMesh.py rename to pySDC/projects/DAE/tests/test_DAEMesh.py diff --git a/pySDC/tests/test_projects/test_DAE/test_HookClass_DAE.py b/pySDC/projects/DAE/tests/test_HookClass_DAE.py similarity index 100% rename from pySDC/tests/test_projects/test_DAE/test_HookClass_DAE.py rename to pySDC/projects/DAE/tests/test_HookClass_DAE.py diff --git a/pySDC/tests/test_projects/test_DAE/test_SemiImplicitDAE.py b/pySDC/projects/DAE/tests/test_SemiImplicitDAE.py similarity index 100% rename from pySDC/tests/test_projects/test_DAE/test_SemiImplicitDAE.py rename to pySDC/projects/DAE/tests/test_SemiImplicitDAE.py diff --git a/pySDC/tests/test_projects/test_DAE/test_convergence.py b/pySDC/projects/DAE/tests/test_convergence.py similarity index 100% rename from pySDC/tests/test_projects/test_DAE/test_convergence.py rename to pySDC/projects/DAE/tests/test_convergence.py diff --git a/pySDC/tests/test_projects/test_DAE/test_fully_implicit_DAE.py b/pySDC/projects/DAE/tests/test_fully_implicit_DAE.py similarity index 100% rename from pySDC/tests/test_projects/test_DAE/test_fully_implicit_DAE.py rename to pySDC/projects/DAE/tests/test_fully_implicit_DAE.py diff --git a/pySDC/tests/test_projects/test_DAE/test_iteration.py b/pySDC/projects/DAE/tests/test_iteration.py similarity index 100% rename from pySDC/tests/test_projects/test_DAE/test_iteration.py rename to pySDC/projects/DAE/tests/test_iteration.py diff --git a/pySDC/tests/test_projects/test_DAE/test_playground.py b/pySDC/projects/DAE/tests/test_playground.py similarity index 100% rename from pySDC/tests/test_projects/test_DAE/test_playground.py rename to pySDC/projects/DAE/tests/test_playground.py diff --git a/pySDC/tests/test_projects/test_DAE/test_problems.py b/pySDC/projects/DAE/tests/test_problems.py similarity index 99% rename from pySDC/tests/test_projects/test_DAE/test_problems.py rename to pySDC/projects/DAE/tests/test_problems.py index dbc901cfbb..3a63626d9f 100644 --- a/pySDC/tests/test_projects/test_DAE/test_problems.py +++ b/pySDC/projects/DAE/tests/test_problems.py @@ -612,6 +612,7 @@ def test_WSCC9_update_YBus(): ), 'YBus after line outage does not match with the one it should supposed to!' +@pytest.mark.timeout(360) @pytest.mark.base def test_WSCC9_SDC_detection(): """ diff --git a/pySDC/projects/FastWaveSlowWave/environment.yml b/pySDC/projects/FastWaveSlowWave/environment.yml new file mode 100644 index 0000000000..d2b8d7e218 --- /dev/null +++ b/pySDC/projects/FastWaveSlowWave/environment.yml @@ -0,0 +1,10 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - numpy + - matplotlib>=3.0 + - scipy>=0.17.1 + - sympy>=1.0 + - dill>=0.2.6 diff --git a/pySDC/tests/test_projects/test_RDC/__init__.py b/pySDC/projects/FastWaveSlowWave/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/test_RDC/__init__.py rename to pySDC/projects/FastWaveSlowWave/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_fwsw/test_acoustic.py b/pySDC/projects/FastWaveSlowWave/tests/test_acoustic.py similarity index 100% rename from pySDC/tests/test_projects/test_fwsw/test_acoustic.py rename to pySDC/projects/FastWaveSlowWave/tests/test_acoustic.py diff --git a/pySDC/tests/test_projects/test_fwsw/test_boussinesq.py b/pySDC/projects/FastWaveSlowWave/tests/test_boussinesq.py similarity index 100% rename from pySDC/tests/test_projects/test_fwsw/test_boussinesq.py rename to pySDC/projects/FastWaveSlowWave/tests/test_boussinesq.py diff --git a/pySDC/tests/test_projects/test_fwsw/test_fwsw.py b/pySDC/projects/FastWaveSlowWave/tests/test_fwsw.py similarity index 100% rename from pySDC/tests/test_projects/test_fwsw/test_fwsw.py rename to pySDC/projects/FastWaveSlowWave/tests/test_fwsw.py diff --git a/pySDC/tests/test_projects/test_SDC_showdown/__init__.py b/pySDC/projects/GPU/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/test_SDC_showdown/__init__.py rename to pySDC/projects/GPU/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_gpu/test_ac.py b/pySDC/projects/GPU/tests/test_ac.py similarity index 100% rename from pySDC/tests/test_projects/test_gpu/test_ac.py rename to pySDC/projects/GPU/tests/test_ac.py diff --git a/pySDC/tests/test_projects/test_gpu/test_heat.py b/pySDC/projects/GPU/tests/test_heat.py similarity index 100% rename from pySDC/tests/test_projects/test_gpu/test_heat.py rename to pySDC/projects/GPU/tests/test_heat.py diff --git a/pySDC/projects/Hamiltonian/environment.yml b/pySDC/projects/Hamiltonian/environment.yml new file mode 100644 index 0000000000..59d683a4c9 --- /dev/null +++ b/pySDC/projects/Hamiltonian/environment.yml @@ -0,0 +1,9 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - dill>=0.2.6 + - numpy + - matplotlib>=3.0 + - scipy>=0.17.1 diff --git a/pySDC/tests/test_projects/test_TOMS/__init__.py b/pySDC/projects/Hamiltonian/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/test_TOMS/__init__.py rename to pySDC/projects/Hamiltonian/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_hamiltonian/test_fput.py b/pySDC/projects/Hamiltonian/tests/test_fput.py similarity index 100% rename from pySDC/tests/test_projects/test_hamiltonian/test_fput.py rename to pySDC/projects/Hamiltonian/tests/test_fput.py diff --git a/pySDC/tests/test_projects/test_hamiltonian/test_simple.py b/pySDC/projects/Hamiltonian/tests/test_simple.py similarity index 100% rename from pySDC/tests/test_projects/test_hamiltonian/test_simple.py rename to pySDC/projects/Hamiltonian/tests/test_simple.py diff --git a/pySDC/tests/test_projects/test_hamiltonian/test_solar.py b/pySDC/projects/Hamiltonian/tests/test_solar.py similarity index 100% rename from pySDC/tests/test_projects/test_hamiltonian/test_solar.py rename to pySDC/projects/Hamiltonian/tests/test_solar.py diff --git a/pySDC/tests/test_projects/test_monodomain/test_monodomain_convergence.py b/pySDC/projects/Monodomain/tests/test_monodomain_convergence.py similarity index 100% rename from pySDC/tests/test_projects/test_monodomain/test_monodomain_convergence.py rename to pySDC/projects/Monodomain/tests/test_monodomain_convergence.py diff --git a/pySDC/tests/test_projects/test_monodomain/test_monodomain_iterations.py b/pySDC/projects/Monodomain/tests/test_monodomain_iterations.py similarity index 100% rename from pySDC/tests/test_projects/test_monodomain/test_monodomain_iterations.py rename to pySDC/projects/Monodomain/tests/test_monodomain_iterations.py diff --git a/pySDC/tests/test_projects/test_monodomain/test_monodomain_iterations_parallel.py b/pySDC/projects/Monodomain/tests/test_monodomain_iterations_parallel.py similarity index 100% rename from pySDC/tests/test_projects/test_monodomain/test_monodomain_iterations_parallel.py rename to pySDC/projects/Monodomain/tests/test_monodomain_iterations_parallel.py diff --git a/pySDC/tests/test_projects/test_monodomain/test_monodomain_stability_domain.py b/pySDC/projects/Monodomain/tests/test_monodomain_stability_domain.py similarity index 100% rename from pySDC/tests/test_projects/test_monodomain/test_monodomain_stability_domain.py rename to pySDC/projects/Monodomain/tests/test_monodomain_stability_domain.py diff --git a/pySDC/projects/PinTSimE/environment.yml b/pySDC/projects/PinTSimE/environment.yml new file mode 100644 index 0000000000..bcc3f1bc76 --- /dev/null +++ b/pySDC/projects/PinTSimE/environment.yml @@ -0,0 +1,9 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - numpy + - scipy>=0.17.1 + - dill>=0.2.6 + - matplotlib>=3.0 diff --git a/pySDC/tests/test_projects/test_pintsime/test_SwitchEstimator.py b/pySDC/projects/PinTSimE/tests/test_SwitchEstimator.py similarity index 100% rename from pySDC/tests/test_projects/test_pintsime/test_SwitchEstimator.py rename to pySDC/projects/PinTSimE/tests/test_SwitchEstimator.py diff --git a/pySDC/tests/test_projects/test_pintsime/test_battery_model.py b/pySDC/projects/PinTSimE/tests/test_battery_model.py similarity index 100% rename from pySDC/tests/test_projects/test_pintsime/test_battery_model.py rename to pySDC/projects/PinTSimE/tests/test_battery_model.py diff --git a/pySDC/tests/test_projects/test_pintsime/test_buck_model.py b/pySDC/projects/PinTSimE/tests/test_buck_model.py similarity index 100% rename from pySDC/tests/test_projects/test_pintsime/test_buck_model.py rename to pySDC/projects/PinTSimE/tests/test_buck_model.py diff --git a/pySDC/tests/test_projects/test_pintsime/test_discontinuous_test_ODE.py b/pySDC/projects/PinTSimE/tests/test_discontinuous_test_ODE.py similarity index 100% rename from pySDC/tests/test_projects/test_pintsime/test_discontinuous_test_ODE.py rename to pySDC/projects/PinTSimE/tests/test_discontinuous_test_ODE.py diff --git a/pySDC/tests/test_projects/test_pintsime/test_estimation_check.py b/pySDC/projects/PinTSimE/tests/test_estimation_check.py similarity index 100% rename from pySDC/tests/test_projects/test_pintsime/test_estimation_check.py rename to pySDC/projects/PinTSimE/tests/test_estimation_check.py diff --git a/pySDC/tests/test_projects/test_pintsime/test_piline_model.py b/pySDC/projects/PinTSimE/tests/test_piline_model.py similarity index 100% rename from pySDC/tests/test_projects/test_pintsime/test_piline_model.py rename to pySDC/projects/PinTSimE/tests/test_piline_model.py diff --git a/pySDC/projects/RDC/environment.yml b/pySDC/projects/RDC/environment.yml new file mode 100644 index 0000000000..7b7d8f3827 --- /dev/null +++ b/pySDC/projects/RDC/environment.yml @@ -0,0 +1,8 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - numpy + - dill>=0.2.6 + - scipy>=0.17.1 diff --git a/pySDC/tests/test_projects/test_asympconv/__init__.py b/pySDC/projects/RDC/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/test_asympconv/__init__.py rename to pySDC/projects/RDC/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_RDC/test_MLRDC_PFASST.py b/pySDC/projects/RDC/tests/test_MLRDC_PFASST.py similarity index 100% rename from pySDC/tests/test_projects/test_RDC/test_MLRDC_PFASST.py rename to pySDC/projects/RDC/tests/test_MLRDC_PFASST.py diff --git a/pySDC/projects/Resilience/environment.yml b/pySDC/projects/Resilience/environment.yml new file mode 100644 index 0000000000..a085015a2d --- /dev/null +++ b/pySDC/projects/Resilience/environment.yml @@ -0,0 +1,11 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - mpi4py>=3.0.0 + - mpi4py-fft>=2.0.2 + - mpich + - matplotlib>=3.0 + - dill>=0.2.6 + - scipy>=0.17.1 diff --git a/pySDC/tests/test_projects/test_compression/__init__.py b/pySDC/projects/Resilience/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/test_compression/__init__.py rename to pySDC/projects/Resilience/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_resilience/test_FD_eigenvalues.py b/pySDC/projects/Resilience/tests/test_FD_eigenvalues.py similarity index 100% rename from pySDC/tests/test_projects/test_resilience/test_FD_eigenvalues.py rename to pySDC/projects/Resilience/tests/test_FD_eigenvalues.py diff --git a/pySDC/tests/test_projects/test_resilience/test_Lorenz.py b/pySDC/projects/Resilience/tests/test_Lorenz.py similarity index 100% rename from pySDC/tests/test_projects/test_resilience/test_Lorenz.py rename to pySDC/projects/Resilience/tests/test_Lorenz.py diff --git a/pySDC/tests/test_projects/test_resilience/test_adaptive_collocation.py b/pySDC/projects/Resilience/tests/test_adaptive_collocation.py similarity index 100% rename from pySDC/tests/test_projects/test_resilience/test_adaptive_collocation.py rename to pySDC/projects/Resilience/tests/test_adaptive_collocation.py diff --git a/pySDC/tests/test_projects/test_resilience/test_efficient_sweepers.py b/pySDC/projects/Resilience/tests/test_efficient_sweepers.py similarity index 100% rename from pySDC/tests/test_projects/test_resilience/test_efficient_sweepers.py rename to pySDC/projects/Resilience/tests/test_efficient_sweepers.py diff --git a/pySDC/tests/test_projects/test_resilience/test_fault_injection.py b/pySDC/projects/Resilience/tests/test_fault_injection.py similarity index 100% rename from pySDC/tests/test_projects/test_resilience/test_fault_injection.py rename to pySDC/projects/Resilience/tests/test_fault_injection.py diff --git a/pySDC/tests/test_projects/test_resilience/test_order.py b/pySDC/projects/Resilience/tests/test_order.py similarity index 100% rename from pySDC/tests/test_projects/test_resilience/test_order.py rename to pySDC/projects/Resilience/tests/test_order.py diff --git a/pySDC/tests/test_projects/test_resilience/test_piline.py b/pySDC/projects/Resilience/tests/test_piline.py similarity index 100% rename from pySDC/tests/test_projects/test_resilience/test_piline.py rename to pySDC/projects/Resilience/tests/test_piline.py diff --git a/pySDC/tests/test_projects/test_resilience/test_quench.py b/pySDC/projects/Resilience/tests/test_quench.py similarity index 100% rename from pySDC/tests/test_projects/test_resilience/test_quench.py rename to pySDC/projects/Resilience/tests/test_quench.py diff --git a/pySDC/tests/test_projects/test_resilience/test_schroedinger.py b/pySDC/projects/Resilience/tests/test_schroedinger.py similarity index 100% rename from pySDC/tests/test_projects/test_resilience/test_schroedinger.py rename to pySDC/projects/Resilience/tests/test_schroedinger.py diff --git a/pySDC/tests/test_projects/test_resilience/test_strategies.py b/pySDC/projects/Resilience/tests/test_strategies.py similarity index 100% rename from pySDC/tests/test_projects/test_resilience/test_strategies.py rename to pySDC/projects/Resilience/tests/test_strategies.py diff --git a/pySDC/tests/test_projects/test_resilience/test_vdp.py b/pySDC/projects/Resilience/tests/test_vdp.py similarity index 100% rename from pySDC/tests/test_projects/test_resilience/test_vdp.py rename to pySDC/projects/Resilience/tests/test_vdp.py diff --git a/pySDC/projects/SDC_showdown/environment.yml b/pySDC/projects/SDC_showdown/environment.yml new file mode 100644 index 0000000000..2917d1ad6f --- /dev/null +++ b/pySDC/projects/SDC_showdown/environment.yml @@ -0,0 +1,9 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - petsc4py<3.20 + - matplotlib>=3.0 + - dill>=0.2.6 + - scipy>=0.17.1 diff --git a/pySDC/tests/test_projects/test_fwsw/__init__.py b/pySDC/projects/SDC_showdown/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/test_fwsw/__init__.py rename to pySDC/projects/SDC_showdown/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_SDC_showdown/test_fisher.py b/pySDC/projects/SDC_showdown/tests/test_fisher.py similarity index 100% rename from pySDC/tests/test_projects/test_SDC_showdown/test_fisher.py rename to pySDC/projects/SDC_showdown/tests/test_fisher.py diff --git a/pySDC/tests/test_projects/test_SDC_showdown/test_grayscott.py b/pySDC/projects/SDC_showdown/tests/test_grayscott.py similarity index 100% rename from pySDC/tests/test_projects/test_SDC_showdown/test_grayscott.py rename to pySDC/projects/SDC_showdown/tests/test_grayscott.py diff --git a/pySDC/projects/Second_orderSDC/environment.yml b/pySDC/projects/Second_orderSDC/environment.yml new file mode 100644 index 0000000000..95ab6a5fff --- /dev/null +++ b/pySDC/projects/Second_orderSDC/environment.yml @@ -0,0 +1,10 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - numpy + - numba>=0.35 + - dill>=0.2.6 + - matplotlib>=3.0 + - scipy>=0.17.1 diff --git a/pySDC/tests/test_projects/test_gpu/__init__.py b/pySDC/projects/Second_orderSDC/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/test_gpu/__init__.py rename to pySDC/projects/Second_orderSDC/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_second_orderSDC/test_convergence.py b/pySDC/projects/Second_orderSDC/tests/test_convergence.py similarity index 100% rename from pySDC/tests/test_projects/test_second_orderSDC/test_convergence.py rename to pySDC/projects/Second_orderSDC/tests/test_convergence.py diff --git a/pySDC/tests/test_projects/test_second_orderSDC/test_stability.py b/pySDC/projects/Second_orderSDC/tests/test_stability.py similarity index 100% rename from pySDC/tests/test_projects/test_second_orderSDC/test_stability.py rename to pySDC/projects/Second_orderSDC/tests/test_stability.py diff --git a/pySDC/projects/TOMS/environment.yml b/pySDC/projects/TOMS/environment.yml new file mode 100644 index 0000000000..1343111e30 --- /dev/null +++ b/pySDC/projects/TOMS/environment.yml @@ -0,0 +1,8 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - dill>=0.2.6 + - matplotlib>=3.0 + - scipy>=0.17.1 diff --git a/pySDC/tests/test_projects/test_hamiltonian/__init__.py b/pySDC/projects/TOMS/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/test_hamiltonian/__init__.py rename to pySDC/projects/TOMS/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_TOMS/test_AllenCahn_contracting_circle.py b/pySDC/projects/TOMS/tests/test_AllenCahn_contracting_circle.py similarity index 100% rename from pySDC/tests/test_projects/test_TOMS/test_AllenCahn_contracting_circle.py rename to pySDC/projects/TOMS/tests/test_AllenCahn_contracting_circle.py diff --git a/pySDC/tests/test_projects/test_TOMS/test_visualize_pySDC_with_PETSc.py b/pySDC/projects/TOMS/tests/test_visualize_pySDC_with_PETSc.py similarity index 100% rename from pySDC/tests/test_projects/test_TOMS/test_visualize_pySDC_with_PETSc.py rename to pySDC/projects/TOMS/tests/test_visualize_pySDC_with_PETSc.py diff --git a/pySDC/tests/test_projects/test_matrixPFASST/__init__.py b/pySDC/projects/compression/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/test_matrixPFASST/__init__.py rename to pySDC/projects/compression/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_compression/test_proof_of_concept.py b/pySDC/projects/compression/tests/test_proof_of_concept.py similarity index 100% rename from pySDC/tests/test_projects/test_compression/test_proof_of_concept.py rename to pySDC/projects/compression/tests/test_proof_of_concept.py diff --git a/pySDC/projects/matrixPFASST/environment.yml b/pySDC/projects/matrixPFASST/environment.yml new file mode 100644 index 0000000000..3d332962d4 --- /dev/null +++ b/pySDC/projects/matrixPFASST/environment.yml @@ -0,0 +1,8 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - numpy + - scipy>=0.17.1 + - dill>=0.2.6 diff --git a/pySDC/tests/test_projects/test_parallelSDC/__init__.py b/pySDC/projects/matrixPFASST/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/test_parallelSDC/__init__.py rename to pySDC/projects/matrixPFASST/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_matrixPFASST/test_controllers.py b/pySDC/projects/matrixPFASST/tests/test_controllers.py similarity index 100% rename from pySDC/tests/test_projects/test_matrixPFASST/test_controllers.py rename to pySDC/projects/matrixPFASST/tests/test_controllers.py diff --git a/pySDC/projects/parallelSDC/environment.yml b/pySDC/projects/parallelSDC/environment.yml new file mode 100644 index 0000000000..45f8cb089f --- /dev/null +++ b/pySDC/projects/parallelSDC/environment.yml @@ -0,0 +1,11 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - numpy>=1.15.4 + - scipy>=0.17.1 + - matplotlib>=3.0,<=3.5.3 + - dill>=0.2.6 + - mpich + - mpi4py>=3.0.0 diff --git a/pySDC/tests/test_projects/test_resilience/__init__.py b/pySDC/projects/parallelSDC/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/test_resilience/__init__.py rename to pySDC/projects/parallelSDC/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_parallelSDC/test_AllenCahn_parallel.py b/pySDC/projects/parallelSDC/tests/test_AllenCahn_parallel.py similarity index 100% rename from pySDC/tests/test_projects/test_parallelSDC/test_AllenCahn_parallel.py rename to pySDC/projects/parallelSDC/tests/test_AllenCahn_parallel.py diff --git a/pySDC/tests/test_projects/test_parallelSDC/test_fisher.py b/pySDC/projects/parallelSDC/tests/test_fisher.py similarity index 100% rename from pySDC/tests/test_projects/test_parallelSDC/test_fisher.py rename to pySDC/projects/parallelSDC/tests/test_fisher.py diff --git a/pySDC/tests/test_projects/test_parallelSDC/test_preconditioner.py b/pySDC/projects/parallelSDC/tests/test_preconditioner.py similarity index 100% rename from pySDC/tests/test_projects/test_parallelSDC/test_preconditioner.py rename to pySDC/projects/parallelSDC/tests/test_preconditioner.py diff --git a/pySDC/projects/parallelSDC/tests/test_preconditioner_MPI.py b/pySDC/projects/parallelSDC/tests/test_preconditioner_MPI.py new file mode 100644 index 0000000000..9e0a72aabe --- /dev/null +++ b/pySDC/projects/parallelSDC/tests/test_preconditioner_MPI.py @@ -0,0 +1,25 @@ +import os +import subprocess +import pytest + + +@pytest.mark.slow +@pytest.mark.mpi4py +@pytest.mark.timeout(0) +@pytest.mark.parametrize('num_procs', [3, 5]) +def test_preconditioner_playground_MPI(num_procs): + # Set python path once + my_env = os.environ.copy() + my_env['PYTHONPATH'] = '../../..:.' + my_env['COVERAGE_PROCESS_START'] = 'pyproject.toml' + cwd = '.' + cmd = ( + 'mpirun -np ' + str(num_procs) + ' python pySDC/projects/parallelSDC/preconditioner_playground_MPI.py' + ).split() + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=my_env, cwd=cwd) + p.wait() + for line in p.stdout: + print(line) + for line in p.stderr: + print(line) + assert p.returncode == 0, 'ERROR: did not get return code 0, got %s with %2i processes' % (p.returncode, num_procs) diff --git a/pySDC/projects/parallelSDC_reloaded/environment.yml b/pySDC/projects/parallelSDC_reloaded/environment.yml new file mode 100644 index 0000000000..b0c4bd2123 --- /dev/null +++ b/pySDC/projects/parallelSDC_reloaded/environment.yml @@ -0,0 +1,9 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - numpy + - matplotlib>=3.0 + - dill>=0.2.6 + - scipy>=0.17.1 diff --git a/pySDC/tests/test_projects/test_second_orderSDC/__init__.py b/pySDC/projects/parallelSDC_reloaded/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/test_second_orderSDC/__init__.py rename to pySDC/projects/parallelSDC_reloaded/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_parallelSDC_reloaded.py b/pySDC/projects/parallelSDC_reloaded/tests/test_parallelSDC_reloaded.py similarity index 100% rename from pySDC/tests/test_projects/test_parallelSDC_reloaded.py rename to pySDC/projects/parallelSDC_reloaded/tests/test_parallelSDC_reloaded.py diff --git a/pySDC/projects/soft_failure/environment.yml b/pySDC/projects/soft_failure/environment.yml new file mode 100644 index 0000000000..d9f0172d84 --- /dev/null +++ b/pySDC/projects/soft_failure/environment.yml @@ -0,0 +1,9 @@ +name: pySDC +channels: + - conda-forge + - defaults +dependencies: + - dill>=0.2.6 + - numpy + - scipy>=0.17.1 + - matplotlib>=3.0 diff --git a/pySDC/tests/test_projects/test_soft_failure/__init__.py b/pySDC/projects/soft_failure/tests/__init__.py similarity index 100% rename from pySDC/tests/test_projects/test_soft_failure/__init__.py rename to pySDC/projects/soft_failure/tests/__init__.py diff --git a/pySDC/tests/test_projects/test_soft_failure/test_generate_statistics.py b/pySDC/projects/soft_failure/tests/test_generate_statistics.py similarity index 100% rename from pySDC/tests/test_projects/test_soft_failure/test_generate_statistics.py rename to pySDC/projects/soft_failure/tests/test_generate_statistics.py diff --git a/pySDC/tests/test_projects/test_parallelSDC/test_preconditioner_MPI.py b/pySDC/tests/test_projects/test_parallelSDC/test_preconditioner_MPI.py deleted file mode 100644 index 80582825a0..0000000000 --- a/pySDC/tests/test_projects/test_parallelSDC/test_preconditioner_MPI.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import subprocess -import pytest - - -@pytest.mark.slow -@pytest.mark.mpi4py -@pytest.mark.timeout(0) -def test_preconditioner_playground_MPI_5(): - # Set python path once - my_env = os.environ.copy() - my_env['PYTHONPATH'] = '../../..:.' - my_env['COVERAGE_PROCESS_START'] = 'pyproject.toml' - cwd = '.' - num_procs = 5 - cmd = ( - 'mpirun -np ' + str(num_procs) + ' python pySDC/projects/parallelSDC/preconditioner_playground_MPI.py' - ).split() - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=my_env, cwd=cwd) - p.wait() - for line in p.stdout: - print(line) - for line in p.stderr: - print(line) - assert p.returncode == 0, 'ERROR: did not get return code 0, got %s with %2i processes' % (p.returncode, num_procs) - - -@pytest.mark.slow -@pytest.mark.mpi4py -@pytest.mark.timeout(0) -def test_preconditioner_playground_MPI_3(): - # Set python path once - my_env = os.environ.copy() - my_env['PYTHONPATH'] = '../../..:.' - my_env['COVERAGE_PROCESS_START'] = 'pyproject.toml' - cwd = '.' - num_procs = 3 - cmd = ( - 'mpirun -np ' + str(num_procs) + ' python pySDC/projects/parallelSDC/preconditioner_playground_MPI.py' - ).split() - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=my_env, cwd=cwd) - p.wait() - for line in p.stdout: - print(line) - for line in p.stderr: - print(line) - assert p.returncode == 0, 'ERROR: did not get return code 0, got %s with %2i processes' % (p.returncode, num_procs) diff --git a/pyproject.toml b/pyproject.toml index 37f2be3aad..d347fe28ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,7 +94,7 @@ skip-string-normalization = true exclude = '''playgrounds/''' [tool.coverage.run] -omit = ['*/pySDC/tests/*', '*/data/*', '*/pySDC/playgrounds/*', '*/pySDC/projects/deprecated/*'] +omit = ['*/pySDC/tests/*', '*/data/*', '*/pySDC/playgrounds/*', '*/pySDC/projects/deprecated/*', '*/pySDC/projects/*/tests/*'] relative_files = true concurrency = ['multiprocessing'] source = ['pySDC']