Commit ac45fe7
committed
Organize divisions pkg, add missing relationships, tidy and add docs
This commit organizes the divisions Pydantic package to align with the
other packages that have been done so far: addresses, base, buildings,
and places. After this commit there remains only: transportation and
core (the latter will soon be renamed common).
Organization work done:
1. Common code into `_common.py`.
2. Each feature type gets its own main module, e.g., `division.py`.
3. Types used exclusively by a feature type into that feature type's main
module, regardless of whether the type is an enum, model, NewType, etc.
4. Eliminate sub-directories.
5. Curate `__all__` in `__init__.py`.
Missing relationships added:
1. `CapitalOfItem`
2. `HierarchyItem`
3. `parent_division_id` in `Division`
4. `capital_division_ids` in `Division`
Getting this to work required extending the list of relationships in the
system package's `ref.py`. (On this, note, that Tristan will likely
shrink it back to managable size when he rationalizes the
relationships.) It also required solving an issue with Python forward
references being in the Pydantic field annotations for `CapitalOfItem`
and `HierarchyItem`, which was breaking codegen. I fixed this issue by
using `.model_rebuild()` on both models, see `divisions.py`.
Docs tidied and updated:
1. Eliminated all `make docformat` errors pertaining to divisions.
2. Converted several enums to `DocumentedEnum` so they can have a richer
presence in the schema reference.
3. Added missing docstrings and `Field(description="...")` annotations.
4. Edited and refined some of the documentation wording where it wasn't
fully up to standard.
5. Wrapped long doc/desc lines using `textwrap.dedent("...").strip()` so
the docs are easier to read and edit in a code editor.
Signed-off-by: schapper <schapper@amazon.com>1 parent b8664f2 commit ac45fe7
34 files changed
Lines changed: 1074 additions & 776 deletions
File tree
- packages
- overture-schema-base-theme
- src/overture/schema/base
- tests
- overture-schema-buildings-theme/tests
- overture-schema-codegen/tests
- overture-schema-core/src/overture/schema/core
- overture-schema-divisions-theme
- src/overture/schema/divisions
- division_area
- division_boundary
- division
- tests
- overture-schema-places-theme/tests
- overture-schema-system/src/overture/schema/system/ref
- overture-schema-transportation-theme/tests
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
633 | | - | |
| 633 | + | |
| 634 | + | |
634 | 635 | | |
635 | 636 | | |
636 | 637 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | | - | |
| 508 | + | |
| 509 | + | |
509 | 510 | | |
510 | 511 | | |
511 | 512 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
585 | | - | |
| 585 | + | |
| 586 | + | |
586 | 587 | | |
587 | 588 | | |
588 | 589 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
| 472 | + | |
| 473 | + | |
473 | 474 | | |
474 | 475 | | |
475 | 476 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
563 | | - | |
| 563 | + | |
| 564 | + | |
564 | 565 | | |
565 | 566 | | |
566 | 567 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
| 447 | + | |
| 448 | + | |
448 | 449 | | |
449 | 450 | | |
450 | 451 | | |
| |||
Lines changed: 0 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | 135 | | |
147 | 136 | | |
148 | 137 | | |
| |||
0 commit comments