Skip to content

Commit

Permalink
Add columns to save.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterKraus committed Aug 31, 2023
1 parent 71f084f commit 6abe63b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/dgbowl_schemas/dgpost/recipe_2_1/save.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pydantic import BaseModel, Field
from typing import Literal
from typing import Optional, Literal, Sequence


class Save(BaseModel, extra="forbid", populate_by_name=True):
Expand All @@ -11,7 +11,7 @@ class Save(BaseModel, extra="forbid", populate_by_name=True):
as_: str = Field(alias="as")
"""Path to which the table is stored."""

type: Literal["pkl", "json", "xlsx", "csv", "nc"] = None
type: Optional[Literal["pkl", "json", "xlsx", "csv", "nc"]] = None
"""
Type of the output file.
Expand All @@ -23,6 +23,19 @@ class Save(BaseModel, extra="forbid", populate_by_name=True):
not be used for chaining of :mod:`dgpost` runs.
"""

columns: Optional[Sequence[str]] = 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 :mod:`dgpost`.
"""


sigma: bool = True
"""Whether uncertainties/error estimates in the data should be stripped. Particularly
useful when exporting into ``xlsx`` or ``csv``."""

0 comments on commit 6abe63b

Please sign in to comment.