sequence.output_writer module#

Write a SequenceModelGrid to a file.

class sequence.output_writer.OutputWriter(*args, **kwds)[source]#

Bases: Component

Write output to a netcdf file.

__init__(grid: SequenceModelGrid, filepath: str | PathLike[str], interval: int = 1, fields: Iterable[str] | None = None, clobber: bool = False, rows: Iterable[str] | None = None)[source]#

Create an output-file writer.

Parameters:
  • grid (SequenceModelGrid) – The grid to write to a file.

  • filepath (path-like) – Path to the output file.

  • interval (int, optional) – The number of time steps between updates to the output file.

  • fields (list of str, optional) – Names of (at-node) fields to include in the output file.

  • clobber (bool, optional) – If True and the provided file already exists, quietly overwrite it, otherwise raise an exception.

  • rows (iterable of int) – The rows of the grid to include in the file.

property fields: Iterable[str]#

Return the names of the fields to include in the output file.

property filepath: str | PathLike[str]#

Return the path to the output file.

property interval: int#

Return the interval for which output will be written.

run_one_step(dt: float | None = None) None[source]#

Update the writer by a time step.

Parameters:

dt (float, optional) – The time step to update the component by.