dgbowl_schemas.dgpost.recipe_2_1 package

pydantic model dgbowl_schemas.dgpost.recipe_2_1.Recipe

Bases: BaseModel

A pydantic.BaseModel implementing Recipe-2.1 model for dgpost.

Show JSON schema
{
   "title": "Recipe",
   "description": "A :class:`pydantic.BaseModel` implementing ``Recipe-2.1`` model for :mod:`dgpost`.",
   "type": "object",
   "properties": {
      "version": {
         "const": "2.1",
         "enum": [
            "2.1"
         ],
         "title": "Version",
         "type": "string"
      },
      "load": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Load"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Load"
      },
      "extract": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Extract"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Extract"
      },
      "pivot": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Pivot"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Pivot"
      },
      "transform": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Transform"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Transform"
      },
      "plot": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Plot"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Plot"
      },
      "save": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Save"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Save"
      }
   },
   "$defs": {
      "At": {
         "additionalProperties": false,
         "properties": {
            "steps": {
               "default": null,
               "items": {
                  "type": "string"
               },
               "title": "Steps",
               "type": "array"
            },
            "indices": {
               "default": null,
               "items": {
                  "type": "integer"
               },
               "title": "Indices",
               "type": "array"
            },
            "timestamps": {
               "default": null,
               "items": {
                  "type": "number"
               },
               "title": "Timestamps",
               "type": "array"
            }
         },
         "title": "At",
         "type": "object"
      },
      "AxArgs": {
         "additionalProperties": true,
         "properties": {
            "cols": {
               "anyOf": [
                  {
                     "maxItems": 2,
                     "minItems": 2,
                     "prefixItems": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "integer"
                        }
                     ],
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Cols"
            },
            "rows": {
               "anyOf": [
                  {
                     "maxItems": 2,
                     "minItems": 2,
                     "prefixItems": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "integer"
                        }
                     ],
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Rows"
            },
            "series": {
               "items": {
                  "$ref": "#/$defs/Series"
               },
               "title": "Series",
               "type": "array"
            },
            "methods": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Methods"
            },
            "legend": {
               "default": false,
               "title": "Legend",
               "type": "boolean"
            }
         },
         "required": [
            "series"
         ],
         "title": "AxArgs",
         "type": "object"
      },
      "Column": {
         "additionalProperties": false,
         "properties": {
            "key": {
               "title": "Key",
               "type": "string"
            },
            "as": {
               "title": "As",
               "type": "string"
            }
         },
         "required": [
            "key",
            "as"
         ],
         "title": "Column",
         "type": "object"
      },
      "Constant": {
         "additionalProperties": false,
         "properties": {
            "value": {
               "title": "Value"
            },
            "as": {
               "title": "As",
               "type": "string"
            },
            "units": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Units"
            }
         },
         "required": [
            "value",
            "as"
         ],
         "title": "Constant",
         "type": "object"
      },
      "Extract": {
         "additionalProperties": false,
         "description": "Extract columns from loaded files into tables, interpolate as necessary.",
         "properties": {
            "into": {
               "title": "Into",
               "type": "string"
            },
            "from": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "From"
            },
            "at": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/At"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "columns": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Column"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Columns"
            },
            "constants": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Constant"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Constants"
            }
         },
         "required": [
            "into"
         ],
         "title": "Extract",
         "type": "object"
      },
      "Load": {
         "additionalProperties": false,
         "description": "Select external files (``NetCDF`` or ``json`` datagrams, ``pkl`` tables) to load.",
         "properties": {
            "as": {
               "title": "As",
               "type": "string"
            },
            "path": {
               "title": "Path",
               "type": "string"
            },
            "type": {
               "default": "datagram",
               "enum": [
                  "netcdf",
                  "datagram",
                  "table"
               ],
               "title": "Type",
               "type": "string"
            },
            "check": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Check"
            }
         },
         "required": [
            "as",
            "path"
         ],
         "title": "Load",
         "type": "object"
      },
      "Pivot": {
         "additionalProperties": false,
         "description": "Reorder tables by grouping rows into arrays using columns as indices.",
         "properties": {
            "table": {
               "title": "Table",
               "type": "string"
            },
            "as": {
               "title": "As",
               "type": "string"
            },
            "using": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  }
               ],
               "title": "Using"
            },
            "columns": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Columns"
            },
            "timestamp": {
               "default": "first",
               "enum": [
                  "first",
                  "last",
                  "mean"
               ],
               "title": "Timestamp",
               "type": "string"
            },
            "timedelta": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Timedelta"
            }
         },
         "required": [
            "table",
            "as",
            "using"
         ],
         "title": "Pivot",
         "type": "object"
      },
      "Plot": {
         "additionalProperties": false,
         "description": "Plot data from a single table.",
         "properties": {
            "table": {
               "title": "Table",
               "type": "string"
            },
            "nrows": {
               "default": 1,
               "title": "Nrows",
               "type": "integer"
            },
            "ncols": {
               "default": 1,
               "title": "Ncols",
               "type": "integer"
            },
            "fig_args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Fig Args"
            },
            "ax_args": {
               "items": {
                  "$ref": "#/$defs/AxArgs"
               },
               "title": "Ax Args",
               "type": "array"
            },
            "style": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Style"
            },
            "save": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PlotSave"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "required": [
            "table",
            "ax_args"
         ],
         "title": "Plot",
         "type": "object"
      },
      "PlotSave": {
         "additionalProperties": true,
         "properties": {
            "as": {
               "title": "As",
               "type": "string"
            },
            "tight_layout": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Tight Layout"
            }
         },
         "required": [
            "as"
         ],
         "title": "PlotSave",
         "type": "object"
      },
      "Save": {
         "additionalProperties": false,
         "description": "Save a table into an external (``pkl``, ``xlsx``) file.",
         "properties": {
            "table": {
               "title": "Table",
               "type": "string"
            },
            "as": {
               "title": "As",
               "type": "string"
            },
            "type": {
               "anyOf": [
                  {
                     "enum": [
                        "pkl",
                        "json",
                        "xlsx",
                        "csv",
                        "nc"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Type"
            },
            "columns": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Columns"
            },
            "sigma": {
               "default": true,
               "title": "Sigma",
               "type": "boolean"
            }
         },
         "required": [
            "table",
            "as"
         ],
         "title": "Save",
         "type": "object"
      },
      "Series": {
         "additionalProperties": true,
         "properties": {
            "y": {
               "title": "Y",
               "type": "string"
            },
            "x": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "X"
            },
            "kind": {
               "default": "scatter",
               "enum": [
                  "scatter",
                  "line",
                  "errorbar"
               ],
               "title": "Kind",
               "type": "string"
            },
            "index": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SeriesIndex"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {
                  "from_zero": true,
                  "to_units": null
               }
            }
         },
         "required": [
            "y"
         ],
         "title": "Series",
         "type": "object"
      },
      "SeriesIndex": {
         "additionalProperties": false,
         "properties": {
            "from_zero": {
               "default": true,
               "title": "From Zero",
               "type": "boolean"
            },
            "to_units": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "To Units"
            }
         },
         "title": "SeriesIndex",
         "type": "object"
      },
      "Transform": {
         "additionalProperties": false,
         "description": "Calculate and otherwise transform the data in the tables.",
         "properties": {
            "table": {
               "title": "Table",
               "type": "string"
            },
            "with": {
               "title": "With",
               "type": "string"
            },
            "using": {
               "items": {
                  "type": "object"
               },
               "title": "Using",
               "type": "array"
            }
         },
         "required": [
            "table",
            "with",
            "using"
         ],
         "title": "Transform",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "version"
   ]
}

