Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed the `level` default of `0`; a feature parsed without a level now yields `None` instead of `0`, and the field description states that absence means visual level.
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@
class Stacked(BaseModel):
"""Properties defining feature Z-order, i.e., stacking order."""

level: Level | None = 0 # type: ignore[assignment]
level: Annotated[
Level | None,
Field(
description=(
"Z-order of the feature where 0 is visual level. A feature "
"without a level is at visual level."
)
),
] = None
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Made `class` and `subtype` required on `Land` and `Water`, matching `Infrastructure` and `LandUse`; constructing either without them now raises instead of falling back to `land`/`water`.
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@ class Land(

# Required

class_: Annotated[LandClass, Field(default=LandClass.LAND, alias="class")] = (
LandClass.LAND
)
subtype: Annotated[LandSubtype, Field(default=LandSubtype.LAND)] = LandSubtype.LAND
class_: Annotated[LandClass, Field(alias="class")]
subtype: LandSubtype

# Optional

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,8 @@ class Water(

# Required

class_: Annotated[
WaterClass,
Field(
default=WaterClass.WATER,
alias="class",
),
] = WaterClass.WATER
subtype: Annotated[
WaterSubtype,
Field(
default=WaterSubtype.WATER,
),
] = WaterSubtype.WATER
class_: Annotated[WaterClass, Field(alias="class")]
subtype: WaterSubtype

# Optional

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,7 @@
"type": "number"
},
"level": {
"default": 0,
"description": "Z-order of the feature where 0 is visual level",
"description": "Z-order of the feature where 0 is visual level. A feature without a level is at visual level.",
"maximum": 2147483647,
"minimum": -2147483648,
"title": "Level",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,7 @@
},
"properties": {
"class": {
"$ref": "#/$defs/LandClass",
"default": "land"
"$ref": "#/$defs/LandClass"
},
"elevation": {
"description": "Elevation above sea level of the feature in meters.",
Expand All @@ -518,8 +517,7 @@
"type": "integer"
},
"level": {
"default": 0,
"description": "Z-order of the feature where 0 is visual level",
"description": "Z-order of the feature where 0 is visual level. A feature without a level is at visual level.",
"maximum": 2147483647,
"minimum": -2147483648,
"title": "Level",
Expand All @@ -546,8 +544,7 @@
"uniqueItems": true
},
"subtype": {
"$ref": "#/$defs/LandSubtype",
"default": "land"
"$ref": "#/$defs/LandSubtype"
},
"surface": {
"$ref": "#/$defs/SurfaceMaterial"
Expand Down Expand Up @@ -579,7 +576,9 @@
"required": [
"theme",
"type",
"version"
"version",
"class",
"subtype"
],
"type": "object"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,7 @@
"type": "integer"
},
"level": {
"default": 0,
"description": "Z-order of the feature where 0 is visual level",
"description": "Z-order of the feature where 0 is visual level. A feature without a level is at visual level.",
"maximum": 2147483647,
"minimum": -2147483648,
"title": "Level",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,7 @@
},
"properties": {
"class": {
"$ref": "#/$defs/WaterClass",
"default": "water"
"$ref": "#/$defs/WaterClass"
},
"is_intermittent": {
"description": "Whether the water body exists intermittently, not permanently",
Expand All @@ -482,8 +481,7 @@
"type": "boolean"
},
"level": {
"default": 0,
"description": "Z-order of the feature where 0 is visual level",
"description": "Z-order of the feature where 0 is visual level. A feature without a level is at visual level.",
"maximum": 2147483647,
"minimum": -2147483648,
"title": "Level",
Expand All @@ -510,8 +508,7 @@
"uniqueItems": true
},
"subtype": {
"$ref": "#/$defs/WaterSubtype",
"default": "water"
"$ref": "#/$defs/WaterSubtype"
},
"theme": {
"const": "base",
Expand Down Expand Up @@ -540,7 +537,9 @@
"required": [
"theme",
"type",
"version"
"version",
"class",
"subtype"
],
"type": "object"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Buildings and building parts parsed without a `level` now yield `None` instead of `0`, following the removal of the `Stacked.level` default.
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,7 @@
"type": "boolean"
},
"level": {
"default": 0,
"description": "Z-order of the feature where 0 is visual level",
"description": "Z-order of the feature where 0 is visual level. A feature without a level is at visual level.",
"maximum": 2147483647,
"minimum": -2147483648,
"title": "Level",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,7 @@
"type": "boolean"
},
"level": {
"default": 0,
"description": "Z-order of the feature where 0 is visual level",
"description": "Z-order of the feature where 0 is visual level. A feature without a level is at visual level.",
"maximum": 2147483647,
"minimum": -2147483648,
"title": "Level",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed the `is_max_speed_variable` default of `False`; a rule parsed without the flag now yields `None` instead of `False`.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ class SpeedLimitRule(BaseModel):
description="Indicates a variable speed corridor",
strict=True,
),
] = False
] = None


SpeedLimits = NewType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,6 @@
"type": "array"
},
"is_max_speed_variable": {
"default": false,
"description": "Indicates a variable speed corridor",
"title": "Is Max Speed Variable",
"type": "boolean"
Expand Down
Loading