The main focus of this PR is on simplifying the DataContainer API and its backend, which has become increasingly hard to maintain. This implies:
Remove support for non-openPMD data. VisualPIC started at a time where openPMD was not yet widely adopted by the community. This required being able to support reading data with different conventions, formats, metadata, etc, which greatly increased the complexity of the code. Nowadays, the most popular simulation codes support the openPMD standard.
Use the OpenPMDTimeSeries as the backend for the DataContainer. This avoids significant code duplication between VisualPIC and the openpmd-viewer and makes the code easier to maintain. This will require porting a few features to the openpmd-viewer.
Remove unit converters, derived fields and derived particle data. They were not widely used and made the codebase more complex. Some of these features, like the derived fields, will be replaced by a new laser analysis module.
Simplify the get_data API. The arguments now follow the convention of the OpenPMDTimeSeries. Also, it now returns a single object that contains the data and the metadata (instead of a tuple or dict with data and metadata). This object can be partly used as a numpy array. See example below:
Backward compatibility with v0.5. The goal is not to break code written with the older v0.5 API. There are multiple checks in the code that should allow most of the old code to run as usual (although only for openPMD data).
This is the first PR towards v0.6.
The main focus of this PR is on simplifying the
DataContainer
API and its backend, which has become increasingly hard to maintain. This implies:OpenPMDTimeSeries
as the backend for theDataContainer
. This avoids significant code duplication between VisualPIC and the openpmd-viewer and makes the code easier to maintain. This will require porting a few features to the openpmd-viewer.get_data
API. The arguments now follow the convention of theOpenPMDTimeSeries
. Also, it now returns a single object that contains the data and the metadata (instead of a tuple or dict with data and metadata). This object can be partly used as a numpy array. See example below: