Skip to content

Docstring + naming + repr cleanup, bump 0.0.6 #78

Closed

Description

@thomaspinder

Context

Audit reports/audit-2026-05-18.md findings #5, #8, #12,
#13, #14, #15, #16. These are individually small but
cluster naturally into one style/cleanup PR.

# Surface Issue
5 volatility.py:Constant cholesky_path / forecast_cholesky_path docstrings reference Sigma, but code reads L after PR #69.
8 sv/data.py:SVData _MIN_OBS: int = 24 relies on Pydantic's implicit underscore handling — annotate as ClassVar to make the class-attribute intent explicit.
12 fitted.py:FittedVAR.has_exog @computed_field means it appears in model_dump() though only used internally — should be a plain @property.
13 sv/dynamics.py RandomWalk.build_latent_path / AR1.build_latent_path use Any for typed parameters declared on the SVDynamics Protocol — should be "pt.TensorVariable" forward refs.
14 results.py:VARResultBase __repr__ override always returns "ClassName()". Pydantic's default produces a useful compact repr because every idata field has Field(repr=False).
15 All src/impulso/**/*.py Inconsistent docstring style: double backticks (RST) vs single backticks (Markdown); :meth: / :class: cross-refs vs plain text. mkdocstrings expects single backticks.
16 identified.py forecast_error_variance_decomposition is the canonical name with fevd as alias. Per decisions ledger Q8: hard rename — fevd is canonical, long name deleted.

Resolution

Per plans/2026-05-18-audit-cleanup-plan.md PR4. Also:

Acceptance

  1. make check && make test clean.
  2. make docs-render-ci clean.
  3. grep -r "forecast_error_variance_decomposition" src/ tests/ docs/
    returns nothing.
  4. grep -r ":meth:\|:class:" src/ returns nothing.
  5. grep -rn '\`' src/` returns nothing inside docstrings.
  6. SVData._MIN_OBS is a class attribute (not in model_fields):
    assert "_MIN_OBS" not in SVData.model_fields.
  7. FittedVAR(...).model_dump() does not include has_exog.
  8. repr(ForecastResult(...)) shows steps=..., var_names=[...] and
    omits idata.
  9. pyproject.toml shows version = "0.0.6".

Shipping

PR4 (final layer) of the 4-PR audit stack, stacked on top of #77 (PR3).

Breaking change (pre-v0.1)

IdentifiedVAR.forecast_error_variance_decomposition is removed. Callers
must use the existing canonical IdentifiedVAR.fevd (no signature
change). Justification: pre-v0.1 API breaks are in scope per repo policy,
and the long name was always an alias.

Activity

  1. added a commit that references this issue on May 18, 2026
    6ed2c7e
  2. added a commit that references this issue on May 21, 2026
    0b341ae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions