ActivitySim / activitysim

An Open Platform for Activity-Based Travel Modeling
https://activitysim.github.io
BSD 3-Clause "New" or "Revised" License
195 stars 99 forks source link

Pandas 1.5 breaks trip purpose for some models #608

Closed jpn-- closed 1 year ago

jpn-- commented 2 years ago

In the choose_intermediate_trip_purpose function, there is an iloc assignment here that now triggers a pandas FutureWarning. This breaks our tests.

i-am-sijia commented 2 years ago

Following up on this thread. It seems the develop branch and the parking location choice PR (#620) are failing the tests due to this pandas FutureWarning.

My thoughts on options of solution:

@jpn-- How is the main branch able to pass the tests with strict = True?

jpn-- commented 2 years ago

The main branch passed its tests because our last release of ActivitySim was 1.1.3 on Sept 13th. Pandas 1.5 was released a week later on Sept 19th. If the tests were re-run today on the main branch, they would fail.

Your option 2 is the correct answer for the long run; we want to stay compatible with the latest Pandas in general. As this is just a warning and not a "real" error we have not scrambled to fix this urgently. Option 3 is easy and has been used as a stopgap in some PRs until we get option 2 done.

At some point in the future the warning will become a bonafide error, and having the strict tests makes sure we know about these changes with plenty of time to repair before they get serious.

jpn-- commented 1 year ago

Closed by #629