Skip to content

Commit

Permalink
change mapping to dict so typechecking pass
Browse files Browse the repository at this point in the history
  • Loading branch information
digicosmos86 committed Nov 14, 2023
1 parent 4362821 commit 831aed5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/hssm/distribution_utils/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import logging
from os import PathLike
from typing import Any, Callable, Iterable, Type
from typing import Any, Callable, Type

import bambi as bmb
import numpy as np
Expand Down Expand Up @@ -384,7 +384,7 @@ def dist(cls, **kwargs): # pylint: disable=arguments-renamed

def logp(data, *dist_params): # pylint: disable=E0213
num_params = len(list_params)
extra_fields: Iterable[np.ndarray] = []
extra_fields = []

if num_params < len(dist_params):
extra_fields = dist_params[num_params:]
Expand Down
18 changes: 9 additions & 9 deletions src/hssm/plotting/quantile_probability.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging
from itertools import product
from typing import Any, Iterable, Mapping
from typing import Any, Iterable

import arviz as az
import matplotlib as mpl
Expand Down Expand Up @@ -36,8 +36,8 @@ def _plot_quantile_probability_1D(
xlabel: str | None = "Proportion",
ylabel: str | None = None,
xticklabels: Iterable["str"] | None = None,
data_kwargs: Mapping[str, Any] | None = None,
pps_kwargs: Mapping[str, Any] | None = None,
data_kwargs: dict[str, Any] | None = None,
pps_kwargs: dict[str, Any] | None = None,
**kwargs,
) -> mpl.axes.Axes:
"""Produce one quantile probability plot.
Expand Down Expand Up @@ -129,9 +129,9 @@ def _plot_quantile_probability_2D(
xlabel: str | None = "Proportion",
ylabel: str | None = None,
xticklabels: Iterable["str"] | None = None,
grid_kwargs: Mapping[str, Any] | None = None,
data_kwargs: Mapping[str, Any] | None = None,
pps_kwargs: Mapping[str, Any] | None = None,
grid_kwargs: dict[str, Any] | None = None,
data_kwargs: dict[str, Any] | None = None,
pps_kwargs: dict[str, Any] | None = None,
**kwargs,
) -> sns.FacetGrid:
"""Plot the quantile probabilities against the observed data.
Expand Down Expand Up @@ -207,9 +207,9 @@ def plot_quantile_probability(
xlabel: str | None = "Proportion",
ylabel: str | None = None,
xticklabels: Iterable["str"] | None = None,
grid_kwargs: Mapping[str, Any] | None = None,
data_kwargs: Mapping[str, Any] | None = None,
pps_kwargs: Mapping[str, Any] | None = None,
grid_kwargs: dict[str, Any] | None = None,
data_kwargs: dict[str, Any] | None = None,
pps_kwargs: dict[str, Any] | None = None,
**kwargs,
) -> sns.FacetGrid:
"""Plot the quantile probabilities against the observed data.
Expand Down
4 changes: 2 additions & 2 deletions src/hssm/plotting/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Plotting utilities for HSSM."""

import logging
from typing import Any, Iterable, Mapping, cast
from typing import Any, Iterable, cast

import arviz as az
import numpy as np
Expand Down Expand Up @@ -311,7 +311,7 @@ def _check_groups_and_groups_order(
)
if groups_order is not None:
if isinstance(groups_order, Iterable) and not isinstance(
groups_order, Mapping
groups_order, dict
):
if not isinstance(groups, str):
raise ValueError(
Expand Down

0 comments on commit 831aed5

Please sign in to comment.