Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c3726f9
Refactor model discovery and introduce tags.
RoelBollens-TomTom Mar 10, 2026
473cd49
chore(system): use logger.warning instead of print
RoelBollens-TomTom Mar 12, 2026
30d2bf6
refactor(core): simplify using direct boolean return
RoelBollens-TomTom Mar 12, 2026
493c962
chore(system): update ModelKey docstring to reflect changed attributes
RoelBollens-TomTom Mar 12, 2026
e89164b
refactor(system,core): Removes deferred tag provider and corrects tag…
RoelBollens-TomTom Mar 15, 2026
32dcc12
chore(system, core): fixes linting/formatting issues
RoelBollens-TomTom Mar 16, 2026
7d40853
refactor(codegen, cli): replace theme filtering with tag filtering in…
RoelBollens-TomTom Mar 17, 2026
1a30490
refactor(system): Adds reserved namespaces and logging to tag filtering
RoelBollens-TomTom Mar 18, 2026
79b5a69
refactor(system): tighten discovery api and various small improvements
RoelBollens-TomTom Apr 8, 2026
85487dd
Simplify module path in entry point example
sethfitz Apr 28, 2026
31a83cd
feat(system,cli,codegen): tag combinator algebra
sethfitz Apr 29, 2026
b1857c6
fix(system): harden tag provider error logging
sethfitz Apr 30, 2026
d7c707a
test(system): convert tag tests to pytest style
sethfitz Apr 30, 2026
8386fab
docs(system): add module docstring to discovery models
sethfitz Apr 30, 2026
9cd17e9
refactor(system): unify tag part pattern and tighten api
sethfitz Apr 30, 2026
31aa308
refactor(system,core): tighten tag provider contract and tests
sethfitz Apr 30, 2026
851c29d
docs(system,core): document tagging mechanism
sethfitz Apr 30, 2026
055b2a9
refactor(system,core): lift collect_types into tag provider caller
sethfitz Apr 30, 2026
9aa496f
Rename models.py to keys.py
vcschapp May 6, 2026
133f2c9
refactor(system): rename discovery models module to keys
sethfitz May 6, 2026
ab4f381
remove(core): drop authority_provider
RoelBollens-TomTom May 6, 2026
985579e
chore(cli,codegen): bump click floor to 8.1
sethfitz May 6, 2026
388f49d
chore(system,core,codegen): removes leftover references to overture p…
RoelBollens-TomTom May 6, 2026
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
56 changes: 43 additions & 13 deletions README.pydantic.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,31 +151,61 @@ Registration is done in the `[project.entry-points."overture.models"]` section:

```toml
[project.entry-points."overture.models"]
"buildings.building" = "overture.schema.buildings.building.models:Building"
"buildings.building_part" = "overture.schema.buildings.building_part.models:BuildingPart"
building = "overture.schema.buildings:Building"
building_part = "overture.schema.buildings:BuildingPart"
```

The discovery system provides programmatic access to registered models:

```python
from overture.schema.core.discovery import discover_models, get_registered_model
from overture.schema.system.discovery import discover_models, get_registered_model

# Discover all registered models
# Discover all registered models, keyed by ModelKey
all_models = discover_models()
# Returns:
# {
# ("buildings", "building"): BuildingModel,
# ("places", "place"): PlaceModel,
# ...
# }

# Get a specific model by theme and type
building_model = get_registered_model("buildings", "building")
# Get a specific model by name
building_model = get_registered_model("building")
if building_model:
# Use the model class
building = building_model.model_validate(building_data)
```

### Tagging

Each `ModelKey` returned by `discover_models()` carries a `frozenset[str]` of tags
that classify the model orthogonally to its entry-point name -- whether the model
is a `Feature` subclass, which Overture theme it belongs to, which package shipped
it, and so on. Downstream tools (the CLI, codegen, third-party consumers) use tags
to filter the working set without importing every model:

