geopulse.config

YAML configuration loader for GeoPulse pipelines.

Uses Python dataclasses for the schema — deliberately NO pydantic / hydra / dynaconf, to keep the core dependency list minimal (see Section 14 of the handoff spec).

The top-level document must have a single geopulse: key. Example:

geopulse:
  source:
    type: synthetic
    waveform: gaussian_pulse
    amplitude_nT: 500.0
    duration_s: 3600.0
    dt_s: 1.0
  earth:
    type: layered_1d
    model: quebec_7layer
  network:
    type: powergrid
    file: benchmarks/horton2012/network.json
  solver:
    type: lpm
  output:
    file: results.hdf5
    format: hdf5

Functions

load_config(path)

Load a YAML pipeline config from disk.

Classes

EarthConfig(type[, model, file])

Earth-model section.

GeoPulseConfig(source, earth, network, ...)

Top-level GeoPulse configuration.

NetworkConfig(type[, file])

Network section.

OutputConfig([file, format])

Output section.

SolverConfig([type, options])

Solver section.

SourceConfig(type[, waveform, amplitude_nT, ...])

B-field source section.

class geopulse.config.SourceConfig(type, waveform=None, amplitude_nT=0.0, duration_s=0.0, dt_s=1.0, file=None, station_id='SYN')[source]

Bases: object

B-field source section.

Parameters:
type: str
waveform: str | None = None
amplitude_nT: float = 0.0
duration_s: float = 0.0
dt_s: float = 1.0
file: str | None = None
station_id: str = 'SYN'
class geopulse.config.EarthConfig(type, model=None, file=None)[source]

Bases: object

Earth-model section.

Parameters:
  • type (str)

  • model (str | None)

  • file (str | None)

type: str
model: str | None = None
file: str | None = None
class geopulse.config.NetworkConfig(type, file=None)[source]

Bases: object

Network section.

Parameters:
  • type (str)

  • file (str | None)

type: str
file: str | None = None
class geopulse.config.SolverConfig(type='lpm', options=<factory>)[source]

Bases: object

Solver section.

Parameters:
type: str = 'lpm'
options: dict
class geopulse.config.OutputConfig(file='results.hdf5', format='hdf5')[source]

Bases: object

Output section.

Parameters:
file: str = 'results.hdf5'
format: str = 'hdf5'
class geopulse.config.GeoPulseConfig(source, earth, network, solver, output)[source]

Bases: object

Top-level GeoPulse configuration.

Parameters:
source: SourceConfig
earth: EarthConfig
network: NetworkConfig
solver: SolverConfig
output: OutputConfig
classmethod from_dict(data)[source]

Build a GeoPulseConfig from a plain nested dict.

Parameters:

data (dict[str, Any]) – The parsed YAML content (either the root or its geopulse: child, both accepted).

Raises:

ConfigurationError – If required top-level sections are missing.

Return type:

GeoPulseConfig

geopulse.config.load_config(path)[source]

Load a YAML pipeline config from disk.

Parameters:

path (str | Path) – Path to a .yaml / .yml file.

Return type:

GeoPulseConfig

Returns:

GeoPulseConfig – Parsed and validated config.

Raises:

ConfigurationError – If the file does not exist or fails validation.