-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make `species_name` optional in openPMD reader * Increase version number * Add method to list species in openPMD file * Add method to list species in openpmd file
- Loading branch information
Showing
3 changed files
with
38 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from .data_analysis import beam_diagnostics | ||
|
||
__version__ = "0.1.24" | ||
__version__ = "0.1.25" | ||
__all__ = ['beam_diagnostics', '__version__'] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" Defines utilities for the data handling modules """ | ||
import openpmd_api as io | ||
|
||
|
||
def get_available_species(file_path): | ||
"""Get a list of available species in an openPMD file. | ||
Parameters | ||
---------- | ||
file_path : str | ||
Path of the openPMD file. | ||
Returns | ||
------- | ||
list | ||
A list of strings with the names of the available species. | ||
""" | ||
series = io.Series(file_path, io.Access.read_only) | ||
i = list(series.iterations)[0] | ||
iteration = series.iterations[i] | ||
|
||
return list(iteration.particles) |