Config:
  • extra: str = forbid

field version: Literal['2.1'] [Required]
field load: Sequence[Load] | None = None

Select external files (NetCDF or json datagrams, pkl tables) to load.

field extract: Sequence[Extract] | None = None

Extract columns from loaded files into tables, interpolate as necessary.

field pivot: Sequence[Pivot] | None = None

Reorder tables by grouping rows into arrays using columns as indices.

field transform: Sequence[Transform] | None = None

Calculate and otherwise transform the data in the tables.

field plot: Sequence[Plot] | None = None

Plot data from a single table.

field save: Sequence[Save] | None = None

Save a table into an external (pkl, xlsx) file.

Submodules

dgbowl_schemas.dgpost.recipe_2_1.extract module

pydantic model dgbowl_schemas.dgpost.recipe_2_1.extract.At

Bases: BaseModel

Show JSON schema
{
   "title": "At",
   "type": "object",
   "properties": {
      "steps": {
         "default": null,
         "items": {
            "type": "string"
         },
         "title": "Steps",
         "type": "array"
      },
      "indices": {
         "default": null,
         "items": {
            "type": "integer"
         },
         "title": "Indices",
         "type": "array"
      },
      "timestamps": {
         "default": null,
         "items": {
            "type": "number"
         },
         "title": "Timestamps",
         "type": "array"
      }
   },
   "additionalProperties": false
}

