Location

pydantic model infrasys.location.Location

Specifies geographic location.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Location",
   "description": "Specifies geographic location.",
   "type": "object",
   "properties": {
      "uuid": {
         "format": "uuid",
         "title": "Uuid",
         "type": "string"
      },
      "name": {
         "default": "",
         "title": "Name",
         "type": "string"
      },
      "x": {
         "title": "X",
         "type": "number"
      },
      "y": {
         "title": "Y",
         "type": "number"
      },
      "crs": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Crs"
      }
   },
   "additionalProperties": false,
   "required": [
      "x",
      "y"
   ]
}

Config:
  • str_strip_whitespace: bool = True

  • validate_assignment: bool = True

  • validate_default: bool = True

  • extra: str = forbid

  • use_enum_values: bool = False

  • arbitrary_types_allowed: bool = True

  • populate_by_name: bool = True

Fields:
field crs: str | None = None
field name: Annotated[str, FieldInfo(annotation=NoneType, required=True, frozen=True)] = ''
field x: float [Required]
field y: float [Required]