Commit 2e89f87
authored
Remove necessity for RecordComponent::SCALAR (#1154)
* Add helper: openPMD::auxiliary::overloaded
* Prepare Attributable for virtual inheritance
Use only zero-param constructors to avoid diamond initialization
pitfalls
* Fix default constructors/operators of Container and BaseRecordComponent
These derive virtually from Attributable, and this avoids that pitfalls
propagate to user code.
* Add m_datasetDefined
See in-code documentation.
* Prepare class structure without applying logic yet
BaseRecord is now derived by its contained RecordComponent type.
If it is scalar, the idea is that the BaseRecord itself is used as a
RecordComponent, without needing to retrieve the [SCALAR] entry.
No logic implemented yet around this, this just prepares the class
structure.
Notice that this will write some unnecessary attributes since the
RecordComponent types initialize some default attributes upon
construction.
* No longer use map entry SCALAR in application logic
Not yet supported: Backward compatibility for still allowing legacy
access to scalar entries
* Remove KEEP_SYNCHRONOUS task
No longer needed, as one object in the openPMD hierarchy is no longer
represented by possibly multiple Writable objects.
* Adapt Coretests
* No virtual methods in Container class
Either this way, or make all of them virtual
* Fully override Container methods in BaseRecord
Special care for legacy usage of SCALAR constant. Implement iteration
API such that it works for scalar components as well.
* Adapt Container API to C++17
insert() and reverse iterators
* Adapt myPath() functionality
* Factor out create_and_bind_container() function template
Will later be called by Record-type classes, too
* Factor out RecordComponent.__setitem__ and __getitem__
Similarly to the Container API, we will need to apply this to
Record-type classes.
Defining `__setitem__` and `__getitem__` for them is sufficient, as all
other members are inherited from RecordComponent.
`__setitem__` and `__getitem__` need special care, as they are inherited
from Container AND from RecordComponent, so some conflict resolution is
needed.
* Consistently use copy semantics in Python API
* Apply new class structure to Python API as well
* Adapt openpmd-pipe to new design
This somewhat demonstrates that this change is slightly API-breaking.
Since openpmd-pipe acts directly on the class structure via
`instanceof()`, fixes are necessary.
* Safeguard: No scalar and vector components side by side
"A scalar component can not be contained at the same time as one or more regular components."
* Remove [SCALAR] from all examples
* Avoid object slicing when using records as scalar components
* Documentation
* Adapt to refactored Python bindings after rebasing1 parent e965f69 commit 2e89f87
File tree
67 files changed
+1572
-703
lines changed- docs/source/usage
- examples
- include/openPMD
- IO
- auxiliary
- backend
- binding/python
- src
- IO
- backend
- binding/python
- openpmd_api/pipe
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
67 files changed
+1572
-703
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
465 | | - | |
466 | 465 | | |
467 | 466 | | |
468 | 467 | | |
| |||
605 | 604 | | |
606 | 605 | | |
607 | 606 | | |
608 | | - | |
609 | 607 | | |
610 | 608 | | |
611 | 609 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
95 | 94 | | |
96 | 95 | | |
97 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
| 127 | + | |
129 | 128 | | |
130 | 129 | | |
131 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | 57 | | |
59 | 58 | | |
60 | | - | |
| 59 | + | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 61 | + | |
64 | 62 | | |
65 | 63 | | |
66 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
| |||
0 commit comments