From d25a46b6c33d74b38917bfd5a323aeba02ae3ab0 Mon Sep 17 00:00:00 2001 From: michaeldeistler Date: Mon, 4 Dec 2023 10:55:01 +0100 Subject: [PATCH] Pyright fixes for plot.py --- sbi/analysis/plot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbi/analysis/plot.py b/sbi/analysis/plot.py index 9b52974ab..5a42c72e0 100644 --- a/sbi/analysis/plot.py +++ b/sbi/analysis/plot.py @@ -954,7 +954,7 @@ def _get_default_opts(): "samples_colors": plt.rcParams["axes.prop_cycle"].by_key()["color"][0::2], "points_colors": plt.rcParams["axes.prop_cycle"].by_key()["color"][1::2], # ticks - "tickformatter": mpl.ticker.FormatStrFormatter("%g"), + "tickformatter": mpl.ticker.FormatStrFormatter("%g"), # type: ignore "tick_labels": None, # options for hist "hist_diag": { @@ -1068,7 +1068,7 @@ def _sbc_rank_plot( show_ylabel: bool = False, sharey: bool = False, fig: Optional[Figure] = None, - ax: Optional[Axes] = None, + ax=None, # no type hint to avoid hassle with pyright. Should be `array(Axes).` figsize: Optional[tuple] = None, ) -> Tuple[Figure, Axes]: """Plot simulation-based calibration ranks as empirical CDFs or histograms.