Skip to content

Pandas 1.5 breaks trip purpose for some models #608

Closed

Description

@jpn--

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

Activity

  1. i-am-sijia commented on Nov 2, 2022

    @i-am-sijia
    Member

    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:

    • Option 1: Change strict to False in test settings to not error out on warnings. This would be a quick work-around, but I can see reasons for keeping strict to True. In addition, in prototype_arc and prototype_semcog strict is set to False, but in prototype_mtc and others strict is set to True, at least we should make them consistent.
    • Option 2: Update the triggering line to conform with future pandas. To me, this would be the preferred solution. I'm not sure what's the protocol on keeping ActivitySim codes compatible with newer versions of dependencies, I guess people just update codes when FutureWarnings come up?
    • Option 3: Constrain pandas version. To me, this should be the least preferred option.

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

  2. jpn-- commented on Nov 2, 2022

    @jpn--
    MemberAuthor

    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.

  3. jpn-- commented on Dec 14, 2022

    @jpn--
    MemberAuthor

    Closed by #629

  4. added a commit that references this issue on Feb 11, 2023
  5. added a commit that references this issue on Mar 21, 2023
  6. added a commit that references this issue on Apr 17, 2023
  7. added a commit that references this issue on Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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