nannyml.io.raw_files_writer module

class nannyml.io.raw_files_writer.RawFilesWriter(path: str, format: str, write_args: Optional[Dict[str, Any]] = None, credentials: Optional[Dict[str, Any]] = None, fs_args: Optional[Dict[str, Any]] = None)[source]

Bases: FileWriter

A Writer implementation that dumps the Result contents (data and plots) on disk (local/remote/cloud).

Creates a new RawFilesWriter instance

Parameters:
  • path (str) – The directory to write the results in. Each Result being written there will end create its own subdirectory. Each of those will contain data and plots subdirectories.

  • format (str) – The file format for the data export. Should be one of parquet or csv.

  • write_args (Dict[str, Any]) – Specific arguments passed along the method performing the actual writing.

  • credentials (Dict[str, Any]) – Used to provide credential information following specific fsspec implementations.

  • fs_args – Specific arguments passed along to the fsspec filesystem initializer.

Examples

>>> writer = RawFilesWriter(path='/output', format="parquet")
>>> # plots is a Dictionary mapping a plot name to a plotly Figure
>>> # this is some legacy stuff to be cleaned up
>>> writer.write(result, plots={}, calculator_name='test')