Skip to content
Open
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
13a3ea1
Refactor model discovery and introduce tags.
RoelBollens-TomTom Mar 10, 2026
2ef051a
chore(system): use logger.warning instead of print
RoelBollens-TomTom Mar 12, 2026
5f4ec9b
refactor(core): simplify using direct boolean return
RoelBollens-TomTom Mar 12, 2026
52fe751
chore(system): update ModelKey docstring to reflect changed attributes
RoelBollens-TomTom Mar 12, 2026
fe2cb87
refactor(system,core): Removes deferred tag provider and corrects tag…
RoelBollens-TomTom Mar 15, 2026
f355be5
chore(system, core): fixes linting/formatting issues
RoelBollens-TomTom Mar 16, 2026
309f564
refactor(codegen, cli): replace theme filtering with tag filtering in…
RoelBollens-TomTom Mar 17, 2026
77f3acd
refactor(system): Adds reserved namespaces and logging to tag filtering
RoelBollens-TomTom Mar 18, 2026
7ae97ab
refactor(system): tighten discovery api and various small improvements
RoelBollens-TomTom Apr 8, 2026
cfad066
Simplify module path in entry point example
sethfitz Apr 28, 2026
caaff44
feat(system,cli,codegen): tag combinator algebra
sethfitz Apr 29, 2026
12b1e66
fix(system): harden tag provider error logging
sethfitz Apr 30, 2026
6a58214
test(system): convert tag tests to pytest style
sethfitz Apr 30, 2026
ef8c453
docs(system): add module docstring to discovery models
sethfitz Apr 30, 2026
b1f6c27
refactor(system): unify tag part pattern and tighten api
sethfitz Apr 30, 2026
a92e268
refactor(system,core): tighten tag provider contract and tests
sethfitz Apr 30, 2026
7dbd389
docs(system,core): document tagging mechanism
sethfitz Apr 30, 2026
0824f57
refactor(system,core): lift collect_types into tag provider caller
sethfitz Apr 30, 2026
4fed964
Rename models.py to keys.py
vcschapp May 6, 2026
25c29e1
refactor(system): rename discovery models module to keys
sethfitz May 6, 2026
5b34971
remove(core): drop authority_provider
RoelBollens-TomTom May 6, 2026
8c20e2c
chore(cli,codegen): bump click floor to 8.1
sethfitz May 6, 2026
e11a1c4
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 @@ -37,7 +37,7 @@ pythonpath = ["src"]
testpaths = ["tests"]

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

[[examples.Address]]
id = "416ab01c-d836-4c4f-aedc-2f30941ce94d"
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 @@ -29,7 +29,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"

[tool.pytest.ini_options]
pythonpath = ["src"]
Expand Down
14 changes: 7 additions & 7 deletions packages/overture-schema-base-theme/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ 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"

