[DOCS] Consolidate the Python docs into SCHEMA_GUIDE.md - #684
Conversation
🗺️ Schema reference docs preview is live!
Note ♻️ This preview updates automatically with each push to this PR. |
|
Suggestion: With really wide-reaching/complex docs like this (several audiences, several different use cases) I really like to cornerstone them with Diataxis, which is roughly just:
One of the bonuses of this is models seem very adept at following/implementing it just by name reference with "Do the docs in Diataxis", so you can almost completely offload the information theory cognitive load of organizing big documentation, while still being consistent. |
ae0d174 to
e7325f9
Compare
Signed-off-by: Dana Bauer <dana.bauer@gmail.com> Signed-off-by: Seth Fitzsimmons <seth@mojodna.net>
The consolidation was written against main before the doc fixes landed, so it brought the stale content forward and catalogued the rest. Ported from the corrected PYDANTIC_GUIDE.md, extracted from that file rather than retyped: the module-organization section, the import-organization example, and the container-to-mixin example built on the real `Named` / `Appearance` mixins. Section 3.2 is reframed too -- Overture publishes one shape, and GeoJSON is the representation the models support for compatibility and that the generated JSON Schema describes; the renamed heading's anchor is chased through GLOSSARY.md and two in-guide links. "Docs in the repo that are currently wrong" listed eight items; seven are fixed, so only `pip install` survives, pointing at the section that explains it. GLOSSARY.md's Tag entry said there is no plain `overture` tag, which was true when written and is what prompted adding one; it now reads eight tags, with a note on what the tag does and does not assert. The transcribed `list-types` output was regenerated by running the command. The imported guide also exposed two holes in the drift detector. A `>>>` REPL block failed to parse and dropped out of the sweep whole, taking its imports with it. And the guide deliberately shows `from overture.schema import Building` as a counter-example, which the detector read as a defect; a line carrying the counter-example glyph is exempt. Both have unit fixtures and a mutation that fails them. With those handled and the validation README's block fixed, no block in the repo is excused. Signed-off-by: Seth Fitzsimmons <seth@mojodna.net>
e3c22bf to
542d425
Compare
The guide had grown to 4,803 lines across four parts, mixing rationale, consumer instructions, contributor reference, and troubleshooting. The consolidation issue asked for consumer and contributor material to be separated rather than interleaved; this promotes that separation from parts within one file to pages. SCHEMA_GUIDE.md 1,743 using the schema (was Part I) AUTHORING.md 1,687 extending and authoring it (was Part II + templates) CONCEPTS.md 803 why the schema is built this way (was Part 0 + digressions) TROUBLESHOOTING.md 370 symptom-indexed errors and model gotchas (was section 12) Guide sections 4-6 now delegate per-command reference to the package READMEs under packages/, which are versioned with the code they document, rather than restating it. SDK and CLI construction moved from Part II into the guide as section 8 -- that is consumer work, not authoring. Section 2.5 rewritten around the queries people run rather than an explanation of JSON Schema: 454 lines to 194. The required-field derivation, the tag model, and the example-file walkthrough moved to CONCEPTS.md. All `uv run python <<'PY'` heredocs converted to plain python blocks, which also brings them under tests/test_documented_imports.py -- that raised the checked-block count from 227 to 241. REVIEW STATE: guide sections 1 through 2.6 have had a full pass. Sections 2.6-8, CONCEPTS.md, and AUTHORING.md are not yet reviewed as prose; AUTHORING.md is a near-verbatim move of Part II. All code blocks are parsed, import-checked, and enum-checked by the test suite, and all internal links and anchors resolve. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Seth Fitzsimmons <seth@mojodna.net>
Signed-off-by: Dana Bauer <dana.bauer@gmail.com>
Phase 3 (#638) replaced publish-python-packages.yaml with main-publish.yaml and release-publish.yaml, and moved the PySpark codegen step out of the workflow into a package-owned packages/<package>/scripts/prebuild.sh. Describe that convention and the two publish targets (CodeArtifact for interim .postN builds, public PyPI via Trusted Publishing for version bumps) instead of the workflow that no longer exists. Correct the README package count: packages/ holds thirteen packages, as GLOSSARY.md and SCHEMA_GUIDE.md already said. extensions-operating-hours has never been on main. Run the markdown code blocks through ruff format, which make check has been failing on independently of this rebase. Signed-off-by: Seth Fitzsimmons <seth@mojodna.net>
542d425 to
fd6a409
Compare
Summary
Replaces #672. Same consolidation —
PYDANTIC_GUIDE.mdandREADME.pydantic.mdbecome a singleSCHEMA_GUIDE.md, linked fromREADME.mdandCONTRIBUTING.md, andGLOSSARY.mdgrows from 6 to 22 terms — rebased onto the documentation fixes in #683, with the corrections carried into the new guide. Dana Bauer (@danabauer)'s commit is preserved with its authorship; the second commit is the port.#672 can be closed in favour of this; it does not rebase cleanly, because the files it deletes are the files #683 edits.
Why this replaces it rather than stacking on it
#672 was written against
mainbefore the doc fixes landed, so it did two things this branch undoes:It carried the stale content forward. [DOCS] PYDANTIC_GUIDE.md documents a package layout the repo no longer uses #604's
models.py/enums.py/types.pyfile-type rules, the per-type-subdirectory prescription, and# In buildings/models.pyall survive verbatim intoSCHEMA_GUIDE.md. Those sections are now taken from the correctedPYDANTIC_GUIDE.md— extracted from the file programmatically rather than retyped, so the two cannot disagree.It catalogued the defects instead of fixing them. The guide gained a "Docs in the repo that are currently wrong" section listing eight items. Seven are fixed in [BUG] Correct the Python package documentation #683. Only
pip installsurvives, and it now points at the section explaining why. A standing list of known-wrong docs is a workaround for not having a check; [BUG] Correct the Python package documentation #683 adds the check.Other corrections
The transcribed
overture-schema list-typesoutput (two copies) and the--group-byoutput were regenerated by running the commands, so they show theoverturetag that #683 adds. TheModelKeyexamples were showingBuildingModel/PlaceModel, which are not the names of anything.GLOSSARY.md's Tag entry said "Seven tags exist today ... There is no plainoverturetag, despite what some help text suggests." Accurate when written, and the observation is what prompted #683 to add the tag rather than delete the help that referenced it. Now eight, with a note on what the tag does and does not assert — see the open question in #683, which is the place to weigh in on it.What importing the guide exposed
SCHEMA_GUIDE.mdbroke the drift detector twice on arrival, which is a fair argument for having it:>>>REPL block failed to parse and dropped out of the sweep whole, taking its imports with it. Transcripts are unwrapped now.from overture.schema import Building # ✗ ImportErroras a counter-example, and the detector read it as a defect. A line carrying the counter-example glyph is exempt.Both behaviours have unit fixtures and a mutation that fails them.
Review notes
overture.*import resolves, every internal link resolves. Two of those are now enforced bytests/test_documented_imports.pyon every run rather than checked once.SCHEMA_CONVENTIONS.mdstaleness flags inREADME.mdwere spot-checked and are accurate: it does describe JSON Schema as the definition mechanism (line 3) and does spellsubType(line 37).CONTRIBUTING.mdstill does not mention the DCO sign-off requirement. Carried over unaddressed, as in [DOCS] test, update, revise, and consolidate schema guides #672.Closes #685