pelagos_py.steps.input_output.format_check#

pelagos_py.steps.input_output.format_check.console_summary(checker_name, result, passed)[source]#

Build a compact console summary for one checker’s result.

Parameters:
  • checker_name (str) – The checker that produced result (e.g. "og").

  • result (dict) – A single checker’s CheckSuite.dict_output() dict.

  • passed (bool) – Whether the dataset passed this checker at the chosen strictness.

Returns:

Lines to log. Kept deliberately short: a pass/fail header, the missing mandatory global attributes and variables, then a count of everything else so the console is not flooded with detail (that goes to the file).

Return type:

list of str

class pelagos_py.steps.input_output.format_check.FormatCheck(name, parameters=None, diagnostics=False, context=None)[source]#

Bases: pelagos_py.steps.base_step.BaseStep

Run the IOOS file-format compliance checker and report the result.

Does not run on the in-memory dataset; it re-reads the file from disk (its own loading routine). A short pass/fail summary is always printed to the console. JSON and/or RST report files are written only when requested via output_type and an out_directory is set.

Parameters:
  • src (path or str, optional) – File to check. If omitted, falls back to the file loaded by a preceding Load OG1 step.

  • standards (list of str) – Standards to check, e.g. ['cf', 'og'] (og = OG1).

  • output_type (str or list of str, optional) – Report file(s) to save in addition to the console summary: 'json', 'rst', or a list of both. Omit (default) for console only. Saving requires out_directory to be set in the pipeline config.

  • proceed_on_fail (bool) – If False, halt the pipeline when the file fails the checks.