Skip to content

Fixing FutureWarnings #156

Closed
Closed

Description

@patrickleonardy

Fixing FutureWarnings

Task:
Currently there are a lot of FutureWarinings (generated by pandas) popping up in Cobra that clutter up once notebook. We should change this behavior such that cobra is up to date.

Task Description

This issue will:

  • Adapt the cobra code such that no more FutureWarnings appear.
  • Cobra get a setting that allows the user to suppress FutureWarings
  • We could also see if it is possible to implement some checks that we are up to date if something changes in the libraries that we are using.

Activity

  1. added this to the milestone on Apr 3, 2023
  2. pietrodantuono commented on Apr 3, 2023

    @pietrodantuono

    Not a solution, rather a workaround:

    In your notebook or script you can suppress the future warnings explicitly as follows:

    import warnings
    warnings.simplefilter(action='ignore', category=FutureWarning)

    Some discussion

    Possibility 1

    If the warnings stem from the pandas.append action, then the append method should be replaced with pandas.concat.

    Possibility 2

    Alternatively, one could think of explicitly setting an old version of pandas in the cobra requirements so that pandas won't complain anymore (for the append vs concat example given pandas<1.4.0).

  3. ZlaTanskY commented on Apr 4, 2023

    @ZlaTanskY
    Contributor

    Depending on what the warnings are, I disagree with adding a cobra setting to suppress the warnings. If the warnings are on our (cobra) side, we should fix them instead of suppressing them.

  4. sandervh14 commented on Apr 6, 2023

    @sandervh14
    Contributor

    To help you decide on this, possibility 1 and 2 are covered with #159 and #160. Since short term fix would be to impose our users to use only pandas<2 (#159), I side with @ZlaTanskY and would say indeed, let's not filter them, imposing the pandas<2 will make sure they never get to see the warnings anyway.

  5. sandervh14 commented on Apr 6, 2023

    @sandervh14
    Contributor

    I see in the pull request that you fixed the .loc stuff to avoid the FutureWarnings. With the above two comments, don't ditch the pull request you've made however, it's still relevant to #160! Maybe link the pull request to #160 instead of this issue #156, and if this issue #156 is only about suppressing future warnings, then you can close this one since both me and Jano voted against supressing.

  6. patrickleonardy commented on Apr 6, 2023

    @patrickleonardy
    ContributorAuthor

    I did nothing to suppress them I only changed the code that was raising FutureWarnings to an other syntax that does not raise a FutureWarning. Including things that are linked to #160
    When you say that I should not ditch it you mean that I should not yet merge it and only merge it with #160 ?

  7. modified the milestones: , 2023-05 on May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions