Create campaigns of EPOCH plasma PIC code runs over a given parameter space using various sampling methods.
Project description
epyscan
Epyscan (short for EPOCH Python scan) generates EPOCH campaigns over a parameter space using different sampling methods. Part of BEAM (Broad EPOCH Analysis Modules).
Installation
Install from PyPI with:
pip install epyscan
or from a local checkout:
git clone https://github.com/epochpic/epyscan.git
cd epyscan
pip install .
We recommend switching to uv to manage packages.
Usage
Parameter space to be sampled is described by a dict where keys
should be in the form of block_name:parameter, and values should
be dicts with the following keys:
"min": minimum value of the parameter"max": maximum value of the parameter"log": (optional)bool, ifTruethen grid is done in log space for this parameter
import pathlib
import epyscan
import epydeck
# Define the parameter space to be sampled. Here, we are varying the intensity
# and density
parameters = {
# Intensity varies logarithmically between 1.0e22 and 1.0e24
"constant:intens": {"min": 1.0e22, "max": 1.0e24, "log": True},
# Density varies logarithmically between 1.0e20 and 1.0e24
"constant:nel": {"min": 1.0e20, "max": 1e24, "log": True},
}
# Load a deck file to use as a template for the simulations
with open("template_deck_filename") as f:
deck = epydeck.load(f)
# Create a grid scan object that will generate 4 different sets of parameters
# within the specified ranges
grid_scan = epyscan.GridScan(parameters, n_samples=4)
# Define the root directory where the simulation folders will be saved.
# This directory will be created if it doesn't exist
run_root = pathlib.Path("example_campaign")
# Initialize a campaign object with the template deck and the root directory.
# This will manage the creation of simulation cases
campaign = epyscan.Campaign(deck, run_root)
# Generate the folders and deck files for each set of parameters in the
# grid scan
paths = [campaign.setup_case(sample) for sample in grid_scan]
# Save the paths of the generated simulation folders to a file
with open("paths.txt", "w") as f:
[f.write(f"{path}\n") for path in paths]
# Opening paths.txt
# example_campaign/run_0_1000000/run_0_10000/run_0_100/run_0
# example_campaign/run_0_1000000/run_0_10000/run_0_100/run_1
# example_campaign/run_0_1000000/run_0_10000/run_0_100/run_2
# ...
Citing
If epyscan contributes to a project that leads to publication, please acknowledge this by citing epyscan. 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 epyscan-0.3.0.tar.gz.
File metadata
- Download URL: epyscan-0.3.0.tar.gz
- Upload date:
- Size: 185.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ad2d4ff15cecf4fc10a977578a36d0d27dba549c71bc40197942a6213224c1e
|
|
| MD5 |
fdf9b80fca7977a11d59f5d8b95a9860
|
|
| BLAKE2b-256 |
84eadb63dc6b5ac729cb3ecb9d3f6ce097ed19c7107c0ca118d3506c4ca6d8e1
|
Provenance
The following attestation bundles were made for epyscan-0.3.0.tar.gz:
Publisher:
build_publish.yml on epochpic/epyscan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epyscan-0.3.0.tar.gz -
Subject digest:
3ad2d4ff15cecf4fc10a977578a36d0d27dba549c71bc40197942a6213224c1e - Sigstore transparency entry: 506234860
- Sigstore integration time:
-
Permalink:
epochpic/epyscan@89b742b7eb54f5247ad43c1b3ec4db9eeda8c64c -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/epochpic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_publish.yml@89b742b7eb54f5247ad43c1b3ec4db9eeda8c64c -
Trigger Event:
push
-
Statement type:
File details
Details for the file epyscan-0.3.0-py3-none-any.whl.
File metadata
- Download URL: epyscan-0.3.0-py3-none-any.whl
- Upload date:
- Size: 31.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
360863b24d9321a902257000994bef614cf78e7f4c705cabb9d03fedd1679452
|
|
| MD5 |
0e1e7ef2efed3a41965658e34d5782e3
|
|
| BLAKE2b-256 |
da60f802307077a648444927f13e888123ce831333aa2d648b3459abeb3bb772
|
Provenance
The following attestation bundles were made for epyscan-0.3.0-py3-none-any.whl:
Publisher:
build_publish.yml on epochpic/epyscan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epyscan-0.3.0-py3-none-any.whl -
Subject digest:
360863b24d9321a902257000994bef614cf78e7f4c705cabb9d03fedd1679452 - Sigstore transparency entry: 506234871
- Sigstore integration time:
-
Permalink:
epochpic/epyscan@89b742b7eb54f5247ad43c1b3ec4db9eeda8c64c -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/epochpic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_publish.yml@89b742b7eb54f5247ad43c1b3ec4db9eeda8c64c -
Trigger Event:
push
-
Statement type: