NOAA-OWP / t-route

Tree based hydrologic and hydraulic routing
Other
40 stars 45 forks source link

Index column in dataframes handled differently in Pandas 2.X.X versus 1.X.X. #706

Open JurgenZach-NOAA opened 7 months ago

JurgenZach-NOAA commented 7 months ago

t-route was found to have trouble with pandas version 2.X.X. versus 1.X.X., which was ultimately traced to some function calls regarding the index column (such as .max()) failing in 2.X.X. This gave rise to at least two pull requests:

These PRs have been successfully addressed through a patch in the commit ce32c03: https://github.com/NOAA-OWP/t-route/commit/ce32c0364103c4e2f7b7a53bffe79dc27edef045

While ce32c03 fixes immediate compatibility of t-route to the most recent pandas versions, the discussions in PRs 684 and 690 are valuable advice: to not assume that the index column in any data frames can be treated as numerical values.

Current behavior

The original incompatibility has been corrected, but the same misunderstanding that gave rise to it should be avoided, especially given the importance of the index column in dataframes in t-route.

Expected behavior

Steps to replicate behavior (include URLs)

  1. See PR 690 and 684

Screenshots