graph-et [grɑːf iː.tiː.]
dask and xarray based library for loading particle-in-cell simulation data produced by a variety of different codes. The support for arbitrary codes is provided through the so-called plugins. Currently supported (and planned) codes include:
- Tristan v1
- Tristan v2
Usage example
from graphet import Data, Dashboard
from graphet.plugins import TristanV2
# to monitor usage etc using a locally hosted dashboard
Dashboard()
# load the metadata using the TristanV2 plugin
d = Data(
TristanV2, # plugin
steps=range(150), # steps to load metadata for
path=f"output/", # path to the data
cfg_fname=f"input.cfg", # configuration file
params=True, # read configuration file
coord_transform={ # time/coordinate transformation
"t": lambda t, prm: t * prm["output:interval"] * prm["algorithm:c"] / prm["grid:my0"],
"x": lambda x, prm: (x - x.mean()) / prm["grid:my0"],
"z": lambda z, prm: (z - z.mean()) / prm["grid:my0"],
"y": lambda y, prm: (y - y.mean()) / prm["grid:my0"],
},
swapaxes=[(0, 1), (2, 1)], # axes swapping "zyx" -> "yxz"
)
# main containers are
d.fields # <- fields
d.particles # <- particles
d.spectra # <- spectra
## Examples of doing useful stuff
# plot averaged spectra of species #2 between 1.5 < t < 2.2
d.spectra.n2.sel(t=slice(1.5, 2.2)).mean("t").plot()
# plot the density of species #1 and #2 at time t = 2.5 and y = 0.1
(d.fields.dens1 + d.fields.dens2).sel(y=0.1, t=2.5, method="nearest").plot(cmap="turbo")
# compute the distribution function from the particle data for species #3 at 1.5 < t < 2.2
cnt, _ = np.histogram(
(np.sqrt(1 + d.particles[3].u ** 2 + d.particles[3].v ** 2 + d.particles[3].w ** 2) - 1)
.sel(t=slice(1.5, 2.2)).mean("t"),
bins=np.logspace(-1, 3, 100),
)
# to track the energy of a single particle of species #2 with, e.g., idx = 13500000000000, across timesteps
prtl = d.particles[2].sel(idx=13500000000000)
np.sqrt(1.0 + prtl.u**2 + prtl.v**2 + prtl.w**2).plot()
Todo
- Add support for
TristanV1plugin - Coordinate transformations for particles
- Support for coordinate swapping in field names
- Support for custom defined fields
Metadata
Release files for graph-et 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| graph_et-0.1.4.tar.gz | 1.5 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| graph_et-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.0 MB
Release files / graph_et-0.1.4.tar.gz
| Download URL | graph_et-0.1.4.tar.gz |
|---|---|
| Size | 1.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e877689f295d5f0050848bf6aacc70a550dd0d7916f7088a56ede8725ba595fe
|
|
BLAKE2b-256 checksum How to use checksums |
6e424e07a98a77eed631bc6b9b0c09f27952550100d29abca90fdf5945af3751
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / graph_et-0.1.4-py3-none-any.whl
| Download URL | graph_et-0.1.4-py3-none-any.whl |
|---|---|
| Size | 1.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c38e788ac3935370a04a602ab6cdc42cd6cfd9c6e378c8571da8e836475a642
|
|
BLAKE2b-256 checksum How to use checksums |
24043629663539af4702debdcb9c491679a61c62da32d5fa3b8847151a80bfed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for graph-et 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.