Skip to content

Commit a6a4d55

Browse files
committed
Merge branch 'dev' into eschnett/julia-bindings
2 parents 9edac3b + 7c876c7 commit a6a4d55

235 files changed

Lines changed: 26974 additions & 24201 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
Language: Cpp
2+
3+
BasedOnStyle: LLVM
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: AlwaysBreak
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
# AlignEscapedNewlinesLeft: false
9+
AlignEscapedNewlines: Right
10+
AlignOperands: false
11+
AlignTrailingComments: false
12+
AllowAllArgumentsOnNextLine: true
13+
AllowAllConstructorInitializersOnNextLine: true
14+
AllowAllParametersOfDeclarationOnNextLine: true
15+
AllowShortBlocksOnASingleLine: false
16+
AllowShortCaseLabelsOnASingleLine: false
17+
AllowShortFunctionsOnASingleLine: None
18+
AllowShortIfStatementsOnASingleLine: false
19+
AllowShortLambdasOnASingleLine: true
20+
AllowShortLoopsOnASingleLine: false
21+
AlwaysBreakBeforeMultilineStrings: true
22+
AlwaysBreakTemplateDeclarations: Yes
23+
BinPackArguments: false
24+
BinPackParameters: false
25+
26+
BreakBeforeBraces: Custom
27+
BraceWrapping:
28+
AfterClass: true
29+
AfterControlStatement: true
30+
AfterEnum: true
31+
AfterExternBlock: true
32+
AfterFunction: true
33+
AfterNamespace: true
34+
AfterStruct: true
35+
AfterUnion: true
36+
BeforeCatch: true
37+
BeforeElse: true
38+
# BeforeLambdaBody: true
39+
SplitEmptyFunction: false
40+
SplitEmptyNamespace: false
41+
SplitEmptyRecord: false
42+
43+
BreakConstructorInitializers: BeforeComma
44+
BreakInheritanceList: BeforeComma
45+
ColumnLimit: 80
46+
CompactNamespaces: false
47+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
48+
ConstructorInitializerIndentWidth: 4
49+
ContinuationIndentWidth: 4
50+
FixNamespaceComments: true
51+
IndentWidth: 4
52+
NamespaceIndentation: Inner
53+
PointerAlignment: Right
54+
SortUsingDeclarations: false
55+
SpaceAfterCStyleCast: false
56+
SpaceAfterTemplateKeyword: true
57+
SpaceBeforeAssignmentOperators: true
58+
SpaceBeforeParens: ControlStatements
59+
SpaceInEmptyParentheses: false
60+
SpacesInAngles: false
61+
SpacesInContainerLiterals: false
62+
SpacesInCStyleCastParentheses: false
63+
SpacesInParentheses: false
64+
SpacesInSquareBrackets: false
65+
Standard: Auto
66+
StatementMacros: ["OPENPMD_private", "OPENPMD_protected"]

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# FIXME: all performance-* reports
33
# FIXME: all cert-* reports
44
# FIXME: all bugprone-* reports
5-
Checks: -*,bugprone-*,-bugprone-unhandled-self-assignment,-bugprone-parent-virtual-call,-bugprone-narrowing-conversions,-bugprone-exception-escape,-bugprone-string-literal-with-embedded-nul,cppcoreguidelines-slicing,mpi-*,readability-non-const-parameter,modernize-*,-modernize-use-trailing-return-type,-modernize-use-bool-literals,-modernize-avoid-c-arrays,-modernize-use-auto,-modernize-return-braced-init-list
5+
Checks: -*,bugprone-*,-bugprone-unhandled-self-assignment,-bugprone-parent-virtual-call,-bugprone-narrowing-conversions,-bugprone-exception-escape,-bugprone-string-literal-with-embedded-nul,cppcoreguidelines-slicing,mpi-*,readability-non-const-parameter,performance-for-range-copy,modernize-*,-modernize-use-trailing-return-type,-modernize-use-bool-literals,-modernize-avoid-c-arrays,-modernize-use-auto,-modernize-return-braced-init-list
66
HeaderFilterRegex: '((^(?!\/share\/openPMD\/).*)*include\/openPMD\/.+\.hpp|src\/^(?!binding).+\.cpp$)'
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
if (( $# > 0 )); then
4+
# received arguments, format those files
5+
clang-format-12 -i "$@"
6+
else
7+
# received no arguments, find files on our own
8+
find include/ src/ test/ examples/ \
9+
-regextype egrep \
10+
-type f -regex '.*\.(hpp|cpp|hpp\.in)$' \
11+
| xargs clang-format-12 -i
12+
fi

.pre-commit-config.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ repos:
4747

4848
# Changes tabs to spaces
4949
- repo: https://github.com/Lucas-C/pre-commit-hooks
50-
rev: v1.1.10
50+
rev: v1.1.13
5151
hooks:
5252
- id: remove-tabs
5353

@@ -61,11 +61,16 @@ repos:
6161
# files: (\.cmake|CMakeLists.txt)(.in)?$
6262

6363
# C++ formatting
64-
# clang-format
64+
# clang-format v12
65+
# to run manually, use .github/workflows/clang-format/clang-format.sh
66+
- repo: https://github.com/pre-commit/mirrors-clang-format
67+
rev: v13.0.1
68+
hooks:
69+
- id: clang-format
6570

6671
# Autoremoves unused Python imports
6772
- repo: https://github.com/hadialqattan/pycln
68-
rev: v1.1.0
73+
rev: v1.2.4
6974
hooks:
7075
- id: pycln
7176
name: pycln (python)

CHANGELOG.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ Changes to "0.14.0"
1717
Features
1818
""""""""
1919

20-
- CMake
21-
22-
- include internally shipped toml11 v3.7.0 #1148
20+
- include internally shipped toml11 v3.7.0 #1148
21+
- pybind11: require version 2.9.1+ #1220
2322

2423
Bug Fixes
2524
"""""""""

CMakeLists.txt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,9 @@ if(openPMD_USE_PYTHON STREQUAL AUTO)
396396
if(openPMD_USE_INTERNAL_PYBIND11)
397397
add_subdirectory("${openPMD_SOURCE_DIR}/share/openPMD/thirdParty/pybind11")
398398
set(openPMD_HAVE_PYTHON TRUE)
399-
message(STATUS "pybind11: Using INTERNAL version 2.6.2")
399+
message(STATUS "pybind11: Using INTERNAL version 2.9.1")
400400
else()
401-
find_package(pybind11 2.6.2 CONFIG)
401+
find_package(pybind11 2.9.1 CONFIG)
402402
if(pybind11_FOUND)
403403
set(openPMD_HAVE_PYTHON TRUE)
404404
message(STATUS "pybind11: Found version '${pybind11_VERSION}'")
@@ -414,9 +414,9 @@ elseif(openPMD_USE_PYTHON)
414414
if(openPMD_USE_INTERNAL_PYBIND11)
415415
add_subdirectory("${openPMD_SOURCE_DIR}/share/openPMD/thirdParty/pybind11")
416416
set(openPMD_HAVE_PYTHON TRUE)
417-
message(STATUS "pybind11: Using INTERNAL version 2.6.2")
417+
message(STATUS "pybind11: Using INTERNAL version 2.9.1")
418418
else()
419-
find_package(pybind11 2.6.2 REQUIRED CONFIG)
419+
find_package(pybind11 2.9.1 REQUIRED CONFIG)
420420
set(openPMD_HAVE_PYTHON TRUE)
421421
message(STATUS "pybind11: Found version '${pybind11_VERSION}'")
422422
endif()
@@ -736,7 +736,12 @@ if(openPMD_HAVE_PYTHON)
736736
endif()
737737
unset(_USE_PY_LTO)
738738

739-
pybind11_extension(openPMD.py)
739+
if(EMSCRIPTEN)
740+
set_target_properties(openPMD.py PROPERTIES
741+
PREFIX "")
742+
else()
743+
pybind11_extension(openPMD.py)
744+
endif()
740745
pybind11_strip(openPMD.py)
741746

742747
set_target_properties(openPMD.py PROPERTIES CXX_VISIBILITY_PRESET "hidden"
@@ -941,11 +946,11 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
941946
# /usr/lib/llvm-6.0/lib/clang/6.0.0/lib/linux/libclang_rt.ubsan_minimal-x86_64.so
942947
# at runtime when used with symbol-hidden code (e.g. pybind11 module)
943948

944-
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code ${CMAKE_CXX_FLAGS}")
949+
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -Wsign-compare ${CMAKE_CXX_FLAGS}")
945950
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
946951
set(CMAKE_CXX_FLAGS "-w3 -wd193,383,1572 ${CMAKE_CXX_FLAGS}")
947952
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
948-
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -Wshadow -Woverloaded-virtual -Wunreachable-code ${CMAKE_CXX_FLAGS}")
953+
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -Wshadow -Woverloaded-virtual -Wunreachable-code -Wsign-compare ${CMAKE_CXX_FLAGS}")
949954
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
950955
# Warning C4503: "decorated name length exceeded, name was truncated"
951956
# Symbols longer than 4096 chars are truncated (and hashed instead)

NEWS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Building openPMD-api now requires a compiler that supports C++17 or newer.
1111

1212
Python 3.10 is now supported.
1313
openPMD-api now depends on `toml11 <https://github.com/ToruNiina/toml11>`__ 3.7.0+.
14+
pybind11 2.9.1 is now the minimally supported version for Python support.
1415

1516
The following backend-specific members of the ``Dataset`` class have been removed: ``Dataset::setChunkSize()``, ``Dataset::setCompression()``, ``Dataset::setCustomTransform()``, ``Dataset::chunkSize``, ``Dataset::compression``, ``Dataset::transform``.
1617
They are replaced by backend-specific options in the JSON-based backend configuration.

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ See [the openPMD standard](https://github.com/openPMD/openPMD-standard) for deta
2727

2828
This library provides a reference API for openPMD data handling.
2929
Since openPMD is a schema (or markup) on top of portable, hierarchical file formats, this library implements various backends such as HDF5, ADIOS1, ADIOS2 and JSON.
30-
Writing & reading through those backends and their associated files is supported for serial and [MPI-parallel](https://www.mpi-forum.org/docs/) workflows.
30+
Writing & reading through those backends and their associated files are supported for serial and [MPI-parallel](https://www.mpi-forum.org/docs/) workflows.
3131

3232
## Usage
3333

@@ -104,7 +104,7 @@ Required:
104104

105105
Shipped internally in `share/openPMD/thirdParty/`:
106106
* [Catch2](https://github.com/catchorg/Catch2) 2.13.4+ ([BSL-1.0](https://github.com/catchorg/Catch2/blob/master/LICENSE.txt))
107-
* [pybind11](https://github.com/pybind/pybind11) 2.6.2+ ([new BSD](https://github.com/pybind/pybind11/blob/master/LICENSE))
107+
* [pybind11](https://github.com/pybind/pybind11) 2.9.1+ ([new BSD](https://github.com/pybind/pybind11/blob/master/LICENSE))
108108
* [NLohmann-JSON](https://github.com/nlohmann/json) 3.9.1+ ([MIT](https://github.com/nlohmann/json/blob/develop/LICENSE.MIT))
109109
* [toml11](https://github.com/ToruNiina/toml11) 3.7.0+ ([MIT](https://github.com/ToruNiina/toml11/blob/master/LICENSE))
110110

@@ -120,7 +120,7 @@ while those can be built either with or without:
120120
Optional language bindings:
121121
* Python:
122122
* Python 3.6 - 3.10
123-
* pybind11 2.6.2+
123+
* pybind11 2.9.1+
124124
* numpy 1.15+
125125
* mpi4py 2.1+ (optional, for MPI)
126126
* pandas 1.0+ (optional, for dataframes)
@@ -212,6 +212,8 @@ export CMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF
212212
python3 -m pip install openpmd-api --no-binary openpmd-api
213213
```
214214

215+
Additional CMake options can be passed via individual environment variables, which need to be prefixed with `openPMD_CMAKE_`.
216+
215217
### From Source
216218

217219
[![Source Use Case](https://img.shields.io/badge/use_case-development-brightgreen)](https://cmake.org)
@@ -269,7 +271,7 @@ The following options allow to switch to external installs:
269271
| CMake Option | Values | Library | Version |
270272
|---------------------------------|------------|---------------|---------|
271273
| `openPMD_USE_INTERNAL_CATCH` | **ON**/OFF | Catch2 | 2.13.4+ |
272-
| `openPMD_USE_INTERNAL_PYBIND11` | **ON**/OFF | pybind11 | 2.6.2+ |
274+
| `openPMD_USE_INTERNAL_PYBIND11` | **ON**/OFF | pybind11 | 2.9.1+ |
273275
| `openPMD_USE_INTERNAL_JSON` | **ON**/OFF | NLohmann-JSON | 3.9.1+ |
274276
| `openPMD_USE_INTERNAL_TOML11` | **ON**/OFF | toml11 | 3.7.0+ |
275277

docs/source/details/backendconfig.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Parameters that are directly passed through to an external library and not inter
3535

3636
The configuration string may refer to the complete ``openPMD::Series`` or may additionally be specified per ``openPMD::Dataset``, passed in the respective constructors.
3737
This reflects the fact that certain backend-specific parameters may refer to the whole Series (such as storage engines and their parameters) and others refer to actual datasets (such as compression).
38+
Dataset-specific configurations are (currently) only available during dataset creation, but not when reading datasets.
3839

3940
A JSON/TOML configuration may either be specified as an inline string that can be parsed as a JSON/TOML object, or alternatively as a path to a JSON/TOML-formatted text file (only in the constructor of ``openPMD::Series``):
4041

@@ -129,6 +130,29 @@ Explanation of the single keys:
129130
This workaround is enabled on a per-dataset level.
130131
The workaround can be completely deactivated by specifying ``{"adios2": {"use_span_based_put": true}}`` or it can alternatively be activated indiscriminately for all datasets by specifying ``{"adios2": {"use_span_based_put": false}}``.
131132

133+
Operations specified inside ``adios2.dataset.operators`` will be applied to ADIOS2 datasets in writing as well as in reading.
134+
Beginning with ADIOS2 2.8.0, this can be used to specify decompressor settings:
135+
136+
.. code-block:: json
137+
138+
{
139+
"adios2": {
140+
"dataset": {
141+
"operators": [
142+
{
143+
"type": "blosc",
144+
"parameters": {
145+
"nthreads": 2
146+
}
147+
}
148+
]
149+
}
150+
}
151+
}
152+
153+
In older ADIOS2 versions, this specification will be without effect in read mode.
154+
Dataset-specific configurations are (currently) only possible when creating datasets, not when reading.
155+
132156
Any setting specified under ``adios2.dataset`` is applicable globally as well as on a per-dataset level.
133157
Any setting under ``adios2.engine`` is applicable globally only.
134158

docs/source/dev/buildoptions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ The following options allow to switch to external installs of dependencies:
6969
CMake Option Values Installs Library Version
7070
================================= =========== ======== ============= ========
7171
``openPMD_USE_INTERNAL_CATCH`` **ON**/OFF No Catch2 2.13.4+
72-
``openPMD_USE_INTERNAL_PYBIND11`` **ON**/OFF No pybind11 2.6.2+
72+
``openPMD_USE_INTERNAL_PYBIND11`` **ON**/OFF No pybind11 2.9.1+
7373
``openPMD_USE_INTERNAL_JSON`` **ON**/OFF No NLohmann-JSON 3.9.1+
7474
``openPMD_USE_INTERNAL_TOML11`` **ON**/OFF No toml11 3.7.0+
7575
================================= =========== ======== ============= ========

0 commit comments

Comments
 (0)