An EPOCH plasma PIC code input file (deck) reader/writer.
Project description
epydeck
Epydeck (short for EPOCH Python deck) is an EPOCH input file (deck) reader/writer. Part of BEAM (Broad EPOCH Analysis Modules).
Installation
Install from PyPI with:
pip install epydeck
or from local checkout:
git clone https://github.com/epochpic/epydeck.git
cd epydeck
pip install .
We recommend switching to uv to manage packages.
Usage
[!IMPORTANT] Plain numbers and bools are converted directly, everything else is represented as a string. Note that floating point numbers may have their exact form changed.
The interface follows the standard Python
json module:
epydeck.loadto read from afileobjectepydeck.loadsto read from an existing stringepydeck.dumpto write to afileobjectepydeck.dumpsto write to a string
import epydeck
# Read from a file with `epydeck.load`
with open(filename) as f:
deck = epydeck.load(f)
print(deck.keys())
# dict_keys(['control', 'boundaries', 'constant', 'species', 'laser', 'output_global', 'output', 'dist_fn'])
# Modify the deck as a usual python dict:
deck["species"]["proton"]["charge"] = 2.0
# Write to file
with open(filename, "w") as f:
epydeck.dump(deck, f)
print(epydeck.dumps(deck))
# ...
# begin:species
# name = proton
# charge = 2.0
# mass = 1836.2
# fraction = 0.5
# number_density = if((r gt ri) and (r lt ro), den_cone, 0.0)
# number_density = if((x gt xi) and (x lt xo) and (r lt ri), den_cone, number_density(proton))
# number_density = if(x gt xo, 0.0, number_density(proton))
# end:species
# ...
Further details
Reads from file into a standard Python dict. Repeated blocks, such
as species, have an extra level of nesting using the block name.
Repeated keys, such as number_density, are represented as a single
key with a list of values. For example, the following input deck:
begin:constant
lambda = 1.06 * micron
omega = 2 * pi * c / lambda
den_cone = 4.0 * critical(omega)
th = 1 * micron / 2.0
ri = abs(x - 5*micron) - sqrt(2.0) * th
ro = abs(x - 5*micron) + sqrt(2.0) * th
xi = 3*micron - th
xo = 3*micron + th
r = sqrt(y^2 + z^2)
end:constant
begin:species
name = proton
charge = 1.0
mass = 1836.2
fraction = 0.5
number_density = if((r gt ri) and (r lt ro), den_cone, 0.0)
number_density = if((x gt xi) and (x lt xo) and (r lt ri), \
den_cone, number_density(proton))
number_density = if(x gt xo, 0.0, number_density(proton))
end:species
begin:species
name = electron
charge = -1.0
mass = 1.0
fraction = 0.5
number_density = number_density(proton)
end:species
is represented by the following dict:
{
'constant': {
'lambda': '1.06 * micron',
'omega': '2 * pi * c / lambda',
'den_cone': '4.0 * critical(omega)',
'th': '1 * micron / 2.0',
'ri': 'abs(x - 5*micron) - sqrt(2.0) * th',
'ro': 'abs(x - 5*micron) + sqrt(2.0) * th',
'xi': '3*micron - th',
'xo': '3*micron + th',
'r': 'sqrt(y^2 + z^2)',
},
'species': {
'proton': {
'name': 'proton',
'charge': 1.0,
'mass': 1836.2,
'fraction': 0.5,
'number_density': [
'if((r gt ri) and (r lt ro), den_cone, 0.0)',
'if((x gt xi) and (x lt xo) and (r lt ri), den_cone, number_density(proton))',
'if(x gt xo, 0.0, number_density(proton))'
]
},
'electron': {
'name': 'electron',
'charge': -1.0,
'mass': 1.0,
'fraction': 0.5,
'number_density': 'number_density(proton)'
}
}
}
Citing
If epydeck contributes to a project that leads to publication, please acknowledge this by citing epydeck. This can be done by clicking the "cite this repository" button located near the top right of this page.
Broad EPOCH Analysis Modules (BEAM)
BEAM is a collection of independent yet complementary open-source tools for analysing EPOCH simulations, designed to be modular so researchers can adopt only the components they require without being constrained by a rigid framework. In line with the FAIR principles — Findable, Accessible, Interoperable, and Reusable — each package is openly published with clear documentation and versioning (Findable), distributed via public repositories (Accessible), designed to follow common standards for data structures and interfaces (Interoperable), and includes licensing and metadata to support long-term use and adaptation (Reusable). The packages are as follows:
- sdf-xarray: Reading and processing SDF files and converting them to xarray.
- epydeck: Input deck reader and writer.
- epyscan: Create campaigns over a given parameter space using various sampling methods.
PlasmaFAIR
Originally developed by PlasmaFAIR, EPSRC Grant EP/V051822/1
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file epydeck-1.0.1.tar.gz.
File metadata
- Download URL: epydeck-1.0.1.tar.gz
- Upload date:
- Size: 177.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa2f72624078c3d0809cf63f126ff8a68351790c36403424c41e4c2672521ea0
|
|
| MD5 |
ad9cab61558c6aed384af001bffb45aa
|
|
| BLAKE2b-256 |
78d2033641854d70c5d2c57a9706b2307b8d7fe41050ae9d8cc76a4bd52d3c5b
|
Provenance
The following attestation bundles were made for epydeck-1.0.1.tar.gz:
Publisher:
build_publish.yml on epochpic/epydeck
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epydeck-1.0.1.tar.gz -
Subject digest:
fa2f72624078c3d0809cf63f126ff8a68351790c36403424c41e4c2672521ea0 - Sigstore transparency entry: 228754218
- Sigstore integration time:
-
Permalink:
epochpic/epydeck@73c5dfb271542e4d7e16e458bcdfd93b97d768bd -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/epochpic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_publish.yml@73c5dfb271542e4d7e16e458bcdfd93b97d768bd -
Trigger Event:
push
-
Statement type:
File details
Details for the file epydeck-1.0.1-py3-none-any.whl.
File metadata
- Download URL: epydeck-1.0.1-py3-none-any.whl
- Upload date:
- Size: 30.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e379bf3a024708adbcc0d6c0436225d5724e8ad65e0c254aaece42701b397a9
|
|
| MD5 |
d17fcaa02c6c9400ee81300f198167cf
|
|
| BLAKE2b-256 |
35412e8df3252b5f51c3d9dc8d12ab964376d37db089a5e74299acc3bf8b458e
|
Provenance
The following attestation bundles were made for epydeck-1.0.1-py3-none-any.whl:
Publisher:
build_publish.yml on epochpic/epydeck
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epydeck-1.0.1-py3-none-any.whl -
Subject digest:
6e379bf3a024708adbcc0d6c0436225d5724e8ad65e0c254aaece42701b397a9 - Sigstore transparency entry: 228754234
- Sigstore integration time:
-
Permalink:
epochpic/epydeck@73c5dfb271542e4d7e16e458bcdfd93b97d768bd -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/epochpic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_publish.yml@73c5dfb271542e4d7e16e458bcdfd93b97d768bd -
Trigger Event:
push
-
Statement type: