gsee icon indicating copy to clipboard operation
gsee copied to clipboard

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

Open phumthep opened this issue 1 year ago • 0 comments

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

phumthep avatar Oct 16 '24 19:10 phumthep