Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[codespell]
ignore-words-list = precice
2 changes: 1 addition & 1 deletion .github/workflows/check-pep8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: autopep8
- name: autopep8
id: autopep8
uses: peter-evans/autopep8@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
name: dist
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion .github/workflows/run-solverdummy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
- 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
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
repos:
# Official repo for the clang-format hook
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v20.1.0'
hooks:
- id: clang-format
name: format C/C++
types_or: [c++]
# Official repo for default hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v5.0.0'
hooks:
- id: check-merge-conflict
- id: mixed-line-ending
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
# black repo for python formatting
- repo: https://github.com/ambv/black
rev: 25.1.0
hooks:
- id: black
name: format python
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
name: check spelling
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.33.2
hooks:
- id: check-github-workflows
args: ["--verbose"]
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ All notable changes to this project will be documented in this file.

## 2.2.0.2

* Improved error messgaes for all assertions. https://github.com/precice/python-bindings/pull/9
* Improved error messages for all assertions. https://github.com/precice/python-bindings/pull/9
* Improve CI w.r.t spack package. https://github.com/precice/python-bindings/pull/89

## 2.2.0.1
Expand Down Expand Up @@ -118,7 +118,7 @@ All notable changes to this project will be documented in this file.

## 2.0.0.2

* Improvement of PyPI intergration.
* Improvement of PyPI integration.

## 2.0.0.1

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ If preCICE (the C++ library) was installed in a custom prefix, or only built but
* `LIBRARY_PATH`, `LD_LIBRARY_PATH` to the library location, or `$prefix/lib`
* `CPATH` either to the `src` directory or the `$prefix/include`

The preCICE documentation provides more informaiton on [linking preCICE](https://precice.org/installation-linking.html).
The preCICE documentation provides more information on [linking preCICE](https://precice.org/installation-linking.html).

### Using Spack

Expand Down
2 changes: 1 addition & 1 deletion cyprecice/Participant.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ 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 +
Expand Down
14 changes: 7 additions & 7 deletions cyprecice/cyprecice.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ cdef class Participant:
Returns
-------
tag : bool
Returns True if inital data is required.
Returns True if initial data is required.

Notes
-----
Expand All @@ -284,10 +284,10 @@ cdef class Participant:
def requires_writing_checkpoint (self):
"""
Checks if the participant is required to write an iteration checkpoint.

If true, the participant is required to write an iteration checkpoint before
calling advance().

preCICE refuses to proceed if writing a checkpoint is required,
but this method isn't called prior to advance().

Expand Down Expand Up @@ -1062,7 +1062,7 @@ cdef class Participant:
vertex_ids : array_like
Indices of the vertices.
gradients : array_like
Gradient values differentiated in the spacial direction (dx, dy) for 2D space, (dx, dy, dz) for 3D space
Gradient values differentiated in the spatial direction (dx, dy) for 2D space, (dx, dy, dz) for 3D space

Notes
-----
Expand Down Expand Up @@ -1117,7 +1117,7 @@ cdef class Participant:

def requires_gradient_data_for(self, mesh_name, data_name):
"""
Checks if the given data set requires gradient data. We check if the data object has been intialized with the gradient flag.
Checks if the given data set requires gradient data. We check if the data object has been initialized with the gradient flag.

Parameters
----------
Expand Down Expand Up @@ -1229,7 +1229,7 @@ cdef class Participant:
def start_profiling_section(self, event_name):
"""
Starts a profiling section with the given event name.

Parameters
----------
event_name : str
Expand All @@ -1239,7 +1239,7 @@ cdef class Participant:
--------
Start a profiling section with the event name "EventOne":
>>> event_name = "EventOne"
>>> participant.start_profiling_section(event_name)
>>> participant.start_profiling_section(event_name)
"""
self.thisptr.startProfilingSection(convert(event_name))

Expand Down
8 changes: 4 additions & 4 deletions docs/ReleaseGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ The release of the `python-bindings` repository is made directly from a release
commit 44b715dde4e3194fa69e61045089ca4ec6925fe3 (HEAD -> master, origin/master)
Author: Benjamin Rodenberg <benjamin.rodenberg@in.tum.de>
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 <benjamin.rodenberg@in.tum.de>
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
```

Expand Down
36 changes: 21 additions & 15 deletions examples/solverdummy/solverdummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import precice

parser = argparse.ArgumentParser()
parser.add_argument("configurationFileName",
help="Name of the xml config file.", type=str)
parser.add_argument(
"configurationFileName", help="Name of the xml config file.", type=str
)
parser.add_argument("participantName", help="Name of the solver.", type=str)

try:
Expand All @@ -19,29 +20,34 @@
configuration_file_name = args.configurationFileName
participant_name = args.participantName

if participant_name == 'SolverOne':
write_data_name = 'Data-One'
read_data_name = 'Data-Two'
mesh_name = 'SolverOne-Mesh'
if participant_name == "SolverOne":
write_data_name = "Data-One"
read_data_name = "Data-Two"
mesh_name = "SolverOne-Mesh"

if participant_name == 'SolverTwo':
read_data_name = 'Data-One'
write_data_name = 'Data-Two'
mesh_name = 'SolverTwo-Mesh'
if participant_name == "SolverTwo":
read_data_name = "Data-One"
write_data_name = "Data-Two"
mesh_name = "SolverTwo-Mesh"

num_vertices = 3 # Number of vertices

solver_process_index = 0
solver_process_size = 1

participant = precice.Participant(participant_name, configuration_file_name,
solver_process_index, solver_process_size)
participant = precice.Participant(
participant_name, configuration_file_name, solver_process_index, solver_process_size
)

assert (participant.requires_mesh_connectivity_for(mesh_name) is False)
assert participant.requires_mesh_connectivity_for(mesh_name) is False

vertices = np.zeros((num_vertices, participant.get_mesh_dimensions(mesh_name)))
read_data = np.zeros((num_vertices, participant.get_data_dimensions(mesh_name, read_data_name)))
write_data = np.zeros((num_vertices, participant.get_data_dimensions(mesh_name, write_data_name)))
read_data = np.zeros(
(num_vertices, participant.get_data_dimensions(mesh_name, read_data_name))
)
write_data = np.zeros(
(num_vertices, participant.get_data_dimensions(mesh_name, write_data_name))
)

for x in range(num_vertices):
for y in range(participant.get_mesh_dimensions(mesh_name)):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_extensions():
compile_args += pkgconfig.cflags("libprecice").split()

if os.environ.get(MOCKED_ENV) is not None:
print(f"Builing mocked pyprecice as {MOCKED_ENV} is set")
print(f"Building mocked pyprecice as {MOCKED_ENV} is set")
bindings_sources.append("test/Participant.cpp")
else:
link_args += pkgconfig.libs("libprecice").split()
Expand Down
Loading