-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify Datastructures instead of Methods #60
Comments
From the description, it sounds like most of the issue is not the PICMI code itself, but uncertainty about what data is available in the class instances and how to access it. Instead of rewriting the PICMI classes, an alternate solution is to provide documentation for the implementers describing what attributes are available and what they are (including type information). This would be a set of guidelines to follow. For instance, regarding the I agree that there can be an issue with have some data stored in two different ways, e.g. the number of grid cells. I have long learned that there is only so much that can be done to limit the damage when users abuse code since it is impossible to predict what users will do. In this case though, perhaps a small clean up can be done so that only one of the two alternatives is saved internally, for example only storing |
Yes.
Both are close, but subtly different. For implementations this would acceptable, but: One of the high-regarded workflows for Smilei is referencing the input parameters when processing the output.
Another short argument: The constructors are currently a lot of boilerplate code. (Admittedly, currently at an somewhat acceptable level.) I believe that such a restructuring could be fully compatible to the current usage.
|
The README of PICMI states that "The goal of the standard is to propose a set (or dictionary) of names and definitions [...]". However, the documentation at no point specifies sets or dictionaries, it always specifies
__init__()
methods. Which variables are set by__init__()
is entirely unspecified (and has to be looked up in the code).For the most cases this does not matter, e.g. the attribute
name
of a Species is later accessible asspecies.name
.For other cases this is not as clear: What properties does
Simulation.add_species()
modify? In which way?I am vary of just reading the code, b/c there are no guarantees made by PICMI that this code will be stable.
In addition to that the behavior of the
__init__()
method is not clear: Most only copy their parameters to the attributes, but some perform more operations, e.g.:Or put another way: PICMI currently specifies a user interfaces, but the object that is passed to the implementing PIC simulation is unspecified.
There are a couple of approaches to this, I want to propose these steps:
__init__()
,__eq__()
,__hash__()
, ...)add_species()
None
by default values where applicable etc.I have attached the species definition as an example how I would imagine the specification to look like & and the test case that sketches its behavior.
Implementation:
Test case:
Notably, this would be very close to how openPMD is specified, as purely a list of attributes.
(Which would then allow separating the reference implementation and the specification more clearly, as mentioned in #3)
The text was updated successfully, but these errors were encountered: