rompy.swan.subcomponents.time.Delt#

pydantic model rompy.swan.subcomponents.time.Delt[source]#

Time interval specification in SWAN.

[delt] SEC|MIN|HR|DAY

Note

The tdelta field can be specified as:

  • existing timedelta object

  • int or float, assumed as seconds

  • ISO 8601 duration string, following formats work:

    • [-][DD ][HH:MM]SS[.ffffff]

    • [±]P[DD]DT[HH]H[MM]M[SS]S (ISO 8601 format for timedelta)

Examples

In [136]: from rompy.swan.subcomponents.time import Delt

In [137]: from datetime import timedelta

In [138]: delt = Delt(delt=timedelta(minutes=30))

In [139]: print(delt.render())
1800.0 SEC

In [140]: delt = Delt(delt="PT1H", dfmt="hr")

In [141]: print(delt.render())
1.0 HR

Show JSON schema
{
   "title": "Delt",
   "description": "Time interval specification in SWAN.\n\n.. code-block:: text\n\n    [delt] SEC|MIN|HR|DAY\n\nNote\n----\nThe `tdelta` field can be specified as:\n\n* existing timedelta object\n* int or float, assumed as seconds\n* ISO 8601 duration string, following formats work:\n\n  * `[-][DD ][HH:MM]SS[.ffffff]`\n  * `[\u00b1]P[DD]DT[HH]H[MM]M[SS]S` (ISO 8601 format for timedelta)\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import Delt\n    from datetime import timedelta\n    delt = Delt(delt=timedelta(minutes=30))\n    print(delt.render())\n    delt = Delt(delt=\"PT1H\", dfmt=\"hr\")\n    print(delt.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "delt",
         "default": "delt",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      },
      "delt": {
         "description": "Time interval",
         "format": "duration",
         "title": "Delt",
         "type": "string"
      },
      "dfmt": {
         "default": "sec",
         "description": "Format to render time interval specification",
         "enum": [
            "sec",
            "min",
            "hr",
            "day"
         ],
         "title": "Dfmt",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "delt"
   ]
}

Fields:
field delt: timedelta [Required]#

Time interval

field dfmt: Literal['sec', 'min', 'hr', 'day'] = 'sec'#

Format to render time interval specification

field model_type: Literal['delt'] = 'delt'#

Model type discriminator

cmd() str[source]#

Render subcomponent cmd.

property delt_float#