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

Dependency pint moved location of units.py with v0.20 #1216

Closed
kyleredilla opened this issue Oct 27, 2022 · 2 comments
Closed

Dependency pint moved location of units.py with v0.20 #1216

kyleredilla opened this issue Oct 27, 2022 · 2 comments

Comments

@kyleredilla
Copy link

Generic Issue

  • xclim version: 0.38.0
  • Python version: 3.9.13
  • Operating System: CentOS 7.9.2009

Description

Tried to import xclim.indices and got an import error for dependency pint.unit.

It looks like pint.unit has moved to pint/facets/plain/unit.py with version 0.20. I'm not actually sure if this is an issue with xclim or conda but figured I'd share.

pint 0.19.2 <- 0.20 comparison

Also thank you, this package is amazing, hope I can contribute one day.

What I Did

Built new conda environment with:

conda create -n new_env python=3.9.13 xarray netcdf4 xclim <other packages>

Then imported xclim.indices in a Jupyter notebook:

import xclim.indices as xci

What I Received

I got an import error, didn't think to save the whole thing but it was this at the root:

ModuleNotFoundError: No module named 'pint.unit'


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
@kyleredilla kyleredilla changed the title pint moved location of units.py with v0.20 Dependency pint moved location of units.py with v0.20 Oct 27, 2022
@aulemahal
Copy link
Collaborator

Hi @kyleredilla !

Thanks for the issue. Indeed, there was a refactor in pint 0.20 and it broke xclim... Good news is that it was fixed in #1212!

We had a plan to publish a new version of xclim (0.39) tomorrow, but I fear the Pull Request queue is a bit loaded and it might have to wait a few more days... Downgrading pint should be a simple temporary fix, if that is possible for you!

@kyleredilla
Copy link
Author

Ahh I figured this may have been already fixed. Yep already working with the downgrade. Thank you!

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

No branches or pull requests

2 participants