Skip to content

Conversation

@maltekuehl
Copy link
Collaborator

Reference Issue or PRs

See: https://scverse.zulipchat.com/#narrow/channel/316218-repo-management/topic/Upcoming.20Pandas.203.2E0.2E0.20release/with/569443597

What does your PR implement? Be specific.

Fixes pandas 3 (now released) incompatibility due to bool to float conversion & update on copy of DataFrame errors as well as explicit keyword arguments on mean/sum.

  • Version bumped to 0.5.4, as there should be no incompatibilies.
  • Changed all instances of .sum(0)/.mean(0)/.sum()/.mean() to `.sum(axis=0)/.mean(axis=0)
  • Initialized convergence tracking columns with nullable boolean pd.array instead of float64 np.array with np.nan, so that bool assignments are possible without conversion / error
  • Changed LFC shrinkage update, since in pandas 3 it would update a copy (views are now copies) instead of the original df. Since there is the theoretic possibility of SE/LFC being NaN or inifinite after shrinkage, implemented a isfinite check to match previous behavior of only updating on non-NaN values. However, since I personally find this to be unexpected behavior (I would not expect lfc_shrink to silently perform partial shrinkage), I have now added a warning informing users when partial shrinkage occurs (should be almost never, but I cannot exclude that this cannot happen).
  • I have build the docs & compared all LFC array prints in the notebooks to the previous version and they match 1:1 and all tests are passing.

Copy link
Collaborator

@grst grst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I have two unrelated comments -- not necessary to fix in this PR.

@maltekuehl
Copy link
Collaborator Author

LGTM, I have two unrelated comments -- not necessary to fix in this PR.

Thanks! Agree with the proposed changes, but outside the scope of what I can allocate time to this week. Since it's currently broken with pandas 3, probably best to raise an issue for these points for a follow up PR.

@grst grst merged commit bbb80e1 into scverse:main Jan 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants