Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3e7fe4d
First working version, with REUSABLE VALIDATORS COMMENTED OUT
maxschulz-COL Jan 20, 2026
7581ebf
Add example model from the griffe docs: WHY IS IT NOT THE SAME OUTCOM…
maxschulz-COL Jan 20, 2026
0439656
Removal of all docstring sections - sadly e.g. fields without Field +…
maxschulz-COL Jan 20, 2026
c4ac82e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 20, 2026
68fd333
Move example model to actual models
maxschulz-COL Jan 20, 2026
19c9250
Filter for private attributes and private validators
maxschulz-COL Jan 20, 2026
8f5e935
make validators have hyperlinks through docstring
maxschulz-COL Jan 20, 2026
655d5f7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 20, 2026
aeb2f83
Clean up defaults
maxschulz-COL Jan 20, 2026
ad619df
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 20, 2026
945a664
Merge branch 'main' into docs/mkdocstring_2
maxschulz-COL Jan 20, 2026
51495b6
Changelog
maxschulz-COL Jan 20, 2026
d47df22
Remove example model
maxschulz-COL Jan 20, 2026
24b6116
UPdated schema
maxschulz-COL Jan 20, 2026
2c3bf3c
Add back the commented out validators
maxschulz-COL Jan 21, 2026
766f7da
Minimal version black
maxschulz-COL Jan 21, 2026
5330322
Update vizro-core/docs/griffe_extensions.py
maxschulz-COL Jan 21, 2026
e7c5244
Small cleanup
maxschulz-COL Jan 21, 2026
166f1ed
Merge branch 'main' into docs/mkdocstring_2
maxschulz-COL Jan 23, 2026
c7a8d61
removing docstrings also from actions
maxschulz-COL Jan 23, 2026
38507fc
Use template overwrite
maxschulz-COL Jan 26, 2026
354f6f3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 26, 2026
14689c4
Fix autorefs
maxschulz-COL Jan 26, 2026
df93729
Merge branch 'docs/mkdocstring_2' of github.com:mckinsey/vizro into d…
maxschulz-COL Jan 26, 2026
cade86c
Schema
maxschulz-COL Jan 26, 2026
4392f59
Remove constants
maxschulz-COL Jan 26, 2026
d7376e5
Linter
maxschulz-COL Jan 26, 2026
cf094eb
Merge branch 'main' into docs/mkdocstring_2
maxschulz-COL Jan 27, 2026
14c7a5b
Update vizro-core/docs/griffe_extensions.py
maxschulz-COL Jan 28, 2026
8343251
Merge branch 'main' into docs/mkdocstring_2
maxschulz-COL Jan 28, 2026
a07a429
Checked setting, and removed one logger mention
maxschulz-COL Jan 28, 2026
0578db8
PR comments
maxschulz-COL Jan 28, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
.playwright-mcp/

# Translations
*.mo
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
A new scriv changelog fragment.

Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Highlights ✨

- A bullet item for the Highlights ✨ category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Removed

- A bullet item for the Removed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Added

- A bullet item for the Added category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Changed

- A bullet item for the Changed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Deprecated

- A bullet item for the Deprecated category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Fixed

- A bullet item for the Fixed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Security

- A bullet item for the Security category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
46 changes: 46 additions & 0 deletions vizro-core/docs/griffe_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import griffe

logger = griffe.get_logger("griffe_dynamically_inspect")
filter_logger = griffe.get_logger("griffe_filter_private_attrs")


class DynamicallyInspect(griffe.Extension):
Expand Down Expand Up @@ -33,3 +34,48 @@ def on_instance(self, *, obj: griffe.Object, **kwargs): # noqa: D102
logger.info("Dynamically inspecting '%s'", obj.path)
inspected_module = griffe.inspect(obj.module.path, filepath=obj.filepath)
obj.parent.set_member(obj.name, inspected_module[obj.name])


class FilterPrivateAttrs(griffe.Extension):
"""An extension to filter out private members from Pydantic model documentation.

This filters out:
- Attributes defined with PrivateAttr()
- The 'type' discriminator field
- Any methods/validators starting with underscore (e.g. _make_actions_chain)
"""

def __init__(self, **kwargs):
"""Accept kwargs for griffe compatibility."""

def _filter_private_attrs(self, cls: griffe.Class) -> None:
"""Filter out private members from a Pydantic model class."""
try:
from pydantic import BaseModel

python_obj = griffe.dynamic_import(cls.path)
if python_obj is None or not issubclass(python_obj, BaseModel):
return

private_attrs = getattr(python_obj, "__private_attributes__", {})
for name in list(cls.members.keys()):
if name in private_attrs:
cls.del_member(name)
filter_logger.info(f"Filtered out PrivateAttr '{name}' from {cls.path}")
elif name == "type":
cls.del_member(name)
filter_logger.info(f"Filtered out 'type' field from {cls.path}")
elif name.startswith("_") and not name.startswith("__"):
cls.del_member(name)
filter_logger.info(f"Filtered out private member '{name}' from {cls.path}")
except (ImportError, AttributeError, TypeError):
pass

def on_class_members(self, *, cls: griffe.Class, **kwargs):
"""Filter out PrivateAttr members when class members are collected."""
self._filter_private_attrs(cls)

def on_instance(self, *, obj: griffe.Object, **kwargs):
"""Filter out PrivateAttr members after all processing is complete."""
if isinstance(obj, griffe.Class):
self._filter_private_attrs(obj)
11 changes: 11 additions & 0 deletions vizro-core/docs/pages/API-reference/constants.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Constants

Constants used in Vizro.

<!-- vale off -->

::: vizro._constants.GAP_DEFAULT

::: vizro.models._grid.MIN_DEFAULT

<!-- vale on -->
1 change: 1 addition & 0 deletions vizro-core/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ dependencies = [
"linkchecker",
"mkdocs-open-in-new-tab",
"mkdocs-pycafe",
"griffe-pydantic",
"PyGithub",
"playwright"
]
Expand Down
14 changes: 13 additions & 1 deletion vizro-core/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ nav:
- Table functions: pages/API-reference/table-callables.md
- Figure functions: pages/API-reference/figure-callables.md
- Kedro integration: pages/API-reference/kedro-integration.md
- Constants: pages/API-reference/constants.md
- Deprecations: pages/API-reference/deprecations.md
- Find out more:
- Technical:
Expand Down Expand Up @@ -219,7 +220,12 @@ plugins:
merge_init_into_class: true
docstring_section_style: list
separate_signature: true
# filters: ["!^_"]
unwrap_annotated: true # check effect
show_symbol_type_heading: true
show_symbol_type_toc: false
signature_crossrefs: true
show_signature_annotations: true
filters: ["!^_"] # Hide private attributes (names starting with underscore)
show_root_heading: true
docstring_options:
ignore_init_summary: true
Expand All @@ -232,7 +238,13 @@ plugins:
- griffe_warnings_deprecated:
kind: danger
title: Deprecated
- griffe_pydantic:
schema: true
- docs/griffe_extensions.py:FilterPrivateAttrs
paths: [src]
inventories:
- https://docs.python.org/3/objects.inv
- https://docs.pydantic.dev/latest/objects.inv
- git-revision-date-localized:
enable_creation_date: false
extra_css:
Expand Down
Loading
Loading