Skip to content

RoundTime

Base classes

Name Children Inherits
SeriesOp
datacook.engine.ops.series
A `ColumnOp` that is one call per column, declared like `CallOp`.

⋔ Inheritance diagram

graph TD
  1196060461["dates.RoundTime"]
  2451904138["series.SeriesOp"]
  124287307["series.ColumnOp"]
  1539482213["base.Op"]
  2751680898["builtins.object"]
  2451904138 --> 1196060461
  124287307 --> 2451904138
  1539482213 --> 124287307
  2751680898 --> 1539482213

🛈 DocStrings

Bases: SeriesOp

Source code in src/datacook/engine/ops/dates.py
class RoundTime(series.SeriesOp):
    id = "dt_round"
    title = _("Round date / time")
    description = _("Round date / time values down, up or to the nearest multiple of a frequency.")
    category = categories.DATETIME
    icon = "mdi.clock-start"
    accessor = "dt"
    method_param = "how"
    positional = ("freq",)

    class Params(series.ColumnParams):
        how: Literal["floor", "round", "ceil"] = Field("floor", title=N_("Rounding"))
        freq: str = Field(
            "1min",
            title=N_("Frequency"),
            min_length=1,
            description=N_("e.g. 1s, 15min, 1h, 1D"),
        )

:fa-brands-github: Show source on GitHub