diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3e6a4f51..799d9dc2 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -8,36 +8,11 @@ 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 container: - image: precice/precice:develop + image: precice/precice:nightly options: --user root steps: - name: Checkout Repository @@ -45,44 +20,26 @@ 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 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 @@ -104,7 +61,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 @@ -124,42 +81,56 @@ jobs: needs: [setup_test] runs-on: ubuntu-latest container: - image: precice/precice:develop + image: precice/precice:nightly options: --user root 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" solverdummy_test: name: Run solverdummy - needs: [setup_install, setup_test] + needs: [pip_install] runs-on: ubuntu-latest container: - image: precice/precice:develop + image: precice/precice:nightly options: --user root 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/build-docker.yml b/.github/workflows/build-docker.yml deleted file mode 100644 index 37881853..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 }}" >> "$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/.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/.github/workflows/run-solverdummy.yml b/.github/workflows/run-solverdummy.yml index 1704a108..69b18094 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 @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index aa26432a..6f495bd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,18 +2,28 @@ All notable changes to this project will be documented in this file. -## v3.1.2 +## 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 +* 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 * 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 diff --git a/README.md b/README.md index 92898c61..b2509839 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). @@ -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* diff --git a/cyprecice/Participant.pxd b/cyprecice/Participant.pxd index ffe9783b..51bf9571 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 @@ -11,27 +11,25 @@ cdef extern from "precice/Participant.hpp" namespace "precice": Participant (const string&, const string&, int, int, void*) except + - void configure (const string&) - # 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) const + int getMeshDimensions(const string& meshName) except + - int getDataDimensions(const string& meshName, const string& dataName) const + int getDataDimensions(const string& meshName, const string& dataName) except + - bool isCouplingOngoing() const + bool isCouplingOngoing() - bool isTimeWindowComplete() const + bool isTimeWindowComplete() - double getMaxTimeStepSize() const + double getMaxTimeStepSize() bool requiresInitialData() @@ -41,48 +39,63 @@ cdef extern from "precice/Participant.hpp" namespace "precice": # mesh access - bool requiresMeshConnectivityFor (const string& meshName) const + bool requiresMeshConnectivityFor (const string& meshName) except + + + int setMeshVertex (const string& meshName, vector[double] position) except + - int setMeshVertex (const string& meshName, vector[double] position) + int getMeshVertexSize (const string& meshName) except + - int getMeshVertexSize (const string& meshName) const + void setMeshVertices (const string& meshName, vector[double] positions, vector[int]& ids) except + - void setMeshVertices (const string& meshName, vector[double] positions, vector[int]& ids) + void setMeshEdge (const string& meshName, int firstVertexID, int secondVertexID) except + - void setMeshEdge (const string& meshName, int firstVertexID, int secondVertexID) + void setMeshEdges (const string& meshName, vector[int] vertices) except + - void setMeshEdges (const string& meshName, vector[int] vertices) + void setMeshTriangle (const string& meshName, int firstVertexID, int secondVertexID, int thirdVertexID) except + - void setMeshTriangle (const string& meshName, int firstVertexID, int secondVertexID, int thirdVertexID) + void setMeshTriangles (const string& meshName, vector[int] vertices) except + - void setMeshTriangles (const string& meshName, vector[int] vertices) + void setMeshQuad (const string& meshName, int firstVertexID, int secondVertexID, int thirdVertexID, int fourthVertexID) except + - void setMeshQuad (const string& meshName, int firstVertexID, int secondVertexID, int thirdVertexID, int fourthVertexID) + void setMeshQuads (const string& meshName, vector[int] vertices) except + - void setMeshQuads (const string& meshName, vector[int] vertices) + void setMeshTetrahedron (const string& meshName, int firstVertexID, int secondVertexID, int thirdVertexID, int fourthVertexID) except + - void setMeshTetrahedron (const string& meshName, int firstVertexID, int secondVertexID, int thirdVertexID, int fourthVertexID) + void setMeshTetrahedra (const string& meshName, vector[int] vertices) except + - void setMeshTetrahedra (const string& meshName, vector[int] vertices) + # remeshing + + 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) except + - void readData (const string& meshName, const string& dataName, vector[int] vertices, const double relativeReadTime, vector[double]& values) const + # 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) const + void setMeshAccessRegion (const string& meshName, vector[double] boundingBox) except + - void getMeshVertexIDsAndCoordinates (const string& meshName, vector[int]& ids, vector[double]& coordinates) const + void getMeshVertexIDsAndCoordinates (const string& meshName, vector[int]& ids, vector[double]& coordinates) except + # Gradient related API - bool requiresGradientDataFor(const string& meshName, const string& dataName) const + bool requiresGradientDataFor(const string& meshName, const string& dataName) except + + + void writeGradientData(const string& meshName, const string& dataName, vector[int] vertices, vector[double] gradientValues) except + + + # Experimental profiling API - void writeGradientData(const string& meshName, const string& dataName, vector[int] vertices, vector[double] gradientValues) + 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 557e8f04..c2519478 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): @@ -794,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 @@ -867,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): """ @@ -1044,6 +1187,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/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/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 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..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")] ) ] @@ -137,7 +147,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/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 7ee79d6e..00000000 --- a/spack/repo/packages/py-pyprecice/package.py +++ /dev/null @@ -1,71 +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@:1", type=("build", "link", "run")) - 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' diff --git a/test/Participant.cpp b/test/Participant.cpp index 8a36f2af..819dc10f 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, @@ -273,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, @@ -315,9 +345,18 @@ void Participant::writeGradientData( } } +void Participant::startProfilingSection( + precice::string_view sectionName) +{ +} + +void Participant::stopLastProfilingSection() +{ +} + 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..ee2287ee 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 @@ -315,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 diff --git a/tools/releasing/packaging/docker/Dockerfile b/tools/releasing/packaging/docker/Dockerfile deleted file mode 100644 index e53c459d..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=develop -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}