Skip to content

Commit

Permalink
Add parent Record class to _MonthlyRecord to fix autodoc error
Browse files Browse the repository at this point in the history
  • Loading branch information
huard committed Feb 11, 2025
1 parent 7e2ed40 commit fa48c8f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ v0.18.0 (unreleased)
* New `pre-commit` hooks for `vulture` (find dead code) and `codespell` (spelling errors).
* Removed several `type: ignore` statements.
* Spelling errors in documentation have been addressed.
* Fix bug in _MonthlyRecord class definition crashing the pydantic-autodoc serialization. (PR #458)

v0.17.0 (2025-01-27)
--------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def rebuild_readme():
"sphinx_codeautolink",
"sphinx_copybutton",
"sphinxcontrib.cairosvgconverter",
# "sphinxcontrib.autodoc_pydantic", # FIXME: Does not seem to be compatible with RavenPy codebase.
"sphinxcontrib.autodoc_pydantic", # FIXME: Does not seem to be compatible with RavenPy codebase.
]

linkcheck_ignore = [
Expand Down
6 changes: 2 additions & 4 deletions src/ravenpy/config/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1077,11 +1077,9 @@ class TerrainClasses(ListCommand):
_Units: Sequence[str] = PrivateAttr(["m", "km/km2"])


class _MonthlyRecord:
class _MonthlyRecord(Record):
name: str = "[DEFAULT]"
values: Sequence[float] = 12 * [
1.0,
]
values: Sequence[float] = 12 * [1.0]

def __str__(self):
return f"{self.name:<16} " + ", ".join(map(str, self.values))
Expand Down

0 comments on commit fa48c8f

Please sign in to comment.