Skip to content

Writer

Writer

Bases: ABC

Base class for all writers.

checks()

Optional pre-flight checks (e.g. dependencies). Override if needed.

prepare(*args, **kwargs)

Load files, open handles, build FSM state, etc. Return a dict representing the full parsing context.

run(prj, ens_id, run_id, writer_args=None, writer_kwargs=None)

Write data for a single ensemble run.

PARAMETER DESCRIPTION

prj

Project to store all extracted data to.

TYPE: Project

ens_id

ID of this ensemble. This function will create the ensemble if it does not exist in prj.

TYPE: str

writer_args

Arguments for preparing the context needed for the writer.

TYPE: tuple[Any] | None DEFAULT: None

writer_kwargs

Keyword arguments for preparing the context needed for the writer.

TYPE: dict[str, Any] | None DEFAULT: None