Skip to content

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

@andrewendlinger

Description

@andrewendlinger

Describe the bug

Running pyAMARES with recent versions of pandas (>= 2.2.0) and numpy (>= 2.0.0) causes multiple crashes. This happens because these newer versions removed legacy behaviors like implicit upcasting (causing LossySetitemError) and introduced strict typing for empty DataFrames (causing .str accessor AttributeErrors).

Expected behavior

The package should reliably process prior knowledge and fit data without crashing in modern Python environments.

Proposed Solution

  1. Short-term: Pin pandas < 2.2.0 and numpy < 2.0.0 in the package requirements to immediately restore stability.
  2. Long-term: Refactor the codebase to properly handle strict type casting and empty DataFrames to support modern dependency versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions