Repository navigation
New Extension: BeamPhysics - #183
Conversation
|
@DavidSagan Thanks for your answers! |
Will Do. |
|
@RemiLehe @ChristopherMayes @ax3l @marcguetg OK I pushed a new version based upon the discussion. Much thanks for the comments. |
marcguetg
left a comment
There was a problem hiding this comment.
I really like the way it is now. One small comment though:
- I would make the presence of either charge/totalCharge 'Required' as this would allow processing of most data even if 'SpeciesType' is not implemented.
I'm not understanding this. The plan is to have the species type extension become official in the 2.0.0 standard along with the Beam Physics standard. |
|
I understand, I'm just saying this duplication of information would allow a user to implement a 'light version' which is still according to specs. I agree it would be small use case, as most would use the official bindings, but still something that might be worth considering. |
|
New revision with minor typo fixes. One thing that needs to be done is reorganization of the Definitions section in conjunction with implementing Definitions section in the base standard #187. |
|
Sorry hit the close button by mistake. |
ax3l
left a comment
There was a problem hiding this comment.
Added a few more inline notes on consistent style and markdown.
Just for consistency with existing extensions (e.g. ED-PIC please keep spellings similar. Examples:
- lowercase
type:,description:,example:... in keywords scope:for required/optional
|
Note: There is a conflict with |
|
@DavidSagan but you only use |
|
|
||
| - `fileType` | ||
| - Type: Optional *(string)* | ||
| - Description: The type of data being stored in the file. If present, must be set to `openPMD`. This attribute is used in systems where different data files can contain different types of data and allows for quick identification of the what type of data is in a given file. |
There was a problem hiding this comment.
maybe I missed it, but isn't this already possible to be quickly identified with the base standard identifier, attribute openPMD in /?
There was a problem hiding this comment.
But a non-openPMD file will not have the openPMD attribute.
There was a problem hiding this comment.
I am confused how this is useful for files that use openPMD and the openPMD extension :)
There was a problem hiding this comment.
It is useful for readers that can read a variety of data types including openPMD.
There was a problem hiding this comment.
This already looks very good to me. 🚀 ✨
@DavidSagan please just address the introduction section comments to unify the style with the other extension.
Then, please squash your commits into one:
git fetch --all
git rebase -i origin/upcoming-2.0.0
# change all but the first commit to "squash" instead of "pick"
git push -f@ChristopherMayes and @RemiLehe can you give this your blessing already? :) Comments, wishes?
|
|
||
| The `BeamPhysics` extension to the openPMD standard is meant for describing particles and fields commonly encountered in accelerator physics simulations. | ||
|
|
||
| How to Use this Extension |
There was a problem hiding this comment.
We potentially do not need this paragraph on technical usage ("how specify the attribute") since the base standard explains this already.
Instead, we can write an introduction here and the requirement to co-use the extension with SpeciesType.
There was a problem hiding this comment.
@ax3l I'm not exactly sure what you are thinking about here. Could you write a proposed change?
There was a problem hiding this comment.
No problem, can you squash all commits first please?
|
|
||
| where `Z` is the complex field, `f` is the Oscillation frequency, `t` is the time, and `t0` is a reference time. | ||
|
|
||
| Software that writes complex data must use native complex storage for formats that support complex numbers. For formats that do not have native complex support (for example, HDF5), complex numbers are to be stored using subgroups labeled `r` and `i` for real and imaginary respectively. |
There was a problem hiding this comment.
I would change this to:
| Software that writes complex data must use native complex storage for formats that support complex numbers. For formats that do not have native complex support (for example, HDF5), complex numbers are to be stored using subgroups labeled `r` and `i` for real and imaginary respectively. | |
| Software that writes complex data must use native complex storage for formats that support complex numbers. | |
| For formats that do not have native complex support (for example, HDF5), complex numbers are to be stored using value pairs for real and imaginary component and shall follow the `h5py` convention for annotations. |
Example code:
import h5py as h5
import numpy as np
x = np.array([1.+2j, 3.+4j, 5.+6j], np.cdouble)
x
# array([1.+2.j, 3.+4.j, 5.+6.j])
x.dtype
# dtype('complex128')
f = h5.File('complex.h5', 'w')
f['/mydata'] = x
f.close()Creates:
$ h5ls -d -r complex.h5
/ Group
/mydata Dataset {3}
Data:
(0) {1, 2}, {3, 4}, {5, 6}
$ h5dump complex.h5
HDF5 "complex.h5" {
GROUP "/" {
DATASET "mydata" {
DATATYPE H5T_COMPOUND {
H5T_IEEE_F64LE "r";
H5T_IEEE_F64LE "i";
}
DATASPACE SIMPLE { ( 3 ) / ( 3 ) }
DATA {
(0): {
1,
2
},
(1): {
3,
4
},
(2): {
5,
6
}
}
}
}
}I think this totally works well and corresponds to what I suggest here: #29 (comment)
|
Before we merge this: |
|
offline/zoom discussed: we don't need to squash and rebase, I will just |
ax3l
left a comment
There was a problem hiding this comment.
The extension looks like it is in great shape. Thank you for the work on this and the contribution!
@ChristopherMayes @RemiLehe, if you confirm, I would target a merge today. Otherwise if you have further comments early next week. What do you think?
|
@marcguetg just as a notification to you: we plan to merge the beam-physics extension |
Looks like all points have been addressed from this review. Please don't hesitate to note if something new slipped in, in which case we can open a follow-up PR.
This is the new proposed
Beam Physicsextension for describing particle beams in accelerators, storage rings, etc.CC @ChristopherMayes