Config:
  • extra: str = forbid

Validators:
field steps: Sequence[str] = None
Validated by:
field indices: Sequence[int] = None
Validated by:
field timestamps: Sequence[float] = None
Validated by:
validator check_one_input  »  all fields
pydantic model dgbowl_schemas.dgpost.recipe_2_1.extract.Constant

Bases: BaseModel

Show JSON schema
{
   "title": "Constant",
   "type": "object",
   "properties": {
      "value": {
         "title": "Value"
      },
      "as": {
         "title": "As",
         "type": "string"
      },
      "units": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Units"
      }
   },
   "additionalProperties": false,
   "required": [
      "value",
      "as"
   ]
}

Config:
  • extra: str = forbid

field value: Any [Required]
field as_: str [Required] (alias 'as')
field units: str | None = None
pydantic model dgbowl_schemas.dgpost.recipe_2_1.extract.Column

Bases: BaseModel

Show JSON schema
{
   "title": "Column",
   "type": "object",
   "properties": {
      "key": {
         "title": "Key",
         "type": "string"
      },
      "as": {
         "title": "As",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "key",
      "as"
   ]
}

Config:
  • extra: str = forbid

field key: str [Required]
field as_: str [Required] (alias 'as')
pydantic model dgbowl_schemas.dgpost.recipe_2_1.extract.Extract

Bases: BaseModel

Extract columns from loaded files into tables, interpolate as necessary.

Show JSON schema
{
   "title": "Extract",
   "description": "Extract columns from loaded files into tables, interpolate as necessary.",
   "type": "object",
   "properties": {
      "into": {
         "title": "Into",
         "type": "string"
      },
      "from": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "From"
      },
      "at": {
         "anyOf": [
            {
               "$ref": "#/$defs/At"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "columns": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Column"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Columns"
      },
      "constants": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Constant"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Constants"
      }
   },
   "$defs": {
      "At": {
         "additionalProperties": false,
         "properties": {
            "steps": {
               "default": null,
               "items": {
                  "type": "string"
               },
               "title": "Steps",
               "type": "array"
            },
            "indices": {
               "default": null,
               "items": {
                  "type": "integer"
               },
               "title": "Indices",
               "type": "array"
            },
            "timestamps": {
               "default": null,
               "items": {
                  "type": "number"
               },
               "title": "Timestamps",
               "type": "array"
            }
         },
         "title": "At",
         "type": "object"
      },
      "Column": {
         "additionalProperties": false,
         "properties": {
            "key": {
               "title": "Key",
               "type": "string"
            },
            "as": {
               "title": "As",
               "type": "string"
            }
         },
         "required": [
            "key",
            "as"
         ],
         "title": "Column",
         "type": "object"
      },
      "Constant": {
         "additionalProperties": false,
         "properties": {
            "value": {
               "title": "Value"
            },
            "as": {
               "title": "As",
               "type": "string"
            },
            "units": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Units"
            }
         },
         "required": [
            "value",
            "as"
         ],
         "title": "Constant",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "into"
   ]
}

Config:
  • extra: str = forbid

Validators:
field into: str [Required]

Name of a new, or existing / loaded table into which the extraction happens.

Validated by:
field from_: str | None = None (alias 'from')

Name of the source object for the extracted data.

Validated by:
field at: At | None = None

Specification of the steps (or data indices) from which data is to be extracted.

Validated by:
field columns: Sequence[Column] | None = None

Specifications for the columns to be extracted, including new headers.

Validated by:
field constants: Sequence[Constant] | None = None

Specifications for additional columns containing data constants, including units.

Validated by:
validator check_one_input  »  all fields

dgbowl_schemas.dgpost.recipe_2_1.load module

pydantic model dgbowl_schemas.dgpost.recipe_2_1.load.Load

Bases: BaseModel

Select external files (NetCDF or json datagrams, pkl tables) to load.

Show JSON schema
{
   "title": "Load",
   "description": "Select external files (``NetCDF`` or ``json`` datagrams, ``pkl`` tables) to load.",
   "type": "object",
   "properties": {
      "as": {
         "title": "As",
         "type": "string"
      },
      "path": {
         "title": "Path",
         "type": "string"
      },
      "type": {
         "default": "datagram",
         "enum": [
            "netcdf",
            "datagram",
            "table"
         ],
         "title": "Type",
         "type": "string"
      },
      "check": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Check"
      }
   },
   "additionalProperties": false,
   "required": [
      "as",
      "path"
   ]
}

