-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 rebasing
- Loading branch information
1 parent
e965f69
commit 2e89f87
Showing
67 changed files
with
1,572 additions
and
703 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.