You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lines 560 and 676 use # type: ignore[attr-defined], but mypy emits [union-attr] errors. The mismatched code means the ignores have no effect, and mypy fails during pre-commit.
plot_unit_effects (line 683) uses float(...) on an xarray result that can have a leftover treated_units dimension, causing TypeError: only 0-dimensional arrays can be converted to Python scalars. This makes test_panel_regression_plot_unit_effects fail on main (Python 3.14).
Description
panel_regression.pyhas two bugs:Lines 560 and 676 use
# type: ignore[attr-defined], but mypy emits[union-attr]errors. The mismatched code means the ignores have no effect, and mypy fails during pre-commit.plot_unit_effects(line 683) usesfloat(...)on an xarray result that can have a leftovertreated_unitsdimension, causingTypeError: only 0-dimensional arrays can be converted to Python scalars. This makestest_panel_regression_plot_unit_effectsfail on main (Python 3.14).Root cause
PanelRegressionexperiment class for fixed effects estimation #628).self.idatacan beNone, so accessing.posterioris aunion-attrerror, notattr-defined.beta.sel(...).mean(dim=["chain", "draw"])returns an array with atreated_unitsdimension, not a scalar.Fix
[attr-defined]with[union-attr]on lines 560 and 676.float(...)with.item()on line 683.