Config:
  • extra: str = forbid

  • populate_by_name: bool = True

Validators:
field as_: str [Required] (alias 'as')

Name under which the loaded object will be stored in memory.

field path: str [Required]

Path to the file containing the object to be loaded.

field type: Literal['netcdf', 'datagram', 'table'] = 'datagram'

Type of the loaded object. Can be either a NetCDF file created e.g. using yadg~5.0, a datagram file in JSON format created using yadg~4.0, or a table stored in a pkl file as created by Pandas.

Validated by:
field check: bool | None = None

Deprecated since version 2.1: The check attribute of Load has been deprecated. The passed value is currently ignored, however it will cause an error in future versions of Recipe.

Validated by:
validator check_is_deprecated  »  check
validator lowercase_type  »  type

dgbowl_schemas.dgpost.recipe_2_1.pivot module

pydantic model dgbowl_schemas.dgpost.recipe_2_1.pivot.Pivot

Bases: BaseModel

Reorder tables by grouping rows into arrays using columns as indices.

Show JSON schema
{
   "title": "Pivot",
   "description": "Reorder tables by grouping rows into arrays using columns as indices.",
   "type": "object",
   "properties": {
      "table": {
         "title": "Table",
         "type": "string"
      },
      "as": {
         "title": "As",
         "type": "string"
      },
      "using": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            }
         ],
         "title": "Using"
      },
      "columns": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Columns"
      },
      "timestamp": {
         "default": "first",
         "enum": [
            "first",
            "last",
            "mean"
         ],
         "title": "Timestamp",
         "type": "string"
      },
      "timedelta": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Timedelta"
      }
   },
   "additionalProperties": false,
   "required": [
      "table",
      "as",
      "using"
   ]
}

Config:
  • extra: str = forbid

  • populate_by_name: bool = True

field table: str [Required]

The name of the table loaded in memory to be pivoted.

field as_: str [Required] (alias 'as')

The name for the resulting table for in memory storage.

field using: str | Sequence[str] [Required]

A column name (or their sequence) by which the pivoting is performed.

field columns: Sequence[str] | None = None

A sequence of column names which are to be pivoted.

field timestamp: Literal['first', 'last', 'mean'] = 'first'

Specification of the resulting timestamp for the pivoted data. For each pivoted row, the first or last timestamp can be used as index. Alternatively, the mean can be calculated and used as index.

field timedelta: str | None = None

If provided, the corresponding time deltas for the pivoted data is computed and stored under the provided column name. By default, this data is not computed.

dgbowl_schemas.dgpost.recipe_2_1.plot module

pydantic model dgbowl_schemas.dgpost.recipe_2_1.plot.SeriesIndex

Bases: BaseModel

Show JSON schema
{
   "title": "SeriesIndex",
   "type": "object",
   "properties": {
      "from_zero": {
         "default": true,
         "title": "From Zero",
         "type": "boolean"
      },
      "to_units": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "To Units"
      }
   },
   "additionalProperties": false
}

Config:
  • extra: str = forbid

field from_zero: bool = True
field to_units: str | None = None
pydantic model dgbowl_schemas.dgpost.recipe_2_1.plot.Series

Bases: BaseModel

Show JSON schema
{
   "title": "Series",
   "type": "object",
   "properties": {
      "y": {
         "title": "Y",
         "type": "string"
      },
      "x": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "X"
      },
      "kind": {
         "default": "scatter",
         "enum": [
            "scatter",
            "line",
            "errorbar"
         ],
         "title": "Kind",
         "type": "string"
      },
      "index": {
         "anyOf": [
            {
               "$ref": "#/$defs/SeriesIndex"
            },
            {
               "type": "null"
            }
         ],
         "default": {
            "from_zero": true,
            "to_units": null
         }
      }
   },
   "$defs": {
      "SeriesIndex": {
         "additionalProperties": false,
         "properties": {
            "from_zero": {
               "default": true,
               "title": "From Zero",
               "type": "boolean"
            },
            "to_units": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "To Units"
            }
         },
         "title": "SeriesIndex",
         "type": "object"
      }
   },
   "additionalProperties": true,
   "required": [
      "y"
   ]
}

Config:
  • extra: str = allow

