csdms / help-desk

The CSDMS Help Desk. Ask questions. Get answers (about CSDMS products and services).
MIT License
6 stars 1 forks source link

Recent package updates breaking code? #249

Closed paselkin closed 3 weeks ago

paselkin commented 1 month ago

Hi folks, I was wondering if there were recent (last month or so) updates to the jupyterhub environment that might affect how the xarray package works. We have a notebook that we'd been using previously that wasn't giving any errors, but now gives us an error about comparing str and int values whenever we try to print or display an xarray DataArray. Previously we'd been getting a summary of the DataArray.

mcflugen commented 1 month ago

@paselkin Does the error you're seeing look anything like the error reported in landlab/landlab#2018?

If so, it's an incompatibility with Landlab v2.9.0 and numpy v2. If you think this could be the problem, will you please check what version of numpy and landlab is installed in your environment?

>>> import numpy as np
>>> np.__version__
'2.1.2'
>>> import landlab
>>> landlab.__version__
'2.9.0'

I have a fix for this issue ready to go. We just need to install it on our jupyterhub.

paselkin commented 1 month ago

Thanks! Yes, it's the same error. We're using jupyterhub on jupyter.openearthscape.org; numpy is 1.26.2. Can I create my own virtual environment within jupyterhub so I can control package versions? Or do I just do something like "!pip install 'numpy>2.0'" in a jupyter instance? I'm not familiar enough with jupyterhub to know that...

mdpiper commented 1 month ago

@paselkin Landlab has been updated in the CSDMS kernel of the jupyter Hub. Let us know if this fixes the problem you're seeing.

paselkin commented 3 weeks ago

Looks like it works. Thanks!

mdpiper commented 3 weeks ago

Thanks, @paselkin!