rompy.swan.subcomponents.base.XY#

pydantic model rompy.swan.subcomponents.base.XY[source]#

Points in problem coordinates.

< [x] [y] >

Note

Coordinates should be given in m when Cartesian coordinates are used or degrees when Spherical coordinates are used (see command COORD).

Examples

In [238]: from rompy.swan.subcomponents.base import XY

In [239]: points = XY(
   .....:     x=[172, 172, 172, 172.5, 173],
   .....:     y=[-41, -40.5, -40, -40, -40],
   .....:     fmt="0.2f",
   .....: )
   .....: 

In [240]: print(points.render())

172.00 -41.00
172.00 -40.50
172.00 -40.00
172.50 -40.00
173.00 -40.00

Show JSON schema
{
   "title": "XY",
   "description": "Points in problem coordinates.\n\n.. code-block:: text\n\n    < [x] [y] >\n\nNote\n----\nCoordinates should be given in m when Cartesian coordinates are used or degrees\nwhen Spherical coordinates are used (see command `COORD`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.base import XY\n    points = XY(\n        x=[172, 172, 172, 172.5, 173],\n        y=[-41, -40.5, -40, -40, -40],\n        fmt=\"0.2f\",\n    )\n    print(points.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "xy",
         "description": "Model type discriminator",
         "enum": [
            "xy",
            "XY"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "x": {
         "description": "Problem x-coordinate values",
         "items": {
            "type": "number"
         },
         "title": "X",
         "type": "array"
      },
      "y": {
         "description": "Problem y-coordinate values",
         "items": {
            "type": "number"
         },
         "title": "Y",
         "type": "array"
      },
      "fmt": {
         "default": "0.8f",
         "description": "The format to render floats values",
         "title": "Fmt",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "x",
      "y"
   ]
}

Fields:
Validators:
field fmt: str = '0.8f'#

The format to render floats values

Validated by:
field model_type: Literal['xy', 'XY'] = 'xy'#

Model type discriminator

Validated by:
field x: list[float] [Required]#

Problem x-coordinate values

Validated by:
field y: list[float] [Required]#

Problem y-coordinate values

Validated by:
cmd() str[source]#
validator validate_size  »  all fields[source]#
property size#