field y: str [Required]
field x: str | None = None
field kind: Literal['scatter', 'line', 'errorbar'] = 'scatter'
field index: SeriesIndex | None = SeriesIndex(from_zero=True, to_units=None)
pydantic model dgbowl_schemas.dgpost.recipe_2_1.plot.AxArgs

Bases: BaseModel

Show JSON schema
{
   "title": "AxArgs",
   "type": "object",
   "properties": {
      "cols": {
         "anyOf": [
            {
               "maxItems": 2,
               "minItems": 2,
               "prefixItems": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "integer"
                  }
               ],
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Cols"
      },
      "rows": {
         "anyOf": [
            {
               "maxItems": 2,
               "minItems": 2,
               "prefixItems": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "integer"
                  }
               ],
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Rows"
      },
      "series": {
         "items": {
            "$ref": "#/$defs/Series"
         },
         "title": "Series",
         "type": "array"
      },
      "methods": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Methods"
      },
      "legend": {
         "default": false,
         "title": "Legend",
         "type": "boolean"
      }
   },
   "$defs": {
      "Series": {
         "additionalProperties": true,
         "properties": {
            "y": {
               "title": "Y",
               "type": "string"
            },
            "x": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "X"
            },
            "kind": {
               "default": "scatter",
               "enum": [
                  "scatter",
                  "line",
                  "errorbar"
               ],
               "title": "Kind",
               "type": "string"
            },
            "index": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SeriesIndex"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {
                  "from_zero": true,
                  "to_units": null
               }
            }
         },
         "required": [
            "y"
         ],
         "title": "Series",
         "type": "object"
      },
      "SeriesIndex": {
         "additionalProperties": false,
         "properties": {
            "from_zero": {
               "default": true,
               "title": "From Zero",
               "type": "boolean"
            },
            "to_units": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "To Units"
            }
         },
         "title": "SeriesIndex",
         "type": "object"
      }
   },
   "additionalProperties": true,
   "required": [
      "series"
   ]
}

Config:
  • extra: str = allow

field cols: Tuple[int, int] | None = None
field rows: Tuple[int, int] | None = None
field series: Sequence[Series] [Required]
field methods: Dict[str, Any] | None = None
field legend: bool = False
pydantic model dgbowl_schemas.dgpost.recipe_2_1.plot.PlotSave

Bases: BaseModel

Show JSON schema
{
   "title": "PlotSave",
   "type": "object",
   "properties": {
      "as": {
         "title": "As",
         "type": "string"
      },
      "tight_layout": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Tight Layout"
      }
   },
   "additionalProperties": true,
   "required": [
      "as"
   ]
}

Config:
  • extra: str = allow

  • populate_by_name: bool = True

field as_: str [Required] (alias 'as')
field tight_layout: Dict[str, Any] | None = None
pydantic model dgbowl_schemas.dgpost.recipe_2_1.plot.Plot

Bases: BaseModel

Plot data from a single table.

Show JSON schema
{
   "title": "Plot",
   "description": "Plot data from a single table.",
   "type": "object",
   "properties": {
      "table": {
         "title": "Table",
         "type": "string"
      },
      "nrows": {
         "default": 1,
         "title": "Nrows",
         "type": "integer"
      },
      "ncols": {
         "default": 1,
         "title": "Ncols",
         "type": "integer"
      },
      "fig_args": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Fig Args"
      },
      "ax_args": {
         "items": {
            "$ref": "#/$defs/AxArgs"
         },
         "title": "Ax Args",
         "type": "array"
      },
      "style": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Style"
      },
      "save": {
         "anyOf": [
            {
               "$ref": "#/$defs/PlotSave"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      }
   },
   "$defs": {
      "AxArgs": {
         "additionalProperties": true,
         "properties": {
            "cols": {
               "anyOf": [
                  {
                     "maxItems": 2,
                     "minItems": 2,
                     "prefixItems": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "integer"
                        }
                     ],
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Cols"
            },
            "rows": {
               "anyOf": [
                  {
                     "maxItems": 2,
                     "minItems": 2,
                     "prefixItems": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "integer"
                        }
                     ],
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Rows"
            },
            "series": {
               "items": {
                  "$ref": "#/$defs/Series"
               },
               "title": "Series",
               "type": "array"
            },
            "methods": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Methods"
            },
            "legend": {
               "default": false,
               "title": "Legend",
               "type": "boolean"
            }
         },
         "required": [
            "series"
         ],
         "title": "AxArgs",
         "type": "object"
      },
      "PlotSave": {
         "additionalProperties": true,
         "properties": {
            "as": {
               "title": "As",
               "type": "string"
            },
            "tight_layout": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Tight Layout"
            }
         },
         "required": [
            "as"
         ],
         "title": "PlotSave",
         "type": "object"
      },
      "Series": {
         "additionalProperties": true,
         "properties": {
            "y": {
               "title": "Y",
               "type": "string"
            },
            "x": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "X"
            },
            "kind": {
               "default": "scatter",
               "enum": [
                  "scatter",
                  "line",
                  "errorbar"
               ],
               "title": "Kind",
               "type": "string"
            },
            "index": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SeriesIndex"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {
                  "from_zero": true,
                  "to_units": null
               }
            }
         },
         "required": [
            "y"
         ],
         "title": "Series",
         "type": "object"
      },
      "SeriesIndex": {
         "additionalProperties": false,
         "properties": {
            "from_zero": {
               "default": true,
               "title": "From Zero",
               "type": "boolean"
            },
            "to_units": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "To Units"
            }
         },
         "title": "SeriesIndex",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "table",
      "ax_args"
   ]
}

