Skip to content

Commit 122ab48

Browse files
improve type hint
1 parent 646d99e commit 122ab48

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pymc_extras/statespace/core/statespace.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22

33
from collections.abc import Callable, Sequence
4-
from typing import Any
4+
from typing import Any, Literal
55

66
import numpy as np
77
import pandas as pd
@@ -1109,7 +1109,7 @@ def _sample_conditional(
11091109
group: str,
11101110
random_seed: RandomState | None = None,
11111111
data: pt.TensorLike | None = None,
1112-
mvn_method: str = "svd",
1112+
mvn_method: Literal["cholesky", "eigh", "svd"] = "svd",
11131113
**kwargs,
11141114
):
11151115
"""
@@ -1230,7 +1230,7 @@ def _sample_unconditional(
12301230
steps: int | None = None,
12311231
use_data_time_dim: bool = False,
12321232
random_seed: RandomState | None = None,
1233-
mvn_method: str = "svd",
1233+
mvn_method: Literal["cholesky", "eigh", "svd"] = "svd",
12341234
**kwargs,
12351235
):
12361236
"""
@@ -1349,7 +1349,7 @@ def sample_conditional_prior(
13491349
self,
13501350
idata: InferenceData,
13511351
random_seed: RandomState | None = None,
1352-
mvn_method: str = "svd",
1352+
mvn_method: Literal["cholesky", "eigh", "svd"] = "svd",
13531353
**kwargs,
13541354
) -> InferenceData:
13551355
"""
@@ -1390,7 +1390,7 @@ def sample_conditional_posterior(
13901390
self,
13911391
idata: InferenceData,
13921392
random_seed: RandomState | None = None,
1393-
mvn_method: str = "svd",
1393+
mvn_method: Literal["cholesky", "eigh", "svd"] = "svd",
13941394
**kwargs,
13951395
):
13961396
"""
@@ -1432,7 +1432,7 @@ def sample_unconditional_prior(
14321432
steps: int | None = None,
14331433
use_data_time_dim: bool = False,
14341434
random_seed: RandomState | None = None,
1435-
mvn_method: str = "svd",
1435+
mvn_method: Literal["cholesky", "eigh", "svd"] = "svd",
14361436
**kwargs,
14371437
) -> InferenceData:
14381438
"""
@@ -1497,7 +1497,7 @@ def sample_unconditional_posterior(
14971497
steps: int | None = None,
14981498
use_data_time_dim: bool = False,
14991499
random_seed: RandomState | None = None,
1500-
mvn_method: str = "svd",
1500+
mvn_method: Literal["cholesky", "eigh", "svd"] = "svd",
15011501
**kwargs,
15021502
) -> InferenceData:
15031503
"""
@@ -1994,7 +1994,7 @@ def forecast(
19941994
filter_output="smoothed",
19951995
random_seed: RandomState | None = None,
19961996
verbose: bool = True,
1997-
mvn_method: str = "svd",
1997+
mvn_method: Literal["cholesky", "eigh", "svd"] = "svd",
19981998
**kwargs,
19991999
) -> InferenceData:
20002000
"""
@@ -2194,7 +2194,7 @@ def impulse_response_function(
21942194
shock_trajectory: np.ndarray | None = None,
21952195
orthogonalize_shocks: bool = False,
21962196
random_seed: RandomState | None = None,
2197-
mvn_method: str = "svd",
2197+
mvn_method: Literal["cholesky", "eigh", "svd"] = "svd",
21982198
**kwargs,
21992199
):
22002200
"""

0 commit comments

Comments
 (0)