diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4dc249b2..35db4162 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -89,10 +89,10 @@ jobs: uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload - name: Upload coverage - uses: codecov/codecov-action@v6 + uses: codecov/codecov-action@v7 with: + token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true - use_oidc: true check: name: Tests pass in all hatch environments diff --git a/pertpy/tools/_coda/_base_coda.py b/pertpy/tools/_coda/_base_coda.py index d929e739..3b6f70fd 100644 --- a/pertpy/tools/_coda/_base_coda.py +++ b/pertpy/tools/_coda/_base_coda.py @@ -556,8 +556,11 @@ def summary_prepare( ) summ = summ.convert_dtypes(dtype_backend="numpy_nullable").infer_objects() + # az.summary orders rows by var_names then C-order of each variable's dims, matching values.flatten(), so align the medians positionally. posterior = arviz_data["posterior"].to_dataset() - summ["median"] = posterior[var_names].median(dim=["chain", "draw"]).to_dataframe().stack().reindex(summ.index) + summ["median"] = np.concatenate( + [posterior[var].median(dim=["chain", "draw"]).values.flatten() for var in var_names] + ) effect_df = summ.loc[summ.index.str.match("|".join([r"beta\["]))].copy() intercept_df = summ.loc[summ.index.str.match("|".join([r"alpha\["]))].copy()