Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unpin pandas<1.3 #794

Closed
raybellwaves opened this issue Aug 17, 2021 · 4 comments · Fixed by #798
Closed

unpin pandas<1.3 #794

raybellwaves opened this issue Aug 17, 2021 · 4 comments · Fixed by #798
Assignees

Comments

@raybellwaves
Copy link

raybellwaves commented Aug 17, 2021

  • xclim version: 0.28.1
  • Python version: 3.9.6
  • Operating System: Mac

Description

I bumped my conda environment today and I realised my pandas version got downgraded. From running mamba repoquery whoneeds pandas I noticed it's pinned to <1.3
https://github.com/Ouranosinc/xclim/blob/master/setup.py#L26
in this repo.

I had a quick look in the issue tracker and couldn't find any issues on this so wanted to raise this here. There may be good reason why it's pinned. Happy to help work on unpinning it if it's desired.

@raybellwaves
Copy link
Author

found a PR related to this: #763

@raybellwaves
Copy link
Author

raybellwaves commented Aug 17, 2021

pytest --nbval docs/notebooks passed with latest pandas
pytest --rootdir=xclim/testing/tests --xdoctest xcli gives one failure (https://github.com/Ouranosinc/xclim/blob/master/xclim/testing/tests/test_calendar.py#L57)

FAILED xclim/testing/tests/core/calendar.py::time_bnds:0

Ran pytest --rootdir=xclim/testing/tests --xdoctest xclim --pdb and see

❯ pytest --rootdir=xclim/testing/tests --xdoctest xclim --pdb
==================================================== test session starts =====================================================
platform darwin -- Python 3.9.6, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- /Users/ray/miniconda3/envs/xclim/bin/python
cachedir: .pytest_cache
rootdir: /Users/ray/Documents/PYTHON_dev/xclim/xclim/testing/tests, configfile: ../../../setup.cfg
plugins: cov-2.12.1, xdoctest-0.15.6, nbval-0.9.6
collected 1167 items

xclim/testing/tests/core/bootstrapping.py::percentile_bootstrap:0 PASSED                                               [  0%]
xclim/testing/tests/core/calendar.py::time_bnds:0 FAILED                                                               [  0%]
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
* REASON: GotWantException
DOCTEST DEBUG INFO
  XDoc "/Users/ray/Documents/PYTHON_dev/xclim/xclim/core/calendar.py::time_bnds:0", line 5 <- wrt doctest
  File "/Users/ray/Documents/PYTHON_dev/xclim/xclim/core/calendar.py", line 806, <- wrt source file
DOCTEST PART BREAKDOWN
Passed Parts:
    1 >>> from xarray import cftime_range
    2 >>> from xclim.core.calendar import time_bnds
    3 >>> index = cftime_range(start='2000-01-01', periods=3, freq='2QS', calendar='360_day')
Failed Part:
    4 >>> time_bnds(index, '2Q')
DOCTEST TRACEBACK
Expected:
    ((cftime.Datetime360Day(2000, 1, 1, 0, 0, 0, 0), cftime.Datetime360Day(2000, 3, 30, 23, 59, 59, 999999)),
    (cftime.Datetime360Day(2000, 7, 1, 0, 0, 0, 0), cftime.Datetime360Day(2000, 9, 30, 23, 59, 59, 999999)),
    (cftime.Datetime360Day(2001, 1, 1, 0, 0, 0, 0), cftime.Datetime360Day(2001, 3, 30, 23, 59, 59, 999999)))
Got:
    ((cftime.Datetime360Day(2000, 1, 1, 0, 0, 0, 0, has_year_zero=False), cftime.Datetime360Day(2000, 3, 30, 23, 59, 59, 999999, has_year_zero=False)), (cftime.Datetime360Day(2000, 7, 1, 0, 0, 0, 0, has_year_zero=False), cftime.Datetime360Day(2000, 9, 30, 23, 59, 59, 999999, has_year_zero=False)), (cftime.Datetime360Day(2001, 1, 1, 0, 0, 0, 0, has_year_zero=False), cftime.Datetime360Day(2001, 3, 30, 23, 59, 59, 999999, has_year_zero=False)))
Repr Difference:
    got  = '((cftime.Datetime360Day(2000, 1, 1, 0, 0, 0, 0, has_year_zero=False), cftime.Datetime360Day(2000, 3, 30, 23, 59, 59, 999999, has_year_zero=False)), (cftime.Datetime360Day(2000, 7, 1, 0, 0, 0, 0, has_year_zero=False), cftime.Datetime360Day(2000, 9, 30, 23, 59, 59, 999999, has_year_zero=False)), (cftime.Datetime360Day(2001, 1, 1, 0, 0, 0, 0, has_year_zero=False), cftime.Datetime360Day(2001, 3, 30, 23, 59, 59, 999999, has_year_zero=False)))'
    want = '((cftime.Datetime360Day(2000, 1, 1, 0, 0, 0, 0), cftime.Datetime360Day(2000, 3, 30, 23, 59, 59, 999999)),\n(cftime.Datetime360Day(2000, 7, 1, 0, 0, 0, 0), cftime.Datetime360Day(2000, 9, 30, 23, 59, 59, 999999)),\n(cftime.Datetime360Day(2001, 1, 1, 0, 0, 0, 0), cftime.Datetime360Day(2001, 3, 30, 23, 59, 59, 999999)))'
DOCTEST REPRODUCTION
CommandLine:
    pytest /Users/ray/Documents/PYTHON_dev/xclim/xclim/core/calendar.py::time_bnds:0
/Users/ray/Documents/PYTHON_dev/xclim/xclim/core/calendar.py:806: GotWantException
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB post_mortem (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> /Users/ray/miniconda3/envs/xclim/lib/python3.9/site-packages/xdoctest/checker.py(109)check_got_vs_want()
-> raise ex

@aulemahal
Copy link
Collaborator

Hi @raybellwaves ! Indeed, I am not sure the pandas pin is still necessary.
The error you spotted is due to an update of cftime, and I am surprised it didn't show up elsewhere before... I'll try to unpin and fix that in a PR soon.

@aulemahal aulemahal self-assigned this Aug 17, 2021
@aulemahal
Copy link
Collaborator

For the info : The pandas failure was fixed in xarray 0.19, which came out a month ago. (pydata/xarray#5359)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants