Skip to content

Draft: Modernize codebase for Pandas 2.2+ and NumPy 2.0+ compatibility#19

Draft
andrewendlinger wants to merge 2 commits intoHawkMRS:mainfrom
andrewendlinger:refactor/modernise-dependencies
Draft

Draft: Modernize codebase for Pandas 2.2+ and NumPy 2.0+ compatibility#19
andrewendlinger wants to merge 2 commits intoHawkMRS:mainfrom
andrewendlinger:refactor/modernise-dependencies

Conversation

@andrewendlinger
Copy link
Contributor

Resolves #17 (Long-term solution)

What does this PR do?
This Draft PR begins the process of refactoring the codebase to comply with the strict type-enforcement and Copy-on-Write behaviors introduced in recent versions of Pandas (>= 2.2.0) and NumPy (>= 2.0.0), as well as modern lmfit/asteval versions.

This is the long-term solution to the temporary dependency pins implemented in #18 .

Feel free to push commits directly to this branch or let me know if anyone wants to take the lead on finishing this!

Removes float32 downcasting in `safe_convert_to_numeric` and
ensures numeric columns are cast to float64 in `unitconverter`. This
resolves a `LossySetitemError` in pandas 2.2+ caused by attempting to
insert float64 constants (e.g., `np.pi`) into float32 columns.
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.

Crashes with Pandas 2.2+ and NumPy 2.0+ due to strict type enforcement

1 participant