Config:
  • extra: str = forbid

field table: str [Required]

The name of the table loaded in memory to be plotted.

field nrows: int = 1

Number of rows in the figure grid.

field ncols: int = 1

Number of columns in the figure grid.

field fig_args: Dict[str, Any] | None = None

Any optional method calls for the figure; passed to matplotlib.

field ax_args: Sequence[AxArgs] [Required]

Specifications of the figure axes, including selection of data for the plots.

field style: Dict[str, Any] | None = None

Specification of overall matplotlib style.

field save: PlotSave | None = None

Arguments for saving the plotted figure into files.

dgbowl_schemas.dgpost.recipe_2_1.save module

pydantic model dgbowl_schemas.dgpost.recipe_2_1.save.Save

Bases: BaseModel

Save a table into an external (pkl, xlsx) file.

Show JSON schema
{
   "title": "Save",
   "description": "Save a table into an external (``pkl``, ``xlsx``) file.",
   "type": "object",
   "properties": {
      "table": {
         "title": "Table",
         "type": "string"
      },
      "as": {
         "title": "As",
         "type": "string"
      },
      "type": {
         "anyOf": [
            {
               "enum": [
                  "pkl",
                  "json",
                  "xlsx",
                  "csv",
                  "nc"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Type"
      },
      "columns": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Columns"
      },
      "sigma": {
         "default": true,
         "title": "Sigma",
         "type": "boolean"
      }
   },
   "additionalProperties": false,
   "required": [
      "table",
      "as"
   ]
}

Config:
  • extra: str = forbid

  • populate_by_name: bool = True

field table: str [Required]

The name of the table loaded in memory to be stored.

field as_: str [Required] (alias 'as')

Path to which the table is stored.

field type: Literal['pkl', 'json', 'xlsx', 'csv', 'nc'] | None = None

Type of the output file.

Note

Round-tripping of dgpost data is only possible using the pkl and nc formats. For long-term storage, the json and nc formats may be better suited. The other formats (xlsx and csv) are provided for convenience only and should not be used for chaining of dgpost runs.

field columns: Sequence[str] | None = None

Columns to be exported. By default (None), all columns from the specified table will be exported.

Note

If any of the columns supplied is not present in the table, a warning will be printed by dgpost.

field sigma: bool = True

Whether uncertainties/error estimates in the data should be stripped. Particularly useful when exporting into xlsx or csv.

dgbowl_schemas.dgpost.recipe_2_1.transform module

pydantic model dgbowl_schemas.dgpost.recipe_2_1.transform.Transform

Bases: BaseModel

Calculate and otherwise transform the data in the tables.

Show JSON schema
{
   "title": "Transform",
   "description": "Calculate and otherwise transform the data in the tables.",
   "type": "object",
   "properties": {
      "table": {
         "title": "Table",
         "type": "string"
      },
      "with": {
         "title": "With",
         "type": "string"
      },
      "using": {
         "items": {
            "type": "object"
         },
         "title": "Using",
         "type": "array"
      }
   },
   "additionalProperties": false,
   "required": [
      "table",
      "with",
      "using"
   ]
}

Config:
  • extra: str = forbid

  • populate_by_name: bool = True

field table: str [Required]

The name of the table loaded in memory to be transformed.

field with_: str [Required] (alias 'with')

The name of the transform function from dgpost’s transform library.

field using: Sequence[Dict[str, Any]] [Required]

Specification of any parameters required by the transform function.