```python
from overture.schema.system.discovery import (
TagSelector,
discover_models,
filter_models,
)

models = discover_models()
# {
# ModelKey(name="building", entry_point="overture.schema.buildings:Building",
# tags=frozenset({"feature", "overture", "overture:theme=buildings"})): BuildingModel,
# ModelKey(name="place", entry_point="overture.schema.places:Place",
# tags=frozenset({"feature", "overture", "overture:theme=places"})): PlaceModel,
# ...
# }

buildings = filter_models(
models,
TagSelector(include_any=("overture:theme=buildings",)),
)
```

Tags are produced by *tag providers* registered on the `overture.tag_providers`
entry-point group. The `system` and `core` packages ship the built-in providers
(`feature`, `overture`, `overture:theme=*`); third parties can register their own
to attach custom tags during discovery. See the [`overture-schema-system`
README](packages/overture-schema-system/README.md#tagging) for tag format,
reserved namespaces, and provider authoring.

## Development

This project uses [uv](https://docs.astral.sh/uv/) for dependency management:
Expand Down
2 changes: 1 addition & 1 deletion packages/overture-schema-addresses-theme/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pythonpath = ["src"]
testpaths = ["tests"]

[project.entry-points."overture.models"]
"overture:addresses:address" = "overture.schema.addresses:Address"
address = "overture.schema.addresses:Address"

[project.entry-points.pytest11]
overture_baselines = "overture.schema.system.testing.plugin"
Expand Down
2 changes: 1 addition & 1 deletion packages/overture-schema-annex/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ path = "src/overture/schema/__about__.py"
packages = ["src/overture"]

[project.entry-points."overture.models"]
"annex:sources" = "overture.schema.annex:Sources"
sources = "overture.schema.annex:Sources"

[project.entry-points.pytest11]
overture_baselines = "overture.schema.system.testing.plugin"
Expand Down
12 changes: 6 additions & 6 deletions packages/overture-schema-base-theme/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ path = "src/overture/schema/base/__about__.py"
packages = ["src/overture"]

[project.entry-points."overture.models"]
"overture:base:bathymetry" = "overture.schema.base:Bathymetry"
"overture:base:infrastructure" = "overture.schema.base:Infrastructure"
"overture:base:land" = "overture.schema.base:Land"
"overture:base:land_cover" = "overture.schema.base:LandCover"
"overture:base:land_use" = "overture.schema.base:LandUse"
"overture:base:water" = "overture.schema.base:Water"
bathymetry = "overture.schema.base:Bathymetry"
infrastructure = "overture.schema.base:Infrastructure"
land = "overture.schema.base:Land"
land_cover = "overture.schema.base:LandCover"
land_use = "overture.schema.base:LandUse"
water = "overture.schema.base:Water"

[project.entry-points.pytest11]
overture_baselines = "overture.schema.system.testing.plugin"
Expand Down
4 changes: 2 additions & 2 deletions packages/overture-schema-buildings-theme/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ path = "src/overture/schema/buildings/__about__.py"
packages = ["src/overture"]

[project.entry-points."overture.models"]
"overture:buildings:building" = "overture.schema.buildings:Building"
"overture:buildings:building_part" = "overture.schema.buildings:BuildingPart"
building = "overture.schema.buildings:Building"
building_part = "overture.schema.buildings:BuildingPart"

[project.entry-points.pytest11]
overture_baselines = "overture.schema.system.testing.plugin"
Expand Down
2 changes: 1 addition & 1 deletion packages/overture-schema-cli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies = [
"overture-schema-system",
"pydantic>=2.12.0",
"pyyaml>=6.0.2",
"click>=8.0",
"click>=8.1",
"rich>=13.0",
"yamlcore>=0.0.4",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
)
from .types import (
ErrorLocation,
ModelDict,
UnionType,
ValidationErrorDict,
)
Expand All @@ -25,7 +24,6 @@
"perform_validation",
"resolve_types",
"ErrorLocation",
"ModelDict",
"UnionType",
"ValidationErrorDict",
]
Loading
Loading