Skip to content

Commit

Permalink
Re-run example notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegrabowski committed Jan 6, 2025
1 parent 2e5f0a6 commit 4a86cad
Show file tree
Hide file tree
Showing 2 changed files with 444 additions and 162 deletions.
578 changes: 424 additions & 154 deletions notebooks/Making a Custom Statespace Model.ipynb

Large diffs are not rendered by default.

28 changes: 20 additions & 8 deletions pymc_extras/statespace/core/statespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,27 @@ def __init__(
self.requirement_table.add_column("Constraints", justify="left")
self.requirement_table.add_column("Dimensions", justify="right")

self._populate_prior_requirements()
self._populate_data_requirements()
has_prior_info = False
has_data_info = False
try:
self.param_info
has_prior_info = True
except NotImplementedError:
pass

try:
self.data_info
has_data_info = True
except NotImplementedError:
pass

if has_prior_info:
self._populate_prior_requirements()

if verbose:
if has_data_info:
self._populate_data_requirements()

if verbose and (has_prior_info or has_data_info):
console = Console()
console.print(self.requirement_table)

Expand All @@ -296,11 +313,6 @@ def _populate_data_requirements(self) -> None:
"""
Add requirements about the data needed for the model, including their names, shapes, and named dimensions.
"""
try:
self.data_info
except NotImplementedError:
return

self.requirement_table.add_section()

for data, info in self.data_info.items():
Expand Down

0 comments on commit 4a86cad

Please sign in to comment.