Skip to content

Commit

Permalink
Merge pull request #168 from precice/python-bindings-v2.5.0.2
Browse files Browse the repository at this point in the history
Release v2.5.0.2
  • Loading branch information
IshaanDesai authored Feb 21, 2023
2 parents 0d28cf0 + 34860d9 commit 633fb89
Show file tree
Hide file tree
Showing 8 changed files with 204 additions and 103 deletions.
36 changes: 23 additions & 13 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: Build and Test
on:
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:

jobs:
setup_for_spack:
name: Run setup.py phases needed by spack
needs: [setup_test]
runs-on: ubuntu-latest
container: precice/precice
container:
image: benjaminrodenberg/precice:2.5.0
options: --user root
steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand All @@ -34,7 +36,9 @@ jobs:
setup_install:
name: Run setup install
runs-on: ubuntu-latest
container: precice/precice
container:
image: benjaminrodenberg/precice:2.5.0
options: --user root
steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand All @@ -52,12 +56,14 @@ jobs:
run: python3 setup.py install --user
- name: Test install
run: 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: precice/precice
container:
image: benjaminrodenberg/precice:2.5.0
options: --user root
steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand All @@ -73,7 +79,7 @@ jobs:
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
Expand All @@ -91,7 +97,7 @@ jobs:
packages: toml
- name: Checkout precice and make required files discoverable
run: |
git clone https://github.com/precice/precice.git precice-core
git clone -b v2.5.0 https://github.com/precice/precice.git precice-core
mkdir -p precice
cp precice-core/src/precice/SolverInterface.hpp precice/SolverInterface.hpp
cd precice-core
Expand All @@ -107,12 +113,14 @@ jobs:
run: |
export CFLAGS=-I$GITHUB_WORKSPACE
python3 setup.py test
pip_install:
name: Run pip install
needs: [setup_test]
runs-on: ubuntu-latest
container: precice/precice
container:
image: benjaminrodenberg/precice:2.5.0
options: --user root
steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand All @@ -131,7 +139,9 @@ jobs:
name: Run solverdummy
needs: [setup_install, setup_test]
runs-on: ubuntu-latest
container: precice/precice
container:
image: benjaminrodenberg/precice:2.5.0
options: --user root
steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand All @@ -147,4 +157,4 @@ jobs:
run: |
cd examples/solverdummy/
python3 solverdummy.py precice-config.xml SolverOne MeshOne & python3 solverdummy.py precice-config.xml SolverTwo MeshTwo
70 changes: 35 additions & 35 deletions .github/workflows/build-spack.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
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-2204
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 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}"
# 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-2204
# 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 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}"
13 changes: 8 additions & 5 deletions .github/workflows/run-solverdummy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,27 @@ on:
pull_request:
branches:
- "*"
jobs:
jobs:
run_solverdummies:
name: Run solverdummies
runs-on: ubuntu-latest
container: precice/precice
container:
image: benjaminrodenberg/precice:2.5.0
options: --user root
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v2
- name: Install Dependencies
run: |
apt-get -qq update
apt-get -qq install software-properties-common python3-dev python3-pip git apt-utils pkg-config
rm -rf /var/lib/apt/lists/*
pip3 install --upgrade --user pip
- name: Install bindings
run: pip3 install --user .
- 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_MPICommunication']=='Y')"
- name: Run solverdummies
run: |
run: |
cd examples/solverdummy/
python3 solverdummy.py precice-config.xml SolverOne MeshOne & python3 solverdummy.py precice-config.xml SolverTwo MeshTwo
python3 solverdummy.py precice-config.xml SolverOne & python3 solverdummy.py precice-config.xml SolverTwo
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## latest

## 2.5.0.2

* Add Waveform API introduced in preCICE v2.4.0.

## 2.5.0.1

* Add pkgconfig as dependency to the pythonpublish workflow https://github.com/precice/python-bindings/commit/200dc2aba160e18a7d1dae44ef3493d546e69eb9
Expand Down
10 changes: 9 additions & 1 deletion cyprecice/SolverInterface.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,21 @@ cdef extern from "precice/SolverInterface.hpp" namespace "precice":

void readBlockVectorData (const int dataID, const int size, const int* valueIndices, double* values) const

void readBlockVectorData (const int dataID, const int size, const int* valueIndices, double relativeReadTime, double* values) const

void readVectorData (const int dataID, const int valueIndex, double* value) const

void readVectorData (const int dataID, const int valueIndex, double relativeReadTime, double* value) const

void readBlockScalarData (const int dataID, const int size, const int* valueIndices, double* values) const

void readBlockScalarData (const int dataID, const int size, const int* valueIndices, double relativeReadTime, double* values) const

void readScalarData (const int dataID, const int valueIndex, double& value) const

# Gradient related API
void readScalarData (const int dataID, const int valueIndex, double relativeReadTime, double& value) const

# Gradient related API

bool isGradientDataRequired(int dataID) const;

Expand Down
Loading

0 comments on commit 633fb89

Please sign in to comment.