Skip to content

Compatibility issue with latest Pandas version in gsee.pv.run_model #18

@phumthep

Description

@phumthep

Description:

When using gsee.pv.run_model with the newest version of Pandas, I encountered the following issues that require fixes:

  1. trigon.py, line 104: The indexing mechanism needs to be updated to handle the latest Pandas changes.
  • Current: rise_set_times.loc[item.date()]
  • Proposed: rise_set_times.loc[str(item.date())]
  • Reasoning: It seems the .date() method now returns a datetime object that is not directly compatible with Pandas indexing, requiring a conversion to a string representation.
  1. pv.py, line 243: The clip method usage needs to be adjusted.
  • Current: clip_upper(capacity)
  • Proposed: clip(upper=capacity)
  • Reasoning: The clip_upper method appears to be deprecated in newer Pandas versions. The clip method with the upper argument provides the same functionality.
  • These modifications ensure compatibility with the latest Pandas version and prevent errors when using gsee.pv.run_model.

Additional Information:

  • The function gsee.pv.run_model has working after the proposed changes
  • Pandas version: 2.1.1
  • gsee version: 0.3.1
  • Python version: 3.10.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions