Skip to main content

Templated from python-copier

gsrd

A small Gray-Scott reaction-diffusion simulator, packaged as a single CLI command:

gsrd input.yaml

It reads a YAML parameter file, runs a 2D reaction-diffusion integration, and writes the final fields to results.npz in the current directory.

Purpose

gsrd is built as the running example for a workflow-engine tutorial. Its interface is deliberately designed to emulate the conventions and quirks of real-world scientific codes — the kind of legacy tooling that workflow managers typically wrap. This makes it a realistic teaching target: many of the integration issues users encounter when wrapping established scientific software can be demonstrated here in a small, self-contained Python package.

Design choices

Aspect Behaviour Mirrors
Invocation Single positional argument, no flags, no --help Minimal-CLI binaries from the Fortran era
Output location Hardcoded ./results.npz in the working directory Codes that write fixed-name files
Stdout Verbose startup banner, citation block, progress lines, formatted diagnostics Standard scientific-code log output
Scalar results Printed to stdout only (variance_V, mean_V); not stored in the output file Codes whose key numbers must be parsed from the log
Array results Written to results.npz (U_final, V_final) Binary outputs alongside textual logs
Parameter echo Required keys printed; extra YAML keys silently retained in the output's params record Tolerant input parsers with no schema enforcement
Restart mechanism If init/U_init.npy and init/V_init.npy exist in the working directory, they are used as initial fields Codes that pick up restart files from the run directory
Error reporting Short stderr message (ERR: ...); exit code is always 0; success is signalled by a JOB DONE marker on stdout Codes whose exit codes are not reliably informative
No-arguments behaviour Prints the banner and waits on stdin "Waiting for input" pattern of interactive scientific binaries

These are intentional design choices for pedagogical value, not bugs. The point is to give users a realistic surface to practise wrapping: parsing log output, handling fixed-name files, providing restart inputs, dealing with uninformative exit codes, and validating input schemas at the workflow layer rather than relying on the code itself.

Input format

A YAML file with the following keys:

F: 0.04          # feed rate
k: 0.065         # kill rate
du: 0.16         # diffusion coefficient of U
dv: 0.08         # diffusion coefficient of V
dt: 1.0          # time step
grid_size: 64    # grid is grid_size x grid_size
n_steps: 3000    # number of integration steps
seed: 42         # (optional) RNG seed

Output

On success, results.npz contains:

  • U_final, V_final — final concentration fields, shape (grid_size, grid_size)
  • params — the parameters as a JSON-serialised string

Scalar diagnostics (variance_V, mean_V) appear on stdout in the Diagnostics block; they are not written to the output file.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gsrd-0.2.0.tar.gz (310.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gsrd-0.2.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file gsrd-0.2.0.tar.gz.

File metadata

  • Download URL: gsrd-0.2.0.tar.gz
  • Upload date:
  • Size: 310.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gsrd-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e09d2133de0e7871eb3e1411c98b31777b659026f732a290194b72a85c67c641
MD5 c2163936219a1e7f740983fc0b27fb81
BLAKE2b-256 a6bb462757a2c6a3a999be175689d865a15389ad4fb835064e384fb06ea4a532

See more details on using hashes here.

Provenance

The following attestation bundles were made for gsrd-0.2.0.tar.gz:

Publisher: cd.yaml on aiidateam/gsrd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gsrd-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: gsrd-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gsrd-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e7a81488916429115139835b9d2cf876c3d6eed3a47514d06a61892aaf38a36
MD5 8a818aa6ce0d9a22cbff0ba84d8bdd24
BLAKE2b-256 c84554ec68304c93dc626b2dd03101f08a2b9fd56699649b01af75e107841fd9

See more details on using hashes here.

Provenance

The following attestation bundles were made for gsrd-0.2.0-py3-none-any.whl:

Publisher: cd.yaml on aiidateam/gsrd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page