BaseWriter.write#
- BaseWriter.write(obj: Dataset | DataTree, path: Path | str) str[source]#
Public entrypoint: write an object to
path.Orchestration is the same for every format:
can_write()- refuse early, with a reason the user can act oncheck_conformance()- CF-1.8 / ACDD / controlled vocabularyprovenance - append to
historyandeoio:processing_stepsencode_attrs()- make attributes serialisablewrite_dataset()- the format-specific part
Provenance is added before encoding and writing, so that it ends up in the written file rather than only on a discarded in-memory copy.
The input object is never modified.
- Parameters:
obj – Dataset or DataTree to write.
path – Destination path.
- Returns:
The path written, as a string.
- Raises:
TypeError – If this writer cannot express
obj.