epydeck

EPOCH input file reader/writer

https://github.com/epochpic/epydeck

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.4%) to scientific vocabulary

Scientific Fields

Engineering Computer Science - 60% confidence
Last synced: 6 months ago · JSON representation ·

Repository

EPOCH input file reader/writer

Basic Info
  • Host: GitHub
  • Owner: epochpic
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 192 KB
Statistics
  • Stars: 3
  • Watchers: 4
  • Forks: 1
  • Open Issues: 1
  • Releases: 1
Created almost 2 years ago · Last pushed 9 months ago
Metadata Files
Readme Citation

README.md

epydeck

PyPI Build/Publish Tests DOI

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:

bash pip install epydeck

or from local checkout:

bash 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.load to read from a file object
  • epydeck.loads to read from an existing string
  • epydeck.dump to write to a file object
  • epydeck.dumps to write to a string

```python import epydeck

Read from a file with epydeck.load

with open(filename) as f: deck = epydeck.load(f)

print(deck.keys())

dictkeys(['control', 'boundaries', 'constant', 'species', 'laser', 'outputglobal', '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

numberdensity = if((r gt ri) and (r lt ro), dencone, 0.0)

numberdensity = if((x gt xi) and (x lt xo) and (r lt ri), dencone, number_density(proton))

numberdensity = if(x gt xo, 0.0, numberdensity(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: ```text 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`: ```python { '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 logo

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

PlasmaFAIR logo

Originally developed by PlasmaFAIR, EPSRC Grant EP/V051822/1

Owner

  • Name: epochpic
  • Login: epochpic
  • Kind: organization

Citation (CITATION.cff)

cff-version: 1.2.0
title: 'epydeck: EPOCH input file reader/writer'
message: 'If you use this software, please cite it using the metadata from this file.'
type: software
repository-code: 'https://github.com/epochpic/epydeck'
authors:
  - family-names: Hill
    given-names: Peter
    orcid: 'https://orcid.org/0000-0003-3092-1858'
    affiliation: University of York
  - family-names: Adams
    given-names: Joel L.
    orcid: 'https://orcid.org/0009-0005-4889-5231'
    affiliation: University of York
date-released: '2024-04-22'

GitHub Events

Total
  • Issues event: 2
  • Delete event: 2
  • Issue comment event: 3
  • Member event: 3
  • Push event: 1
  • Pull request event: 2
  • Pull request review event: 2
  • Create event: 1
Last Year
  • Issues event: 2
  • Delete event: 2
  • Issue comment event: 3
  • Member event: 3
  • Push event: 1
  • Pull request event: 2
  • Pull request review event: 2
  • Create event: 1