[[examples.Bathymetry]]
id = "5d40bd6c-db14-5492-b29f-5e25a59032bc"
geometry = "MULTIPOLYGON (((-170.71296928 -76.744313428, -170.719841483 -76.757076376, -170.731061124 -76.761566192, -170.775652756 -76.76338726, -170.853616381 -76.76253958, -170.918562293 -76.755380155, -170.970490492 -76.741908984, -170.998699301 -76.729180777, -171.003188718 -76.717195533, -170.990421551 -76.703765214, -170.960397802 -76.68888982, -170.940748072 -76.674697941, -170.931472364 -76.661189576, -170.927114414 -76.637296658, -170.927674224 -76.603019188, -170.939335393 -76.574637428, -170.962097922 -76.552151379, -170.999015387 -76.535715361, -171.050087788 -76.525329373, -171.079133298 -76.50751024, -171.086151917 -76.482257963, -171.098653755 -76.462747286, -171.11663881 -76.448978211, -171.146691397 -76.437601179, -171.188811514 -76.428616191, -171.296181785 -76.4228609, -171.468802209 -76.420335306, -171.566055241 -76.41501101, -171.587940879 -76.406888013, -171.59004284 -76.387987744, -171.572361122 -76.358310204, -171.549343725 -76.334488281, -171.520990649 -76.316521976, -171.453759127 -76.301763636, -171.347649159 -76.290213262, -171.30597166 -76.267707269, -171.328726628 -76.234245658, -171.36676019 -76.195627518, -171.420072345 -76.151852851, -171.444766298 -76.12494912, -171.44084205 -76.114916326, -171.378107286 -76.099627787, -171.256562007 -76.079083503, -171.228218647 -76.058825682, -171.293077208 -76.038854322, -171.421365419 -76.023534207, -171.613083278 -76.012865337, -171.76411833 -75.99938969, -171.874470572 -75.983107266, -172.121928361 -75.958403596, -172.506491695 -75.925278679, -172.744527804 -75.899736153, -172.836036689 -75.88177602, -172.904681746 -75.862406785, -172.950462974 -75.841628448, -173.000855857 -75.830396498, -173.055860393 -75.828710933, -173.177561398 -75.810743709, -173.365958872 -75.776494827, -173.493573084 -75.759370386, -173.560404033 -75.759370386, -173.620925776 -75.77158365, -173.675138312 -75.796010178, -173.733786206 -75.808642966, -173.796869456 -75.809482015, -173.847216433 -75.805553449, -173.884827135 -75.79685727, -173.90475244 -75.789177124, -173.906992347 -75.782513013, -173.881736947 -75.76894365, -173.828986239 -75.748469035, -173.797974615 -75.732298475, -173.788702075 -75.72043197, -173.82491541 -75.701013882, -173.90661462 -75.674044211, -173.977087913 -75.656066882, -174.03633529 -75.647081894, -174.150190099 -75.643010485, -174.31865234 -75.643852655, -174.444433211 -75.652836726, -174.527532713 -75.669962696, -174.581709229 -75.687086831, -174.606962758 -75.704209131, -174.631095834 -75.708279163, -174.654108458 -75.699296928, -174.688637451 -75.699296928, -174.734682816 -75.708279163, -174.797846917 -75.708699866, -174.878129754 -75.700559037, -174.939903816 -75.70870181, -174.9831691 -75.733128185, -175.025841122 -75.746602837, -175.06791988 -75.749125768, -175.09922327 -75.755318987, -175.119751293 -75.765182495, -175.127900229 -75.775197415, -175.123670077 -75.785363749, -175.111718372 -75.791289392, -175.092045112 -75.792974345, -175.049907399 -75.780622976, -174.985305232 -75.754235285, -174.935355308 -75.74552996, -174.900057628 -75.754507001, -174.886060973 -75.766815613, -174.893365345 -75.782455795, -174.907537393 -75.791536245, -174.928577117 -75.794056963, -174.971105378 -75.818213107, -175.035122174 -75.864004677, -175.060941949 -75.892403254, -175.048564703 -75.903408839, -175.020469049 -75.909193043, -174.976654988 -75.909755867, -174.944760829 -75.90482541, -174.924786572 -75.894401673, -174.92111336 -75.881479168, -174.933741192 -75.866057897, -174.900484967 -75.857513625, -174.821344686 -75.855846351, -174.752433709 -75.839289534, -174.693752038 -75.807843172, -174.652894268 -75.780747792, -174.629860399 -75.758003392, -174.571227588 -75.745793709, -174.476995837 -75.744118743, -174.398722205 -75.751841803, -174.336406693 -75.768962888, -174.300477946 -75.783262828, -174.290935964 -75.794741623, -174.28812912 -75.812412878, -174.292057414 -75.836276591, -174.289237223 -75.852155302, -174.279668547 -75.860049012, -174.205113931 -75.879998026, -174.065573375 -75.912002343, -173.957779122 -75.924071248, -173.881731171 -75.916204739, -173.846521251 -75.926706189, -173.852149361 -75.955575598, -173.845408416 -75.979439305, -173.826298414 -75.99829731, -173.76424232 -76.018956172, -173.659240133 -76.041415889, -173.560434089 -76.057698465, -173.467824188 -76.067803901, -173.404678836 -76.077625909, -173.370998032 -76.087164489, -173.332530272 -76.106814524, -173.289275555 -76.136576014, -173.231864101 -76.154545405, -173.160295911 -76.1607227, -173.093917454 -76.17278471, -173.032728732 -76.190731436, -173.009710709 -76.205560908, -173.024863387 -76.217273124, -173.048718935 -76.225374126, -173.081277354 -76.229863912, -173.219658797 -76.237442552, -173.463863265 -76.248110046, -173.60352174 -76.25793895, -173.638634223 -76.266929265, -173.658723482 -76.274676093, -173.663789516 -76.281179435, -173.661403366 -76.289363255, -173.651565032 -76.299227554, -173.627282775 -76.313843189, -173.588556596 -76.33321016, -173.575369172 -76.355231445, -173.587720504 -76.379907046, -173.573965869 -76.402499893, -173.53410527 -76.423009985, -173.518376226 -76.437156259, -173.526778738 -76.444938715, -173.559015515 -76.446303683, -173.615086557 -76.441251162, -173.686785609 -76.421600788, -173.774112673 -76.387352563, -173.854573513 -76.372333877, -173.928168128 -76.37654473, -173.968906731 -76.383732772, -173.97678932 -76.393898005, -173.979325549 -76.410884215, -173.976515417 -76.434691403, -174.000646474 -76.454452818, -174.051718722 -76.470168462, -174.08231827 -76.482963711, -174.092445119 -76.492838563, -174.075053216 -76.514344245, -174.030142562 -76.547480757, -174.016669929 -76.575274601, -174.034635317 -76.597725777, -174.037021169 -76.62030279, -174.023827484 -76.64300564, -174.034634583 -76.661942018, -174.069442464 -76.677111923, -174.086843964 -76.690616859, -174.086839082 -76.702456825, -174.080513222 -76.712456309, -174.067866385 -76.72061531, -174.036259441 -76.725116584, -173.98569239 -76.725960131, -173.93723318 -76.720486558, -173.89088181 -76.708695864, -173.780274695 -76.695221211, -173.605411835 -76.6800626, -173.487930602 -76.662096294, -173.427830996 -76.641322294, -173.370307559 -76.630935294, -173.315360292 -76.630935294, -173.249406002 -76.637251344, -173.17244469 -76.649883444, -173.110795196 -76.653532162, -173.06445752 -76.648197497, -173.029349452 -76.637355272, -173.005470993 -76.621005486, -173.01753216 -76.605236858, -173.065532955 -76.590049388, -173.096548505 -76.576599032, -173.11057881 -76.564885791, -173.108053605 -76.552301955, -173.08897289 -76.538847523, -173.051362225 -76.527628807, -172.99522161 -76.518645807, -172.891534181 -76.516119525, -172.740299938 -76.52004996, -172.648684331 -76.524540794, -172.61668736 -76.529592027, -172.584268588 -76.541098757, -172.551428016 -76.559060982, -172.533042741 -76.576141146, -172.529112765 -76.592339249, -172.540195073 -76.604524646, -172.566289666 -76.612697339, -172.576243291 -76.621303431, -172.570055947 -76.630342924, -172.555183534 -76.636123529, -172.531626051 -76.638645245, -172.517040304 -76.643518276, -172.511426292 -76.650742621, -172.551848294 -76.672312544, -172.63830631 -76.708228042, -172.701431121 -76.728711408, -172.741222726 -76.733762641, -172.81460886 -76.72534004, -172.921589524 -76.703443605, -173.006960733 -76.697273314, -173.070722487 -76.706829166, -173.101615682 -76.719791531, -173.099640316 -76.736160408, -173.033958817 -76.759064999, -172.904571183 -76.788505304, -172.847033841 -76.810916113, -172.861346791 -76.826297424, -172.924787296 -76.856444925, -173.037355356 -76.901358615, -173.149640378 -76.935043659, -173.26164236 -76.957500057, -173.354942309 -76.968728255, -173.429540223 -76.968728255, -173.487771718 -76.964657535, -173.529636796 -76.956516094, -173.572768938 -76.955559014, -173.617168145 -76.961786296, -173.614655836 -76.97446809, -173.565232013 -76.993604396, -173.461502424 -77.006682128, -173.303467069 -77.013701287, -173.163373388 -77.02787859, -173.041221382 -77.049214037, -172.918094542 -77.059179951, -172.793992869 -77.057776334, -172.720418717 -77.044861043, -172.697372088 -77.020434079, -172.675885915 -77.003730799, -172.655960197 -76.994751205, -172.60882792 -76.987594764, -172.534489083 -76.982261476, -172.480072837 -76.983094424, -172.445579184 -76.990093609, -172.428332542 -76.998610734, -172.428332911 -77.008645799, -172.435068344 -77.018150822, -172.448538839 -77.027125803, -172.490777829 -77.039613708, -172.561785312 -77.055614535, -172.628175119 -77.080598263, -172.68994725 -77.114564892, -172.751818039 -77.133793765, -172.813787485 -77.138284883, -172.900229764 -77.131828165, -173.011144875 -77.114423613, -173.119679588 -77.128474884, -173.2258339 -77.17398198, -173.273849553 -77.202664633, -173.263726547 -77.214522842, -173.165895559 -77.239681117, -172.980356589 -77.278139457, -172.880291531 -77.312658914, -172.865700386 -77.343239487, -172.867667457 -77.371126102, -172.886192744 -77.39631876, -172.999732531 -77.429966955, -173.208286817 -77.472070689, -173.335454668 -77.509278677, -173.381236082 -77.541590921, -173.403703936 -77.570407724, -173.40285823 -77.595729086, -173.378288408 -77.634921, -173.329994472 -77.687983467, -173.241287742 -77.735563094, -173.112168219 -77.777659882, -173.054064387 -77.81089869, -173.066976248 -77.835279519, -173.063736051 -77.854657976, -173.044343797 -77.869034061, -172.890349983 -77.896435115, -172.60175461 -77.936861139, -172.376181212 -77.961986812, -172.213629791 -77.971812135, -172.023427102 -77.967320559, -171.805573145 -77.948512083, -171.581263004 -77.918894833, -171.350496677 -77.87846881, -171.217147208 -77.851799157, -171.181214596 -77.838885875, -171.160572341 -77.826074082, -171.155220441 -77.813363779, -171.178789134 -77.790158543, -171.231278422 -77.756458375, -171.27338337 -77.70988804, -171.305103978 -77.65044754, -171.293875473 -77.602346602, -171.239697854 -77.565585227, -171.168401509 -77.532887375, -171.079986438 -77.504253044, -171.028614514 -77.483042244, -171.014285737 -77.469254974, -171.016677114 -77.456576914, -171.035788644 -77.445008064, -171.086879845 -77.431646501, -171.169950715 -77.416492226, -171.216537864 -77.403175691, -171.226641293 -77.391696895, -171.228607057 -77.378968685, -171.222435157 -77.364991059, -171.168824693 -77.334840949, -171.067775664 -77.288518355, -171.000402018 -77.24121644, -170.966703754 -77.192935206, -170.894838531 -77.157002595, -170.784806349 -77.133418606, -170.725150821 -77.11627156, -170.715871945 -77.105561456, -170.710674146 -77.077210652, -170.709557424 -77.031219147, -170.697909144 -76.992502178, -170.675729304 -76.961059744, -170.654536164 -76.940848729, -170.634329723 -76.931869135, -170.581564681 -76.922044903, -170.496241038 -76.911376032, -170.429709562 -76.893409727, -170.381970254 -76.868145986, -170.285260999 -76.838950739, -170.139581798 -76.805823986, -170.061542334 -76.78431495, -170.051142608 -76.77442363, -170.076677284 -76.763148845, -170.138146365 -76.750490597, -170.192753568 -76.731526593, -170.240498896 -76.706256833, -170.315896371 -76.686462585, -170.418945993 -76.67214385, -170.498267121 -76.665405567, -170.553859754 -76.666247738, -170.609039198 -76.673409769, -170.663805452 -76.68689166, -170.695686968 -76.698414281, -170.704683743 -76.70797763, -170.710444514 -76.723277346, -170.71296928 -76.744313428), (-172.46185717 -77.485683162, -172.491725041 -77.49003391, -172.535448064 -77.490594163, -172.566986057 -77.488349711, -172.586339021 -77.483300552, -172.598540475 -77.476173053, -172.60359042 -77.466967216, -172.601627836 -77.458872071, -172.592652724 -77.451887618, -172.556765055 -77.448396429, -172.49396483 -77.448398503, -172.453726685 -77.452881992, -172.436050621 -77.461846897, -172.429868964 -77.468114837, -172.435181715 -77.47168581, -172.44584445 -77.477541919, -172.46185717 -77.485683162), (-172.812798475 -76.363628771, -172.855573928 -76.365453015, -172.885037626 -76.36040045, -172.90720433 -76.351027386, -172.92207404 -76.337333821, -172.9168827 -76.324750727, -172.89163031 -76.313278104, -172.862193885 -76.307261221, -172.828573425 -76.30670008, -172.792121028 -76.311189877, -172.752836694 -76.320730613, -172.732062811 -76.331770033, -172.729799379 -76.344308139, -172.756711267 -76.354927718, -172.812798475 -76.363628771), (-171.932998671 -76.183124002, -172.010021088 -76.180457336, -172.070931389 -76.166984091, -172.113033554 -76.150312062, -172.136327583 -76.130441248, -172.133522137 -76.111120124, -172.104617217 -76.092348689, -172.06028165 -76.080296327, -172.000515436 -76.074963039, -171.918725408 -76.076928027, -171.814911566 -76.086191292, -171.745182124 -76.097695899, -171.709537083 -76.111441849, -171.696346087 -76.126554541, -171.705609136 -76.143033974, -171.731004713 -76.156183802, -171.77253282 -76.166004024, -171.83986414 -76.174984091, -171.932998671 -76.183124002), (-173.16885937 -76.066345013, -173.199147981 -76.070696107, -173.23950163 -76.071257052, -173.269213382 -76.065813298, -173.288283234 -76.054364845, -173.2799961 -76.038973879, -173.244351978 -76.0196404, -173.207608446 -76.007588038, -173.169765504 -76.002816794, -173.139490241 -76.003094691, -173.116782658 -76.008421729, -173.104589039 -76.016938854, -173.102909386 -76.028646065, -173.111183172 -76.03940804, -173.129410398 -76.049224779, -173.148635798 -76.05820377, -173.16885937 -76.066345013)))"
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"

[[examples.Building]]
id = "148f35b1-7bc1-4180-9280-10d39b13883b"
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