From 76ae917e55d1959eca47e40aa6ef237a25b7291b Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Wed, 4 Sep 2024 16:01:44 +0200 Subject: [PATCH 01/23] Allow numpy 2 for pyprecice>=3.1.1 (#218) * Update pyproject.toml * Update setup.py * Update package.py --- pyproject.toml | 2 +- setup.py | 2 +- spack/repo/packages/py-pyprecice/package.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6f8c358a..f4efd4da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] # PEP 518 - minimum build system requirements -requires = ["setuptools>=61,<72", "wheel", "Cython>=0.29", "packaging", "pip>=19.0.0", "numpy<2", "mpi4py", "pkgconfig"] \ No newline at end of file +requires = ["setuptools>=61,<72", "wheel", "Cython>=0.29", "packaging", "pip>=19.0.0", "numpy", "mpi4py", "pkgconfig"] diff --git a/setup.py b/setup.py index 2adf7a44..c4c50541 100644 --- a/setup.py +++ b/setup.py @@ -137,7 +137,7 @@ def initialize_options(self): author_email='info@precice.org', license='LGPL-3.0', python_requires='>=3', - install_requires=['numpy<2', 'mpi4py', 'Cython'], + install_requires=['numpy', 'mpi4py', 'Cython'], # mpi4py is only needed, if preCICE was compiled with MPI # see https://github.com/precice/python-bindings/issues/8 packages=['precice'], diff --git a/spack/repo/packages/py-pyprecice/package.py b/spack/repo/packages/py-pyprecice/package.py index 7ee79d6e..f6c31915 100644 --- a/spack/repo/packages/py-pyprecice/package.py +++ b/spack/repo/packages/py-pyprecice/package.py @@ -59,7 +59,8 @@ class PyPyprecice(PythonPackage): depends_on("python@3:", type=("build", "link", "run")) depends_on("py-setuptools@61:71", type="build") - depends_on("py-numpy@:1", type=("build", "link", "run")) + depends_on("py-numpy", type=("build", "link", "run"), when="@3.1.1:") + depends_on("py-numpy@:1", type=("build", "link", "run"), when="@:3.1.1") depends_on("py-mpi4py", type=("build", "run")) depends_on("py-cython@0.29:", type="build") depends_on("py-packaging", type="build") From dc7e520fca9af81fe56f57f3e291a195722c046b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Wed, 23 Oct 2024 13:42:51 +0200 Subject: [PATCH 02/23] Improve install error messages (#223) * Add useful error on pkg-config failure * Disable NumPy warning --- setup.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c4c50541..53c8f75b 100644 --- a/setup.py +++ b/setup.py @@ -58,6 +58,15 @@ def get_extensions(is_test): bindings_sources = [os.path.join(PYTHON_BINDINGS_PATH, "cyprecice", "cyprecice" + ".pyx")] + if not pkgconfig.exists('libprecice'): + raise Exception("\n".join([ + "pkg-config was unable to find libprecice.", + "Please make sure that preCICE was installed correctly and pkg-config is able to find it.", + "You may need to set PKG_CONFIG_PATH to include the location of the libprecice.pc file.", + "Use \"pkg-config --modversion libprecice\" for debugging."])) + + print("Found preCICE version " + pkgconfig.modversion('libprecice')) + compile_args += pkgconfig.cflags('libprecice').split() if not is_test: @@ -74,7 +83,8 @@ def get_extensions(is_test): language="c++", include_dirs=include_dirs, extra_compile_args=compile_args, - extra_link_args=link_args + extra_link_args=link_args, + define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")] ) ] From 2cb1feeb22ccc27fe0233d37346acab4734c3967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Mon, 4 Nov 2024 17:35:22 +0100 Subject: [PATCH 03/23] Remove spack testing (#221) * Remove spack testing * Fix indentation * Remove leading spaces --- .github/workflows/build-and-test.yml | 51 +------------ .github/workflows/build-env.yml | 28 -------- .github/workflows/build-spack.yml | 35 --------- changelog-entries/221.md | 1 + docs/ReleaseGuide.md | 62 ++++++++-------- spack/README.md | 65 ----------------- spack/ci-spack-pyprecice-deps-2404.dockerfile | 11 --- spack/repo/packages/py-pyprecice/package.py | 72 ------------------- spack/repo/repo.yaml | 2 - 9 files changed, 34 insertions(+), 293 deletions(-) delete mode 100644 .github/workflows/build-env.yml delete mode 100644 .github/workflows/build-spack.yml create mode 100644 changelog-entries/221.md delete mode 100644 spack/README.md delete mode 100644 spack/ci-spack-pyprecice-deps-2404.dockerfile delete mode 100644 spack/repo/packages/py-pyprecice/package.py delete mode 100644 spack/repo/repo.yaml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3e6a4f51..f5073a07 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -8,31 +8,6 @@ on: - "*" jobs: - setup_for_spack: - name: Run setup.py phases needed by spack - needs: [setup_test] - runs-on: ubuntu-latest - container: - image: precice/precice:develop - options: --user root - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Install & upgrade pip3 - run: | - apt-get -yy update - apt-get install -y python3-pip pkg-config - rm -rf /var/lib/apt/lists/* - pip3 install --upgrade --user pip - - name: Install dependencies - run: | - pip3 install --user toml - python3 -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | pip3 install -r /dev/stdin - - name: Run setup.py phases needed by spack - run: | - python3 setup.py install_lib - python3 setup.py build_ext - setup_install: name: Run setup install runs-on: ubuntu-latest @@ -59,30 +34,6 @@ jobs: export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH python3 -c "import precice" - setup_install_single_version_externally_managed: - name: Run setup install --single-version-externally-managed (for spack) - needs: [setup_install] - runs-on: ubuntu-latest - container: - image: precice/precice:develop - options: --user root - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Install pip3, pkgconfig and upgrade pip3 - run: | - su root - apt-get -yy update - apt-get install -y python3-pip pkg-config - rm -rf /var/lib/apt/lists/* - pip3 install --upgrade --user pip - - name: Install dependencies - run: | - pip3 install --user toml - python3 -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | pip3 install -r /dev/stdin - - name: Run setup install --single-version-externally-managed - run: python3 setup.py install --single-version-externally-managed --root=/ - setup_test: name: Run setup test runs-on: ubuntu-latest @@ -144,7 +95,7 @@ jobs: solverdummy_test: name: Run solverdummy - needs: [setup_install, setup_test] + needs: [pip_install] runs-on: ubuntu-latest container: image: precice/precice:develop diff --git a/.github/workflows/build-env.yml b/.github/workflows/build-env.yml deleted file mode 100644 index cf44d754..00000000 --- a/.github/workflows/build-env.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Update build environment - -on: - workflow_dispatch: # Trigger by hand from the UI - schedule: - - cron: '0 0 * * 0' # Schedule it every Sunday - -jobs: - build-spack-pyprecice-deps: - name: Builds the baseimage for spack providing dependencies - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Set up Docker - uses: docker/setup-buildx-action@v1 - - name: Login to registry - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v2 - with: - push: true - context: . - file: spack/ci-spack-pyprecice-deps-2404.dockerfile - tags: precice/ci-spack-pyprecice-deps-2404 diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml deleted file mode 100644 index 8ff0b6cb..00000000 --- a/.github/workflows/build-spack.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build Spack -on: - push: - branches: - - "*" - pull_request: - branches: - - "*" - schedule: - - cron: '0 4 * * 1' # Schedule it every Sunday - -jobs: - build_spack: - name: build_spack - runs-on: ubuntu-latest - timeout-minutes: 15 - container: precice/ci-spack-pyprecice-deps-2404 - defaults: - run: - shell: "bash --login -eo pipefail {0}" - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Move Package Script - run: | - cp -r spack/repo/packages/py-pyprecice/ /py-pyprecice-repo/packages/ - - name: Try to build py-pyprecice@develop with spack and test it - run: | - . /opt/spack/share/spack/setup-env.sh - spack env activate ci && spack arch - spack remove py-pyprecice - spack add pyprecice.test.py-pyprecice@develop && spack develop pyprecice.test.py-pyprecice@develop - spack install && spack find - spack load py-pyprecice - BINDINGS_VERSION=$(python3 -c "import precice; print(precice.__version__)") && echo "Installed version of bindings is ${BINDINGS_VERSION}" \ No newline at end of file diff --git a/changelog-entries/221.md b/changelog-entries/221.md new file mode 100644 index 00000000..9475acc6 --- /dev/null +++ b/changelog-entries/221.md @@ -0,0 +1 @@ +* Removed testing of spack package diff --git a/docs/ReleaseGuide.md b/docs/ReleaseGuide.md index 5e9aa226..7006ff15 100644 --- a/docs/ReleaseGuide.md +++ b/docs/ReleaseGuide.md @@ -13,50 +13,52 @@ The release of the `python-bindings` repository is made directly from a release * `CHANGELOG.md` on `python-bindings-v2.1.1.1`. * There is no need to bump the version anywhere else, since we use the [python-versioneer](https://github.com/python-versioneer/python-versioneer/) for maintaining the version everywhere else. -4. [Draft a New Release](https://github.com/precice/python-bindings/releases/new) in the `Releases` section of the repository page in a web browser. +4. *Optional* test the [py-pyprecice Spack package](https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/py-pyprecice/package.py) using `spack dev-build py-pyprecice@develop`. + +5. [Draft a New Release](https://github.com/precice/python-bindings/releases/new) in the `Releases` section of the repository page in a web browser. * The release tag needs to be the exact version number (i.e.`v2.1.1.1` or `v2.1.1.1rc1`, compare to [existing tags](https://github.com/precice/python-bindings/tags)). * If this is a stable release, use `@target:master`. If this is a pre-release, use `@target:python-bindings-v2.1.1.1`. If you are making a pre-release, **directly skip to the [pre-release](#pre-release) section below**. * Release title is also the version number (i.e. `v2.1.1.1` or `v2.1.1.1rc1`, compare to [existing releases](https://github.com/precice/python-bindings/tags)). -5. As soon as one approving review is made, merge the release PR (from `python-bindings-v2.1.1.1`) into `master`. - -6. Merge `master` into `develop` for synchronization of `develop`. - -7. If everything is in order up to this point then the new version can be released by hitting the "Publish release" button in your release Draft. This will create the corresponding tag and trigger [publishing the release to PyPI](https://github.com/precice/python-bindings/actions?query=workflow%3A%22Upload+Python+Package%22). - -8. Now there exists be a tag corresponding to the release on `master`. Re-run the [docker release workflow `build-docker.yml` via dispatch]([https://github.com/precice/fenics-adapter/actions/workflows/build-docker.yml](https://github.com/precice/python-bindings/actions/workflows/build-docker.yml)) such that the correct version is picked up by `versioneer`. Check the version in the container via `docker pull precice/python-bindings`, then `docker run -ti precice/python-bindings`, and inside the container `$ python3 -c "import precice; print(precice.__version__)"`. ⚠️ There is an open issue that needs fixing https://github.com/precice/python-bindings/issues/195 ⚠️ - -9. Add an empty commit (details https://github.com/precice/python-bindings/issues/109) on master by running the steps: +6. As soon as one approving review is made, merge the release PR (from `python-bindings-v2.1.1.1`) into `master`. - ```bash - git checkout master - git commit --allow-empty -m "post-tag bump" - git push - ``` +7. Merge `master` into `develop` for synchronization of `develop`. - Check that everything is in order via `git log`. Important: The `tag` and `origin/master` should not point to the same commit. For example: +8. If everything is in order up to this point then the new version can be released by hitting the "Publish release" button in your release Draft. This will create the corresponding tag and trigger [publishing the release to PyPI](https://github.com/precice/python-bindings/actions?query=workflow%3A%22Upload+Python+Package%22). - ```bash - commit 44b715dde4e3194fa69e61045089ca4ec6925fe3 (HEAD -> master, origin/master) - Author: Benjamin Rodenberg - Date: Wed Oct 20 10:52:41 2021 +0200 +9. Now there exists be a tag corresponding to the release on `master`. Re-run the [docker release workflow `build-docker.yml` via dispatch]([https://github.com/precice/fenics-adapter/actions/workflows/build-docker.yml](https://github.com/precice/python-bindings/actions/workflows/build-docker.yml)) such that the correct version is picked up by `versioneer`. Check the version in the container via `docker pull precice/python-bindings`, then `docker run -ti precice/python-bindings`, and inside the container `$ python3 -c "import precice; print(precice.__version__)"`. ⚠️ There is an open issue that needs fixing https://github.com/precice/python-bindings/issues/195 ⚠️ - post-tag bump +10. Add an empty commit (details https://github.com/precice/python-bindings/issues/109) on master by running the steps: - commit d2645cc51f84ad5eda43b9c673400aada8e1505a (tag: v2.3.0.1) - Merge: 2039557 aca2354 - Author: Benjamin Rodenberg - Date: Tue Oct 19 12:57:24 2021 +0200 + ```bash + git checkout master + git commit --allow-empty -m "post-tag bump" + git push + ``` - Merge pull request #132 from precice/python-bindings-v2.3.0.1 + Check that everything is in order via `git log`. Important: The `tag` and `origin/master` should not point to the same commit. For example: - Release v2.3.0.1 - ``` + ```bash + commit 44b715dde4e3194fa69e61045089ca4ec6925fe3 (HEAD -> master, origin/master) + Author: Benjamin Rodenberg + Date: Wed Oct 20 10:52:41 2021 +0200 + + post-tag bump + + commit d2645cc51f84ad5eda43b9c673400aada8e1505a (tag: v2.3.0.1) + Merge: 2039557 aca2354 + Author: Benjamin Rodenberg + Date: Tue Oct 19 12:57:24 2021 +0200 + + Merge pull request #132 from precice/python-bindings-v2.3.0.1 + + Release v2.3.0.1 + ``` - For more details refer to https://github.com/precice/python-bindings/issues/109 and https://github.com/python-versioneer/python-versioneer/issues/217. + For more details refer to https://github.com/precice/python-bindings/issues/109 and https://github.com/python-versioneer/python-versioneer/issues/217. -10. *Temporarily not maintained* Update Spack package (refer to `python-bindings/spack/README.md`). +11. *Temporarily not maintained* Update the [py-pyprecice Spack package](https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/py-pyprecice/package.py). ## Pre-release diff --git a/spack/README.md b/spack/README.md deleted file mode 100644 index a8f92f4c..00000000 --- a/spack/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# Spack package: py-pyprecice - -The Spack package `py-pyprecice` provides the python bindings via Spack and was submitted via [pull request 19558](https://github.com/spack/spack/pull/19558) in the Spack repository. This folder contains the Spack package script that can be used for testing whether the Spack installation works. - -## Docker image `precice/ci-spack-pyprecice-deps-2404` - -The workflow `build-spack-pyprecice-deps` in `.github/workflows/build-env.yml` creates the image `precice/ci-spack-pyprecice-deps-2404`. This image contains all dependencies of `py-pyprecice@develop`. - -The workflow `build_spack` in `.github/workflows/build-spack.yml` uses the image `precice/ci-spack-pyprecice-deps-2404` to reduce build time. The workflow uses the `package.py` from this repository to build the latest version of the bindings and run a small test on this version. - -## When a new Spack release is necessary - -* Add checksum of newest version(s) to the [package recipe in `package.py`](https://github.com/precice/python-bindings/blob/develop/spack/repo/packages/py-pyprecice/package.py). You can get checksum for any released version by running `spack checksum py-pyprecice`. -* Check whether the new release works locally. You can add the Spack repo in this repository and do the following: - - 1. Add the repository to your Spack installation if you have not done that before. You can check the repositories available with your Spack installation via `spack repo list`. If there is a repository called `pyprecice.test`, check whether it points to the correct path. The correct path is the `spack/repo` directory of python-bindings repository. If the repository is missing, add it via - - ```text - spack repo add ${REPOSITORY_ROOT}/spack/repo - ``` - - 2. Build the new python bindings. Usually, we use a new Spack environment. This is created and loaded via - - ```text - spack env create pyprecicetest-VERSIONNUMBER - spack env activate -p pyprecicetest-VERSIONNUMBER - ``` - - Note that the dots `.` of the version number are not allowed in the name of Spack environments. One could, e.g., create an environment named `pyprecicetest-2_0_0_1` instead of `pyprecicetest-2.0.0.1`. - - 3. We add the `py-pyprecice` package from our repository to the environment via - - ```text - spack add pyprecice.test.py-pyprecice@VERSIONNUMBER - ``` - - This ensures that one uses the local repository which has the namespace `pyprecice.test` when installing `py-precice`. Note that when speciying the `VERSIONNUMBER` you use the actual version number with dots, e.g., `2.0.0.1`, but you have to drop the `v` character from the versioning of the bindings. - - 4. Concretize the software packages - - ```text - spack concretize -f - ``` - - and check whether everything looks good. You might want to edit the environment of the Spack environment (the `spack.yaml` file) and enforce combined concretization by adding `concretization: together` at the end of the file. You might want to double check whether the correct repository is used by calling - - ```text - spack spec -N py-pyprecice@VERSIONNUMBER - ``` - - It will print the concretization and prefixes each packages with the repository it will be installed from. - - 5. Run `spack install` to actually install the package. - - 6. If the installation went through, check the installation by running `python3 -c "import precice; print(precice.__version__)"`. This should print the version number of the Python bindings you have installed. *Note*: In order to make the bindings available one might have to reload the environment via - - ```text - despacktivate - spack env activate -p pyprecicetest-VERSIONNUMBER - ``` - - 7. Ideally one runs the solverdummy with the freshly installed Python bindings. - -* Use `package.py` together with the patches provided in `python-bindings/spack/repo/packages/py-pyprecice` to [create a pull request for Spack](https://github.com/spack/spack/compare) and submit the new release. -* After the pull request in the Spack repository is merged, merge the current package configuration into the repository of the Python bindings if necessery. diff --git a/spack/ci-spack-pyprecice-deps-2404.dockerfile b/spack/ci-spack-pyprecice-deps-2404.dockerfile deleted file mode 100644 index 13051242..00000000 --- a/spack/ci-spack-pyprecice-deps-2404.dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Build stage with Spack pre-installed and ready to be used -FROM spack/ubuntu-noble:latest - -# Mount the current sources into the build container -# and build the default environment -ADD ./spack/repo /py-pyprecice-repo -RUN spack --color=always env create --without-view ci && \ - spack --color=always -e ci repo add /py-pyprecice-repo && \ - spack --color=always -e ci add pyprecice.test.py-pyprecice@develop target=x86_64 && \ - spack --color=always -e ci install --fail-fast --only=dependencies && \ - spack --color=always clean -a diff --git a/spack/repo/packages/py-pyprecice/package.py b/spack/repo/packages/py-pyprecice/package.py deleted file mode 100644 index f6c31915..00000000 --- a/spack/repo/packages/py-pyprecice/package.py +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack.package import * - - -class PyPyprecice(PythonPackage): - """ - This package provides python language bindings for the - C++ library preCICE. - """ - - homepage = "https://precice.org" - git = "https://github.com/precice/python-bindings.git" - url = "https://github.com/precice/python-bindings/archive/v3.1.1.tar.gz" - maintainers("ajaust", "BenjaminRodenberg", "IshaanDesai") - - # Always prefer final version of release candidate - version("develop", branch="develop") - version("3.1.1", sha256="50a0f1cbdb8fc362c22d316151c0e757958ff136a094e63b9b82d045d01d19c7") - version("3.1.0", sha256="8d9bd9e28859001ab503a1e2f90e54b3c000079f04c14dc7c0c04c61c5666641") - version("3.0.0.0", sha256="7e2c4b106a231b0df2a430d86d4a7b295f85adbe3478c425f863d1a4bebee9f7") - version("2.5.0.4", sha256="7f9449573eb52ce48ca3f0ab35529ea0064942487842515ae0a2c9299aa0f0db") - version("2.5.0.3", sha256="b983229b9fdf6bd4605ae8710985eb681025f6fb28ad8d7736cdf92593eef6df") - version("2.5.0.2", sha256="6d7b78da830db6c5133b44617196ee90be8c7d6c8e14c8994a4800b3d4856416") - version("2.5.0.1", sha256="d7c666e6ebff9e007c3703d8e3c3fcdf0f45289e36c2c17223b3aedc3259ab6c") - version("2.5.0.0", sha256="9f55a22594bb602cde8a5987217728569f16d9576ea53ed00497e9046a2e1794") - version("2.4.0.0", sha256="e80d16417b8ce1fdac80c988cb18ae1e16f785c5eb1035934d8b37ac18945242") - version("2.3.0.1", sha256="ed4e48729b662680beaa4ee2a9aff724a79e760534c6c58181be739988da2789") - version("2.2.1.1", sha256="139bac5077c3807e1b7b83d8d0da5ca0fc8c17393fd0df4bc5999cd63a351b78") - version("2.2.0.2", sha256="2287185f9ad7500dced53459543d27bb66bd2438c2e4bf81ee3317e6a00513d5") - version("2.2.0.1", sha256="229625e2e6df03987ababce5abe2021b0974cbe5a588b936a9cba653f4908d4b") - version("2.1.1.2", sha256="363eb3eeccf964fd5ee87012c1032353dd1518662868f2b51f04a6d8a7154045") - version("2.1.1.1", sha256="972f574549344b6155a8dd415b6d82512e00fa154ca25ae7e36b68d4d2ed2cf4") - version("2.1.0.1", sha256="ac5cb7412c6b96b08a04fa86ea38e52d91ea739a3bd1c209baa93a8275e4e01a") - version("2.0.2.1", sha256="c6fca26332316de041f559aecbf23122a85d6348baa5d3252be4ddcd5e94c09a") - version("2.0.1.1", sha256="2791e7c7e2b04bc918f09f3dfca2d3371e6f8cbb7e57c82bd674703f4fa00be7") - version("2.0.0.2", sha256="5f055d809d65ec2e81f4d001812a250f50418de59990b47d6bcb12b88da5f5d7") - version("2.0.0.1", sha256="96eafdf421ec61ad6fcf0ab1d3cf210831a815272984c470b2aea57d4d0c9e0e") - - for ver in [ - "develop", - "3.1", # only consider major.minor from 3.1.0. See https://github.com/precice/python-bindings/pull/199 - "3.0.0", - "2.5.0", - "2.4.0", - "2.3.0", - "2.2.1", - "2.2.0", - "2.1.1", - "2.1.0", - "2.0.2", - "2.0.1", - "2.0.0", - ]: - depends_on("precice@" + ver, when="@" + ver) - - depends_on("python@3:", type=("build", "link", "run")) - depends_on("py-setuptools@61:71", type="build") - depends_on("py-numpy", type=("build", "link", "run"), when="@3.1.1:") - depends_on("py-numpy@:1", type=("build", "link", "run"), when="@:3.1.1") - depends_on("py-mpi4py", type=("build", "run")) - depends_on("py-cython@0.29:", type="build") - depends_on("py-packaging", type="build") - depends_on("py-pip@19.0.0:", type="build") - depends_on("py-pkgconfig", type="build", when="@2.5:") - - @when("@:2.1") - def patch(self): - filter_file("distutils.command.install", "setuptools.command.install", "setup.py") diff --git a/spack/repo/repo.yaml b/spack/repo/repo.yaml deleted file mode 100644 index e484875a..00000000 --- a/spack/repo/repo.yaml +++ /dev/null @@ -1,2 +0,0 @@ -repo: - namespace: 'pyprecice.test' From b6b9ee596109981fea7b15744a594ab82b5ec358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Mon, 4 Nov 2024 17:41:10 +0100 Subject: [PATCH 04/23] Use precice nightly in ci --- .github/workflows/build-and-test.yml | 6 +++--- .github/workflows/run-solverdummy.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index f5073a07..51ce6174 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -12,7 +12,7 @@ jobs: name: Run setup install runs-on: ubuntu-latest container: - image: precice/precice:develop + image: precice/precice:nightly options: --user root steps: - name: Checkout Repository @@ -75,7 +75,7 @@ jobs: needs: [setup_test] runs-on: ubuntu-latest container: - image: precice/precice:develop + image: precice/precice:nightly options: --user root steps: - name: Checkout Repository @@ -98,7 +98,7 @@ jobs: needs: [pip_install] runs-on: ubuntu-latest container: - image: precice/precice:develop + image: precice/precice:nightly options: --user root steps: - name: Checkout Repository diff --git a/.github/workflows/run-solverdummy.yml b/.github/workflows/run-solverdummy.yml index 1704a108..fa03423a 100644 --- a/.github/workflows/run-solverdummy.yml +++ b/.github/workflows/run-solverdummy.yml @@ -11,7 +11,7 @@ jobs: name: Run solverdummies runs-on: ubuntu-latest container: - image: precice/precice:develop + image: precice/precice:nightly options: --user root steps: - name: Checkout Repository From 086a40beb80cb9f906b5887454819a22c5eb6d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Mon, 25 Nov 2024 10:10:34 +0100 Subject: [PATCH 05/23] Add API for runtime remeshing (#224) --- changelog-entries/224.md | 1 + cyprecice/Participant.pxd | 4 ++++ cyprecice/cyprecice.pyx | 36 ++++++++++++++++++++++++++++++++++++ test/Participant.cpp | 7 ++++++- test/test_bindings_module.py | 5 +++++ 5 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 changelog-entries/224.md diff --git a/changelog-entries/224.md b/changelog-entries/224.md new file mode 100644 index 00000000..088695ff --- /dev/null +++ b/changelog-entries/224.md @@ -0,0 +1 @@ +- Added API function `reset_mesh()` diff --git a/cyprecice/Participant.pxd b/cyprecice/Participant.pxd index ffe9783b..01614ce0 100644 --- a/cyprecice/Participant.pxd +++ b/cyprecice/Participant.pxd @@ -65,6 +65,10 @@ cdef extern from "precice/Participant.hpp" namespace "precice": void setMeshTetrahedra (const string& meshName, vector[int] vertices) + # remeshing + + void resetMesh (const string& meshName) + # data access void writeData (const string& meshName, const string& dataName, vector[int] vertices, vector[double] values) diff --git a/cyprecice/cyprecice.pyx b/cyprecice/cyprecice.pyx index 557e8f04..3349fead 100644 --- a/cyprecice/cyprecice.pyx +++ b/cyprecice/cyprecice.pyx @@ -710,6 +710,42 @@ cdef class Participant: self.thisptr.setMeshTetrahedra (convert(mesh_name), cpp_vertices) + # remeshing + + + def reset_mesh (self, mesh_name): + """ + Resets a mesh and allows setting it using set_mesh functions again. + + Parameters + ---------- + mesh_name : str + Name of the mesh to reset. + + Notes + ----- + This function is still experimental. + Please refer to the documentation on how to enable and use it. + + Previous calls: + advance() has been called + + Examples + -------- + Reset a mesh with 5 vertices to have 3 vertices. + + >>> positions = np.array([[1, 1], [2, 2], [3, 3], [4, 4], [5, 5]]) + >>> mesh_name = "MeshOne" + >>> vertex_ids = participant.set_mesh_vertices(mesh_name, positions) + >>> # later in the coupling loop + >>> if remeshing_required(): + >>> participant.reset_mesh(mesh_name) + >>> positions = np.array([[1, 1], [3, 3], [5, 5]]) + >>> vertex_ids = participant.set_mesh_vertices(mesh_name, positions) + """ + + self.thisptr.resetMesh (convert(mesh_name)) + # data access def write_data (self, mesh_name, data_name, vertex_ids, values): diff --git a/test/Participant.cpp b/test/Participant.cpp index 8a36f2af..74107e9c 100644 --- a/test/Participant.cpp +++ b/test/Participant.cpp @@ -237,6 +237,11 @@ void Participant::setMeshTetrahedra precice::span vertices) {} +void Participant::resetMesh +( + precice::string_view meshName) +{} + void Participant:: writeData ( precice::string_view meshName, @@ -320,4 +325,4 @@ std::string getVersionInformation() return fake_version; } -} // namespace precice \ No newline at end of file +} // namespace precice diff --git a/test/test_bindings_module.py b/test/test_bindings_module.py index a34c3983..1f081f67 100644 --- a/test/test_bindings_module.py +++ b/test/test_bindings_module.py @@ -43,6 +43,11 @@ def test_requires_mesh_connectivity_for(self): fake_mesh_name = "FakeMesh" self.assertEqual(fake_bool, participant.requires_mesh_connectivity_for(fake_mesh_name)) + def test_reset_mesh(self): + participant = precice.Participant("test", "dummy.xml", 0, 1) + fake_mesh_name = "FakeMesh" + participant.reset_mesh(fake_mesh_name) + def test_set_mesh_vertices(self): participant = precice.Participant("test", "dummy.xml", 0, 1) fake_mesh_name = "FakeMesh" # compare to test/SolverInterface.cpp, fake_mesh_name From 884b9841e57c4098ef0b606a511d8df68eedcc79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Mon, 25 Nov 2024 15:18:13 +0100 Subject: [PATCH 06/23] Use nightly instead of develop as a base. --- tools/releasing/packaging/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releasing/packaging/docker/Dockerfile b/tools/releasing/packaging/docker/Dockerfile index e53c459d..e3d6c3bf 100644 --- a/tools/releasing/packaging/docker/Dockerfile +++ b/tools/releasing/packaging/docker/Dockerfile @@ -1,5 +1,5 @@ # Dockerfile to build a ubuntu image containing the installed Debian package of a release -ARG PRECICE_TAG=develop +ARG PRECICE_TAG=nightly ARG from=precice/precice:${PRECICE_TAG} FROM $from From 8d852fe8ffa3c4145bd7b98daff9aa8e7f4ab56f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Mon, 25 Nov 2024 16:21:48 +0100 Subject: [PATCH 07/23] Use nightly for develop ref --- .github/workflows/build-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 37881853..f4b698de 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -31,7 +31,7 @@ jobs: - name: Set PRECICE_TAG and the TAG depending on branch shell: bash run: | - echo "PRECICE_TAG=${{ env.BINDINGS_REF }}" >> "$GITHUB_ENV" + echo "PRECICE_TAG=${{ env.BINDINGS_REF == 'develop' && 'nightly' || env.BINDINGS_REF }}" >> "$GITHUB_ENV" echo "TAG=${{ env.BINDINGS_REF }}" >> "$GITHUB_ENV" echo "Building TAG: ${{ env.BINDINGS_REF }}" - name: Checkout Repository From ced8a4225666fcbd2ee314190bd3c735ea958ffd Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Thu, 5 Dec 2024 13:00:09 +0100 Subject: [PATCH 08/23] Fix badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 92898c61..c86a0fac 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ⚠️ The latest version of the documentation for the python bindings can be found on [precice.org](https://precice.org/installation-bindings-python.html). The information from this `README` is currently under revision and will be moved ⚠️ -[![Upload Python Package](https://github.com/precice/python-bindings/workflows/Upload%20Python%20Package/badge.svg?branch=master)](https://pypi.org/project/pyprecice/) +[![Upload Python Package](https://github.com/precice/python-bindings/workflows/Upload%20Python%20Package/badge.svg)](https://pypi.org/project/pyprecice/) This package provides python language bindings for the C++ library [preCICE](https://github.com/precice/precice). Note that the first two digits of the version number of the bindings indicate the major and minor version of the preCICE version that the bindings support. The last digit represents the version of the bindings. Example: `v3.1.0` and `v3.1.1` of the bindings represent versions `0` and `1` of the bindings that are compatible with preCICE `v3.1.x`. Note that this versioning scheme was introduced from bindings `v3.1.0`, which is different than the [old versioning scheme](#old-versioning-scheme). From cae4297fc0b5dea67610de6e54882a351906c1e8 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Thu, 27 Feb 2025 10:46:08 +0100 Subject: [PATCH 09/23] Fix copying Should copy cpp not hpp --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 51ce6174..6c1930e9 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -55,7 +55,7 @@ jobs: mkdir -p precice cp precice-core/src/precice/Participant.hpp precice/Participant.hpp cp precice-core/src/precice/Tooling.hpp precice/Tooling.hpp - cp precice-core/src/precice/Tooling.hpp precice/Tooling.cpp + cp precice-core/src/precice/Tooling.cpp precice/Tooling.cpp cd precice-core mkdir build && cd build cmake .. -DPRECICE_FEATURE_MPI_COMMUNICATION=OFF -DPRECICE_FEATURE_PETSC_MAPPING=OFF -DPRECICE_FEATURE_PYTHON_ACTIONS=OFF -DBUILD_TESTING=OFF From 1cba0cffb9d595bda807660387ff09167e3dee6a Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Thu, 27 Feb 2025 15:02:35 +0100 Subject: [PATCH 10/23] Use `venv` for CI (#227) * Install into venv. * Update solverdummies to venv. * Install venv dependency. * Try different approach. * Permanently activate venv. * Remove unnecessary --user. --- .github/workflows/build-and-test.yml | 46 +++++++++++++++++++-------- .github/workflows/run-solverdummy.yml | 15 ++++++--- 2 files changed, 44 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 6c1930e9..799d9dc2 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -20,15 +20,21 @@ jobs: - name: Install pip3, pkgconfig and upgrade pip3 run: | apt-get -yy update - apt-get install -y python3-pip pkg-config + apt-get install -y python3-pip python3.12-venv pkg-config rm -rf /var/lib/apt/lists/* - pip3 install --upgrade --user pip + - name: Create venv + run: python3 -m venv .venv + - name: Activate venv + # see https://stackoverflow.com/a/74669486 + run: | + . .venv/bin/activate + echo PATH=$PATH >> $GITHUB_ENV - name: Install dependencies run: | - pip3 install --user toml + pip3 install toml python3 -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | pip3 install -r /dev/stdin - name: Run setup install - run: python3 setup.py install --user + run: python3 setup.py install - name: Test install run: | export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH @@ -80,15 +86,22 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 - - name: Install pip3, pkgconfig and upgrade pip3 + - name: Install dependencies run: | apt-get -yy update - apt-get install -y python3-pip pkg-config + apt-get install -y python3-pip python3.12-venv pkg-config rm -rf /var/lib/apt/lists/* - pip3 install --upgrade --user pip - - name: Run pip install - run: pip3 install --user . + - name: Create venv + run: | + python3 -m venv .venv + - name: Activate venv + # see https://stackoverflow.com/a/74669486 + run: | + . .venv/bin/activate + echo PATH=$PATH >> $GITHUB_ENV - name: Run pip install + run: pip3 install . + - name: Check import run: | export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH python3 -c "import precice" @@ -103,14 +116,21 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 - - name: Install pip3, pkgconfig and upgrade pip3 + - name: Install dependencies run: | apt-get -yy update - apt-get install -y python3-pip pkg-config + apt-get install -y python3-pip python3.12-venv pkg-config rm -rf /var/lib/apt/lists/* - pip3 install --upgrade --user pip + - name: Create venv + run: | + python3 -m venv .venv + - name: Activate venv + # see https://stackoverflow.com/a/74669486 + run: | + . .venv/bin/activate + echo PATH=$PATH >> $GITHUB_ENV - name: Run pip install - run: pip3 install --user . + run: pip3 install . - name: Run solverdummy run: | export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH diff --git a/.github/workflows/run-solverdummy.yml b/.github/workflows/run-solverdummy.yml index fa03423a..69b18094 100644 --- a/.github/workflows/run-solverdummy.yml +++ b/.github/workflows/run-solverdummy.yml @@ -19,14 +19,21 @@ jobs: - name: Install Dependencies run: | apt-get -qq update - apt-get -qq install software-properties-common python3-dev python3-pip git apt-utils pkg-config + apt-get -qq install software-properties-common python3-dev python3-pip python3.12-venv git apt-utils pkg-config rm -rf /var/lib/apt/lists/* - pip3 install --upgrade --user pip + - name: Create venv + run: | + python3 -m venv .venv + - name: Activate venv + # see https://stackoverflow.com/a/74669486 + run: | + . .venv/bin/activate + echo PATH=$PATH >> $GITHUB_ENV - name: Install bindings - run: pip3 install --user . + run: pip3 install . - name: Check whether preCICE was built with MPI # reformat version information as a dict and check whether preCICE was compiled with MPI run: python3 -c "import precice; assert({item.split('=')[0]:item.split('=')[-1] for item in str(precice.get_version_information()).split(';')}['PRECICE_FEATURE_MPI_COMMUNICATION']=='Y')" - name: Run solverdummies run: | cd examples/solverdummy/ - python3 solverdummy.py precice-config.xml SolverOne & python3 solverdummy.py precice-config.xml SolverTwo + python3 solverdummy.py precice-config.xml SolverOne & python3 solverdummy.py precice-config.xml SolverTwo \ No newline at end of file From b4b9fe1a9f1ff5d699292ad9b55b8976a1778de0 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Thu, 6 Mar 2025 18:04:06 +0100 Subject: [PATCH 11/23] Make consistent with precice/precice/CHANGELOG.md --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa26432a..932ab2a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,18 +2,18 @@ All notable changes to this project will be documented in this file. -## v3.1.2 +## 3.1.2 * Restrict to numpy < 2 for better compatibility with CI pipeline. https://github.com/precice/python-bindings/pull/213 * Require setuptools < 72 since support for the test command was removed in Setuptools 72. https://github.com/precice/python-bindings/pull/213 * Require setuptools >= 61 to guarantee that pyproject.toml is used https://github.com/precice/python-bindings/pull/207 * Fix CI pipeline for spack https://github.com/precice/python-bindings/pull/206 -## v3.1.1 +## 3.1.1 * Fix NumPy include order to not conflict with system NumPy and the one installed via pip https://github.com/precice/python-bindings/pull/204 -## v3.1.0 +## 3.1.0 * Change versioning scheme https://github.com/precice/python-bindings/pull/199 From 94edb1318c33ccfe6a72beb6735c197e81335cfa Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Fri, 14 Mar 2025 16:46:19 +0100 Subject: [PATCH 12/23] Add experimental profiling API (#226) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add experimental profiling API from precice/precice #1657 * Add examples to the profiling API docstrings * Add profiling API to mock * Add CHANGELOG entry --------- Co-authored-by: Frédéric Simonis --- changelog-entries/226.md | 1 + cyprecice/Participant.pxd | 5 +++++ cyprecice/cyprecice.pyx | 28 ++++++++++++++++++++++++++++ test/Participant.cpp | 9 +++++++++ 4 files changed, 43 insertions(+) create mode 100644 changelog-entries/226.md diff --git a/changelog-entries/226.md b/changelog-entries/226.md new file mode 100644 index 00000000..3fb64908 --- /dev/null +++ b/changelog-entries/226.md @@ -0,0 +1 @@ +- Added profiling API which was introduced in preCICE in https://github.com/precice/precice/pull/1657 diff --git a/cyprecice/Participant.pxd b/cyprecice/Participant.pxd index 01614ce0..65911eac 100644 --- a/cyprecice/Participant.pxd +++ b/cyprecice/Participant.pxd @@ -87,6 +87,11 @@ cdef extern from "precice/Participant.hpp" namespace "precice": void writeGradientData(const string& meshName, const string& dataName, vector[int] vertices, vector[double] gradientValues) + # Experimental profiling API + + void startProfilingSection(const string& eventName) + + void stopLastProfilingSection() cdef extern from "precice/Tooling.hpp" namespace "precice": string getVersionInformation() diff --git a/cyprecice/cyprecice.pyx b/cyprecice/cyprecice.pyx index 3349fead..f7a598d3 100644 --- a/cyprecice/cyprecice.pyx +++ b/cyprecice/cyprecice.pyx @@ -1080,6 +1080,34 @@ cdef class Participant: return np_ids, np_coordinates.reshape((size, dimensions)) + def start_profiling_section(self, event_name): + """ + Starts a profiling section with the given event name. + + Parameters + ---------- + event_name : str + Name of the event to profile. + + Examples + -------- + Start a profiling section with the event name "EventOne": + >>> event_name = "EventOne" + >>> participant.start_profiling_section(event_name) + """ + self.thisptr.startProfilingSection(convert(event_name)) + + def stop_last_profiling_section(self): + """ + Stops the last profiling section. + + Examples + -------- + Stop the last profiling section: + >>> participant.stop_last_profiling_section() + """ + self.thisptr.stopLastProfilingSection() + def get_version_information (): """ Returns diff --git a/test/Participant.cpp b/test/Participant.cpp index 74107e9c..03b4741e 100644 --- a/test/Participant.cpp +++ b/test/Participant.cpp @@ -320,6 +320,15 @@ void Participant::writeGradientData( } } +void Participant::startProfilingSection( + precice::string_view sectionName) +{ +} + +void Participant::stopLastProfilingSection() +{ +} + std::string getVersionInformation() { return fake_version; From bda82dba1d5395a5fa87a705dc49535326241865 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Mon, 17 Mar 2025 13:41:49 +0100 Subject: [PATCH 13/23] Use precice/precice.hpp header (#193) * Use precice/precice.hpp header * add get_version_information function into the Participant class * Pass self * Move getVersionInformation out of the class Participant * Add CHANGELOG entry --------- Co-authored-by: Benjamin Rodenberg --- changelog-entries/193.md | 1 + cyprecice/Participant.pxd | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog-entries/193.md diff --git a/changelog-entries/193.md b/changelog-entries/193.md new file mode 100644 index 00000000..fe3f753d --- /dev/null +++ b/changelog-entries/193.md @@ -0,0 +1 @@ +- Use the newer `precice/precice.hpp` header to access C++ API diff --git a/cyprecice/Participant.pxd b/cyprecice/Participant.pxd index 65911eac..2a55ea1c 100644 --- a/cyprecice/Participant.pxd +++ b/cyprecice/Participant.pxd @@ -3,7 +3,7 @@ from libcpp.set cimport set from libcpp.string cimport string from libcpp.vector cimport vector -cdef extern from "precice/Participant.hpp" namespace "precice": +cdef extern from "precice/precice.hpp" namespace "precice": cdef cppclass Participant: # construction and configuration From 3934ee0d746a6c0e73b79e7d2a1d0b5a5ecae8ae Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Mon, 17 Mar 2025 16:42:46 +0100 Subject: [PATCH 14/23] Remove Dockerfile and release workflow (#228) --- .github/workflows/build-docker.yml | 54 --------------------- CHANGELOG.md | 4 ++ tools/releasing/packaging/docker/Dockerfile | 28 ----------- 3 files changed, 4 insertions(+), 82 deletions(-) delete mode 100644 .github/workflows/build-docker.yml delete mode 100644 tools/releasing/packaging/docker/Dockerfile diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml deleted file mode 100644 index f4b698de..00000000 --- a/.github/workflows/build-docker.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Update docker image - -on: - workflow_dispatch: # Trigger by hand from the UI - inputs: - branch: - type: choice - description: branch to build the image from - options: - - develop - push: - branches: - - develop - - -jobs: - build-and-release-docker-image: - name: Builds a dockerimage with the python bindings of preCICE - runs-on: ubuntu-latest - env: - docker_username: precice - steps: - - name: Set branch name for manual triggering - if: github.event_name == 'workflow_dispatch' - shell: bash - run: echo "BINDINGS_REF=${{ inputs.branch }}" >> $GITHUB_ENV - - name: Set branch name for "on pull request" triggering - if: github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch' - shell: bash - run: echo "BINDINGS_REF=${{ github.ref_name }}" >> $GITHUB_ENV - - name: Set PRECICE_TAG and the TAG depending on branch - shell: bash - run: | - echo "PRECICE_TAG=${{ env.BINDINGS_REF == 'develop' && 'nightly' || env.BINDINGS_REF }}" >> "$GITHUB_ENV" - echo "TAG=${{ env.BINDINGS_REF }}" >> "$GITHUB_ENV" - echo "Building TAG: ${{ env.BINDINGS_REF }}" - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ env.docker_username }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push Dockerfile - uses: docker/build-push-action@v2 - with: - push: true - file: "./tools/releasing/packaging/docker/Dockerfile" - tags: ${{ env.docker_username }}/python-bindings:${{ env.TAG }} - build-args: | - PRECICE_TAG=${{ env.PRECICE_TAG }} - PYTHON_BINDINGS_REF=${{ env.BINDINGS_REF }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 932ab2a4..fb15f4e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## latest + +* Discontinued maintainment of Docker image `precice/python-bindings`. Python packages should be installed using virtual environments instead. Please refer to `README.md` for further information. https://github.com/precice/python-bindings/pull/228 + ## 3.1.2 * Restrict to numpy < 2 for better compatibility with CI pipeline. https://github.com/precice/python-bindings/pull/213 diff --git a/tools/releasing/packaging/docker/Dockerfile b/tools/releasing/packaging/docker/Dockerfile deleted file mode 100644 index e3d6c3bf..00000000 --- a/tools/releasing/packaging/docker/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -# Dockerfile to build a ubuntu image containing the installed Debian package of a release -ARG PRECICE_TAG=nightly -ARG from=precice/precice:${PRECICE_TAG} -FROM $from - -USER root -# Installing necessary dependencies -RUN apt-get -qq update && apt-get -qq install \ - apt-utils && \ - apt-get -qq install \ - software-properties-common \ - git \ - sudo \ - python3-dev \ - python3-pip \ - pkg-config && \ - rm -rf /var/lib/apt/lists/* - -USER precice - -# Upgrade pip to newest version (pip version from 18.04 apt-get is outdated) -RUN python3 -m pip install --user --upgrade pip - -# Rebuild image if force_rebuild after that command -ARG PYTHON_BINDINGS_REF=develop - -# Builds the precice python bindings for python3 -RUN pip3 install --user git+https://github.com/precice/python-bindings.git@${PYTHON_BINDINGS_REF} From a4a8c884c64108afffbe2ab0bc3e0c04b10a7003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Mon, 25 Nov 2024 10:36:57 +0100 Subject: [PATCH 15/23] Remove unused configure --- cyprecice/Participant.pxd | 2 -- 1 file changed, 2 deletions(-) diff --git a/cyprecice/Participant.pxd b/cyprecice/Participant.pxd index 2a55ea1c..3a189724 100644 --- a/cyprecice/Participant.pxd +++ b/cyprecice/Participant.pxd @@ -11,8 +11,6 @@ cdef extern from "precice/precice.hpp" namespace "precice": Participant (const string&, const string&, int, int, void*) except + - void configure (const string&) - # steering methods void initialize () From 938f81b70af91d2266ef6047e4d65dfbbfc62c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Mon, 25 Nov 2024 11:12:31 +0100 Subject: [PATCH 16/23] Remove const from member functions --- cyprecice/Participant.pxd | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cyprecice/Participant.pxd b/cyprecice/Participant.pxd index 3a189724..fbea8fa3 100644 --- a/cyprecice/Participant.pxd +++ b/cyprecice/Participant.pxd @@ -21,15 +21,15 @@ cdef extern from "precice/precice.hpp" namespace "precice": # status queries - int getMeshDimensions(const string& meshName) const + int getMeshDimensions(const string& meshName) - int getDataDimensions(const string& meshName, const string& dataName) const + int getDataDimensions(const string& meshName, const string& dataName) - bool isCouplingOngoing() const + bool isCouplingOngoing() - bool isTimeWindowComplete() const + bool isTimeWindowComplete() - double getMaxTimeStepSize() const + double getMaxTimeStepSize() bool requiresInitialData() @@ -39,11 +39,11 @@ cdef extern from "precice/precice.hpp" namespace "precice": # mesh access - bool requiresMeshConnectivityFor (const string& meshName) const + bool requiresMeshConnectivityFor (const string& meshName) int setMeshVertex (const string& meshName, vector[double] position) - int getMeshVertexSize (const string& meshName) const + int getMeshVertexSize (const string& meshName) void setMeshVertices (const string& meshName, vector[double] positions, vector[int]& ids) @@ -71,17 +71,17 @@ cdef extern from "precice/precice.hpp" namespace "precice": void writeData (const string& meshName, const string& dataName, vector[int] vertices, vector[double] values) - void readData (const string& meshName, const string& dataName, vector[int] vertices, const double relativeReadTime, vector[double]& values) const + void readData (const string& meshName, const string& dataName, vector[int] vertices, const double relativeReadTime, vector[double]& values) # direct access - void setMeshAccessRegion (const string& meshName, vector[double] boundingBox) const + void setMeshAccessRegion (const string& meshName, vector[double] boundingBox) - void getMeshVertexIDsAndCoordinates (const string& meshName, vector[int]& ids, vector[double]& coordinates) const + void getMeshVertexIDsAndCoordinates (const string& meshName, vector[int]& ids, vector[double]& coordinates) # Gradient related API - bool requiresGradientDataFor(const string& meshName, const string& dataName) const + bool requiresGradientDataFor(const string& meshName, const string& dataName) void writeGradientData(const string& meshName, const string& dataName, vector[int] vertices, vector[double] gradientValues) From aaa8b75532fb7e1bd047a2c11c6ef725dbe01392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Mon, 25 Nov 2024 11:22:25 +0100 Subject: [PATCH 17/23] Add except to throwing functions --- cyprecice/Participant.pxd | 46 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/cyprecice/Participant.pxd b/cyprecice/Participant.pxd index fbea8fa3..7e157f6a 100644 --- a/cyprecice/Participant.pxd +++ b/cyprecice/Participant.pxd @@ -13,17 +13,17 @@ cdef extern from "precice/precice.hpp" namespace "precice": # steering methods - void initialize () + void initialize () except + - void advance (double computedTimestepLength) + void advance (double computedTimestepLength) except + void finalize() # status queries - int getMeshDimensions(const string& meshName) + int getMeshDimensions(const string& meshName) except + - int getDataDimensions(const string& meshName, const string& dataName) + int getDataDimensions(const string& meshName, const string& dataName) except + bool isCouplingOngoing() @@ -39,51 +39,51 @@ cdef extern from "precice/precice.hpp" namespace "precice": # mesh access - bool requiresMeshConnectivityFor (const string& meshName) + bool requiresMeshConnectivityFor (const string& meshName) except + - int setMeshVertex (const string& meshName, vector[double] position) + int setMeshVertex (const string& meshName, vector[double] position) except + - int getMeshVertexSize (const string& meshName) + int getMeshVertexSize (const string& meshName) except + - void setMeshVertices (const string& meshName, vector[double] positions, vector[int]& ids) + void setMeshVertices (const string& meshName, vector[double] positions, vector[int]& ids) except + - void setMeshEdge (const string& meshName, int firstVertexID, int secondVertexID) + void setMeshEdge (const string& meshName, int firstVertexID, int secondVertexID) except + - void setMeshEdges (const string& meshName, vector[int] vertices) + void setMeshEdges (const string& meshName, vector[int] vertices) except + - void setMeshTriangle (const string& meshName, int firstVertexID, int secondVertexID, int thirdVertexID) + void setMeshTriangle (const string& meshName, int firstVertexID, int secondVertexID, int thirdVertexID) except + - void setMeshTriangles (const string& meshName, vector[int] vertices) + void setMeshTriangles (const string& meshName, vector[int] vertices) except + - void setMeshQuad (const string& meshName, int firstVertexID, int secondVertexID, int thirdVertexID, int fourthVertexID) + void setMeshQuad (const string& meshName, int firstVertexID, int secondVertexID, int thirdVertexID, int fourthVertexID) except + - void setMeshQuads (const string& meshName, vector[int] vertices) + void setMeshQuads (const string& meshName, vector[int] vertices) except + - void setMeshTetrahedron (const string& meshName, int firstVertexID, int secondVertexID, int thirdVertexID, int fourthVertexID) + void setMeshTetrahedron (const string& meshName, int firstVertexID, int secondVertexID, int thirdVertexID, int fourthVertexID) except + - void setMeshTetrahedra (const string& meshName, vector[int] vertices) + void setMeshTetrahedra (const string& meshName, vector[int] vertices) except + # remeshing - void resetMesh (const string& meshName) + void resetMesh (const string& meshName) except + # data access - void writeData (const string& meshName, const string& dataName, vector[int] vertices, vector[double] values) + void writeData (const string& meshName, const string& dataName, vector[int] vertices, vector[double] values) except + - void readData (const string& meshName, const string& dataName, vector[int] vertices, const double relativeReadTime, vector[double]& values) + void readData (const string& meshName, const string& dataName, vector[int] vertices, const double relativeReadTime, vector[double]& values) except + # direct access - void setMeshAccessRegion (const string& meshName, vector[double] boundingBox) + void setMeshAccessRegion (const string& meshName, vector[double] boundingBox) except + - void getMeshVertexIDsAndCoordinates (const string& meshName, vector[int]& ids, vector[double]& coordinates) + void getMeshVertexIDsAndCoordinates (const string& meshName, vector[int]& ids, vector[double]& coordinates) except + # Gradient related API - bool requiresGradientDataFor(const string& meshName, const string& dataName) + bool requiresGradientDataFor(const string& meshName, const string& dataName) except + - void writeGradientData(const string& meshName, const string& dataName, vector[int] vertices, vector[double] gradientValues) + void writeGradientData(const string& meshName, const string& dataName, vector[int] vertices, vector[double] gradientValues) except + # Experimental profiling API From ca40e08960077c4dd2b1c02ff817b2c8238cd37d Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Tue, 18 Mar 2025 13:42:32 +0100 Subject: [PATCH 18/23] Update installation instructions (#230) * Remove (some) deprecated commands and options * Mention venv --------- Co-authored-by: Ishaan Desai --- README.md | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c86a0fac..b2509839 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,23 @@ Please refer to [the preCICE documentation](https://www.precice.org/installation ## Installing the package -We recommend using pip3 (version 19.0.0 or newer required) for the sake of simplicity. You can check your pip3 version via `pip3 --version`. To update pip3, use the following line: +Generally, it is recommended to work in a virtual environment when using the preCICE Python bindings. For this purpose, you might have to run `apt install python3-venv` first. + +Create a virtual environment in your working directory by running: + +```bash +python3 -m venv .venv +``` + +Using `.venv` is a common choice as path of your virtual environment. But you can use any path here. Activate the virtual environment by running ```bash -$ pip3 install --user --upgrade pip +. .venv/bin/activate ``` -### Using pip3 +### Using pip + +We recommend using `pip` (version 19.0.0 or newer required). You can check your pip version via `pip --version`. #### preCICE system installs @@ -35,19 +45,19 @@ For system installs of preCICE, installation works out of the box. There are dif * (recommended) install [pyprecice from PyPI](https://pypi.org/project/pyprecice/) ```bash - $ pip3 install --user pyprecice + $ pip install pyprecice ``` * provide the link to this repository to pip (replace `` with the branch you want to use, preferably `master` or `develop`) ```bash - $ pip3 install --user https://github.com/precice/python-bindings/archive/.zip + $ pip install https://github.com/precice/python-bindings.git@ ``` * if you already cloned this repository, execute the following command from this directory: ```bash - $ pip3 install --user . + $ pip install . ``` *note the dot at the end of the line* @@ -65,14 +75,14 @@ The preCICE documentation provides more informaiton on [linking preCICE](https:/ You can also install the python language bindings for preCICE via Spack by installing the Spack package `py-pyprecice`. Refer to [our installation guide for preCICE via Spack](https://precice.org/installation-spack.html) for getting started with Spack. -### Using setup.py +### Using setup.py (deprecated) #### preCICE system installs In this directory, execute: ```bash -$ python3 setup.py install --user +$ python3 setup.py install ``` #### preCICE at custom location (setting PATHS) @@ -80,7 +90,7 @@ $ python3 setup.py install --user see above. Then run ```bash -$ python3 setup.py install --user +$ python3 setup.py install ``` #### preCICE at custom location (explicit include path, library path) @@ -88,7 +98,7 @@ $ python3 setup.py install --user 1. Install cython and other dependencies via pip3 ```bash - $ pip3 install --user setuptools wheel cython packaging numpy + $ pip3 install setuptools wheel cython packaging numpy ``` 2. Open terminal in this folder. @@ -110,7 +120,7 @@ $ python3 setup.py install --user 4. Install the bindings ```bash - $ python3 setup.py install --user + $ python3 setup.py install ``` 5. Clean-up *optional* From ca4da56ed02a792f4e8e5b2b9085ad74ca8368db Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 25 Mar 2025 07:40:32 +0100 Subject: [PATCH 19/23] Add API functions for Just-in-time mapping (#231) * Add API functions for Just-in-time mapping co-authored-by: Benjamin Rodenberg * Remove debugging leftovers Co-authored-by: Ishaan Desai --------- Co-authored-by: Benjamin Rodenberg Co-authored-by: Ishaan Desai --- cyprecice/Participant.pxd | 6 ++ cyprecice/cyprecice.pyx | 109 ++++++++++++++++++++++++++++++++++- test/Participant.cpp | 25 ++++++++ test/test_bindings_module.py | 8 +++ 4 files changed, 147 insertions(+), 1 deletion(-) diff --git a/cyprecice/Participant.pxd b/cyprecice/Participant.pxd index 7e157f6a..51bf9571 100644 --- a/cyprecice/Participant.pxd +++ b/cyprecice/Participant.pxd @@ -73,6 +73,12 @@ cdef extern from "precice/precice.hpp" namespace "precice": void readData (const string& meshName, const string& dataName, vector[int] vertices, const double relativeReadTime, vector[double]& values) except + + # Just-in-time mapping + + void writeAndMapData (const string& meshName, const string& dataName, vector[double] coordinates, vector[double] values) except + + + void mapAndReadData (const string& meshName, const string& dataName, vector[double] coordinates, double relativeReadTime, vector[double]& values) except + + # direct access void setMeshAccessRegion (const string& meshName, vector[double] boundingBox) except + diff --git a/cyprecice/cyprecice.pyx b/cyprecice/cyprecice.pyx index f7a598d3..c2519478 100644 --- a/cyprecice/cyprecice.pyx +++ b/cyprecice/cyprecice.pyx @@ -830,7 +830,7 @@ cdef class Participant: mesh_name : str Name of the mesh to write to. data_name : str - ID to read from. + Name of the data to read from. vertex_ids : array_like Indices of the vertices. relative_read_time : double @@ -903,6 +903,113 @@ cdef class Participant: else: return np_values.reshape((size, dimensions)) + def write_and_map_data (self, mesh_name, data_name, coordinates, values): + """ + This function writes values at temporary locations to data of a mesh. + As opposed to the writeData function using VertexIDs, this function allows to write data via coordinates, + which don't have to be specified during the initialization. This is particularly useful for meshes, which + vary over time. Note that using this function comes at a performance cost, since the specified mapping + needs to be computed locally for the given locations, whereas the other variant (writeData) can typically + exploit the static interface mesh and pre-compute data structures more efficiently. + + Values are passed identically to write_data. + + Parameters + ---------- + mesh_name : str + name of the mesh to write to. + data_name : str + Data name to write to. + coordinates : array_like + The coordinates of the vertices in a numpy array [N x D] where + N = number of vertices and D = dimensions of geometry. + values : array_like + Values of data + + Examples + -------- + Write scalar data for a 2D problem with 5 vertices: + >>> mesh_name = "MeshOne" + >>> data_name = "DataOne" + >>> coordinates = np.array([[c1_x, c1_y], [c2_x, c2_y], [c3_x, c3_y], [c4_x, c4_y], [c5_x, c5_y]]) + >>> values = np.array([v1, v2, v3, v4, v5]) + >>> participant.write_and_map_data(mesh_name, data_name, coordinates, values) + """ + + check_array_like(coordinates, "coordinates", "write_and_map_data") + check_array_like(values, "values", "write_and_map_data") + + if not isinstance(coordinates, np.ndarray): + coordinates = np.asarray(coordinates) + + if not isinstance(values, np.ndarray): + values = np.asarray(values) + + cdef vector[double] cpp_coordinates = coordinates.flatten() + cdef vector[double] cpp_values = values.flatten() + + self.thisptr.writeAndMapData (convert(mesh_name), convert(data_name), cpp_coordinates, cpp_values) + + def map_and_read_data (self, mesh_name, data_name, coordinates, relative_read_time): + """ + This function reads values at temporary locations from data of a mesh. + As opposed to the readData function using VertexIDs, this function allows reading data via coordinates, + which don't have to be specified during the initialization. This is particularly useful for meshes, which + vary over time. Note that using this function comes at a performance cost, since the specified mapping + needs to be computed locally for the given locations, whereas the other variant (readData) can typically + exploit the static interface mesh and pre-compute data structures more efficient. + + Values are read identically to read_data. + + Parameters + ---------- + mesh_name : str + Name of the mesh to write to. + data_name : str + Name of the data to read from. + coordinates : array_like + Coordinates of the vertices. + relative_read_time : double + Point in time where data is read relative to the beginning of the current time step + + Returns + ------- + values : numpy.ndarray + Contains the read data. + + Examples + -------- + Read scalar data for a 2D problem with 2 vertices: + >>> mesh_name = "MeshOne" + >>> data_name = "DataOne" + >>> coordinates = [(1.0, 1.0), (2.0, 2.0)] + >>> dt = 1.0 + >>> values = map_and_read_data(mesh_name, data_name, coordinates, dt) + >>> values.shape + >>> (2, ) + """ + + check_array_like(coordinates, "coordinates", "map_and_read_data") + + if not isinstance(coordinates, np.ndarray): + coordinates = np.asarray(coordinates) + + size = coordinates.shape[0] + dimensions = self.get_data_dimensions(mesh_name, data_name) + + cdef vector[double] cpp_coordinates = coordinates + cdef vector[double] cpp_values = [-1 for _ in range(size * dimensions)] + + self.thisptr.mapAndReadData (convert(mesh_name), convert(data_name), cpp_coordinates, relative_read_time, cpp_values) + + cdef np.ndarray[double, ndim=1] np_values = np.array(cpp_values, dtype=np.double) + + if len(coordinates) == 0: + return np_values.reshape((size)) + elif self.get_data_dimensions(mesh_name, data_name) == 1: + return np_values.reshape((size)) + else: + return np_values.reshape((size, dimensions)) def write_gradient_data (self, mesh_name, data_name, vertex_ids, gradients): """ diff --git a/test/Participant.cpp b/test/Participant.cpp index 03b4741e..819dc10f 100644 --- a/test/Participant.cpp +++ b/test/Participant.cpp @@ -278,6 +278,31 @@ void Participant:: readData } } +void Participant:: writeAndMapData +( + precice::string_view meshName, + precice::string_view dataName, + precice::span coordinates, + precice::span values) +{ + fake_read_write_buffer.clear(); + + for(const double value: values) { + fake_read_write_buffer.push_back(value); + } +} + +void Participant:: mapAndReadData +( + precice::string_view meshName, + precice::string_view dataName, + precice::span coordinates, + double relativeReadTime, + precice::span values) const +{ + std::copy(fake_read_write_buffer.begin(), fake_read_write_buffer.end(), values.begin()); +} + void Participant:: setMeshAccessRegion ( precice::string_view meshName, diff --git a/test/test_bindings_module.py b/test/test_bindings_module.py index 1f081f67..ee2287ee 100644 --- a/test/test_bindings_module.py +++ b/test/test_bindings_module.py @@ -320,6 +320,14 @@ def test_read_write_vector_data_non_contiguous(self): read_data = participant.read_data("FakeMesh", "FakeVectorData", [0], dt) self.assertTrue(np.array_equal(write_data, read_data)) + def test_jit_mapping(self): + participant = precice.Participant("test", "dummy.xml", 0, 1) + write_data = [1, 2, 3] + participant.write_and_map_data("FakeMesh", "FakeScalarData", [0, 1, 2], write_data) + dt = 1 + read_data = participant.map_and_read_data("FakeMesh", "FakeScalarData", [0, 1, 2], dt) + self.assertTrue(np.array_equal(write_data, read_data)) + def test_get_version_information(self): version_info = precice.get_version_information() fake_version_info = b"dummy" # compare to test/SolverInterface.cpp From ea72a3b69c59c46c64fbb66abbdefc91b7709802 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Tue, 25 Mar 2025 07:56:19 +0100 Subject: [PATCH 20/23] Add CHANGELOG entries --- changelog-entries/231.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog-entries/231.md diff --git a/changelog-entries/231.md b/changelog-entries/231.md new file mode 100644 index 00000000..32910be7 --- /dev/null +++ b/changelog-entries/231.md @@ -0,0 +1 @@ +- Add API functions for Just-in-time mapping https://github.com/precice/python-bindings/pull/231 From 9188afe17b6647785f99988da2152963dd86697a Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Mon, 31 Mar 2025 11:27:34 +0200 Subject: [PATCH 21/23] Update requirements of the solver dummy (#233) --- changelog-entries/233.md | 1 + examples/solverdummy/requirements.txt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog-entries/233.md diff --git a/changelog-entries/233.md b/changelog-entries/233.md new file mode 100644 index 00000000..7083f0c3 --- /dev/null +++ b/changelog-entries/233.md @@ -0,0 +1 @@ +- Update `requirements.txt` of the solver dummy https://github.com/precice/python-bindings/pull/233 diff --git a/examples/solverdummy/requirements.txt b/examples/solverdummy/requirements.txt index bd681547..d28aea5a 100644 --- a/examples/solverdummy/requirements.txt +++ b/examples/solverdummy/requirements.txt @@ -1,3 +1,3 @@ -pyprecice>=2.0 +pyprecice~=3.0 argparse>=1.4 -numpy>=1.16 +numpy >1, <2 From 39868adfb04e30c63568af1b347cb9bb9563fcc6 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Tue, 1 Apr 2025 22:44:39 +0200 Subject: [PATCH 22/23] Move individual changelog entries into CHANGELOG.md (#234) --- CHANGELOG.md | 6 ++++++ changelog-entries/193.md | 1 - changelog-entries/221.md | 1 - changelog-entries/224.md | 1 - changelog-entries/226.md | 1 - changelog-entries/231.md | 1 - changelog-entries/233.md | 1 - 7 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 changelog-entries/193.md delete mode 100644 changelog-entries/221.md delete mode 100644 changelog-entries/224.md delete mode 100644 changelog-entries/226.md delete mode 100644 changelog-entries/231.md delete mode 100644 changelog-entries/233.md diff --git a/CHANGELOG.md b/CHANGELOG.md index fb15f4e2..744550f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file. ## latest +* Update `requirements.txt` of the solver dummy https://github.com/precice/python-bindings/pull/233 +* Add API functions for Just-in-time mapping https://github.com/precice/python-bindings/pull/231 * Discontinued maintainment of Docker image `precice/python-bindings`. Python packages should be installed using virtual environments instead. Please refer to `README.md` for further information. https://github.com/precice/python-bindings/pull/228 +* Added profiling API functions https://github.com/precice/python-bindings/pull/226 +* Added API function `reset_mesh()` https://github.com/precice/python-bindings/pull/224 +* Removed testing of spack package https://github.com/precice/python-bindings/pull/221 +* Use the newer `precice/precice.hpp` header to access C++ API https://github.com/precice/python-bindings/pull/193 ## 3.1.2 diff --git a/changelog-entries/193.md b/changelog-entries/193.md deleted file mode 100644 index fe3f753d..00000000 --- a/changelog-entries/193.md +++ /dev/null @@ -1 +0,0 @@ -- Use the newer `precice/precice.hpp` header to access C++ API diff --git a/changelog-entries/221.md b/changelog-entries/221.md deleted file mode 100644 index 9475acc6..00000000 --- a/changelog-entries/221.md +++ /dev/null @@ -1 +0,0 @@ -* Removed testing of spack package diff --git a/changelog-entries/224.md b/changelog-entries/224.md deleted file mode 100644 index 088695ff..00000000 --- a/changelog-entries/224.md +++ /dev/null @@ -1 +0,0 @@ -- Added API function `reset_mesh()` diff --git a/changelog-entries/226.md b/changelog-entries/226.md deleted file mode 100644 index 3fb64908..00000000 --- a/changelog-entries/226.md +++ /dev/null @@ -1 +0,0 @@ -- Added profiling API which was introduced in preCICE in https://github.com/precice/precice/pull/1657 diff --git a/changelog-entries/231.md b/changelog-entries/231.md deleted file mode 100644 index 32910be7..00000000 --- a/changelog-entries/231.md +++ /dev/null @@ -1 +0,0 @@ -- Add API functions for Just-in-time mapping https://github.com/precice/python-bindings/pull/231 diff --git a/changelog-entries/233.md b/changelog-entries/233.md deleted file mode 100644 index 7083f0c3..00000000 --- a/changelog-entries/233.md +++ /dev/null @@ -1 +0,0 @@ -- Update `requirements.txt` of the solver dummy https://github.com/precice/python-bindings/pull/233 From 1a30360844116c68bcf502cd0f81d9771b41ca56 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Wed, 2 Apr 2025 13:03:58 +0200 Subject: [PATCH 23/23] Bump version --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 744550f7..6f495bd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## latest +## 3.2.0 * Update `requirements.txt` of the solver dummy https://github.com/precice/python-bindings/pull/233 * Add API functions for Just-in-time mapping https://github.com/precice/python-bindings/pull/231