PublishedLine#

MemberKindWhat it is
pairpropertyReturn what the line is the latest state of: a delivered file, or a copy.
to_dictmethodReturn the line as JSON, without the members it does not carry.
to_tomlmethodSerialize this config to a TOML file filtered by *profile*.
model_configattributeSignature only
model_refused_keysattributeKeys this model no longer accepts, mapped to what to write instead.
model_switch_writtenattributeWhether a written table of this model must write its enabled switch.
class PublishedLine(
*,
schema='hydromodpy.published.v2',
kind,
published_at,
to=None,
format=None,
publication_sha256=None,
file=None,
destination=None,
state=None,
sha256=None,
bytes=None,
attempts=None,
error=None,
)[source]#

One line of published.jsonl: where a copy went, or where a file goes.

A copy line records a copy of the run or the summary, once it is written. A delivery line records one file of the run sent to one destination, and what became of it.

to_dict()[source]#

Return the line as JSON, without the members it does not carry.

to_toml(path, *, profile='user', written_only=False)[source]#

Serialize this config to a TOML file filtered by profile.

Round-trip guarantee: when profile="expert" is used on a fully resolved HydroModPyConfig, calling HydroModPyConfig.from_toml() on the written path yields an equivalent config.

Parameters:
  • path (str | Path) – Destination TOML file path.

  • profile (Literal['user', 'dev', 'expert']) – One of "user", "dev", "expert". Fields whose Profile exceeds the requested profile are omitted.

  • written_only (bool) – Keep only the fields this config was given, so the file reads back with the same fields set.

attempts: int | None#
bytes: int | None#
destination: str | None#
error: str | None#
file: str | None#
format: PublicationFormat | None#
kind: PublishedKind#
model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'ser_json_inf_nan': 'strings', 'str_strip_whitespace': True, 'validate_assignment': True, 'validate_default': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_refused_keys = {}#

Keys this model no longer accepts, mapped to what to write instead.

For a key that no step ever read, or that did the job of another key. No run can depend on it, so it is refused rather than accepted and ignored: the message names the key and the advice says which key does the job.

model_switch_written = False#

Whether a written table of this model must write its enabled switch.

For a table that is always there, off by default, so enabled keeps a default. Once the file writes any key of it, it writes the switch too, and the table never switches a step on or off by itself.

property pair: tuple[str, str][source]#

a delivered file, or a copy.

Type:

Return what the line is the latest state of

publication_sha256: str | None#
published_at: datetime#
schema_: str#
sha256: str | None#
state: DeliveryState | None#
to: str | None#