Skip to content

Commit

Permalink
better docstrings, better docs
Browse files Browse the repository at this point in the history
  • Loading branch information
d-v-b committed Feb 28, 2024
1 parent de19417 commit 4b9f7ce
Show file tree
Hide file tree
Showing 9 changed files with 949 additions and 700 deletions.
1 change: 1 addition & 0 deletions docs/api/v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: pydantic_zarr.v2
1 change: 1 addition & 0 deletions docs/api/v3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: pydantic_zarr.v3
4 changes: 2 additions & 2 deletions docs/usage_zarr_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ except ValidationError as exc:
1 validation error for GroupSpec[GroupAttrs, ~TItem]
attributes.b
Input should be a valid integer, unable to parse string as an integer [type=int_parsing, input_value='foo', input_type=str]
For further information visit https://errors.pydantic.dev/2.4/v/int_parsing
For further information visit https://errors.pydantic.dev/2.6/v/int_parsing
"""

# this passes validation
Expand All @@ -151,7 +151,7 @@ except ValidationError as exc:
1 validation error for GroupSpec[~TAttr, ArraySpec]
members.foo
Input should be a valid dictionary or instance of ArraySpec [type=model_type, input_value=GroupSpec(zarr_version=2,...tributes={}, members={}), input_type=GroupSpec]
For further information visit https://errors.pydantic.dev/2.4/v/model_type
For further information visit https://errors.pydantic.dev/2.6/v/model_type
"""

# this passes validation
Expand Down
13 changes: 11 additions & 2 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,23 @@ nav:
- About: index.md
- Usage (Zarr V3): usage_zarr_v3.md
- Usage (Zarr V2): usage_zarr_v2.md
- API: api/core.md
- API:
- core: api/core.md
- v2: api/v2.md
- v3: api/v3.md

plugins:
- mkdocstrings:
handlers:
python:
options:
show_signature_annotations: true
docstring_style: numpy
members_order: source
separate_signature: true
filters: ["!^_"]
docstring_options:
ignore_init_summary: true
merge_init_into_class: true

markdown_extensions:
- pymdownx.highlight:
Expand Down
1,073 changes: 544 additions & 529 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion src/pydantic_zarr/core.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
from __future__ import annotations
from typing import Any, Dict, Literal, Mapping, Set, TypeAlias, Union
from typing import (
Any,
Dict,
Literal,
Mapping,
Set,
TypeAlias,
Union,
)
from pydantic import BaseModel, ConfigDict

IncEx: TypeAlias = Union[Set[int], Set[str], Dict[int, Any], Dict[str, Any], None]
Expand Down
Loading

0 comments on commit 4b9f7ce

Please sign in to comment.