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

Future warning - xarray #345

Closed
adybbroe opened this issue Jun 29, 2018 · 5 comments
Closed

Future warning - xarray #345

adybbroe opened this issue Jun 29, 2018 · 5 comments

Comments

@adybbroe
Copy link
Contributor

Describe the bug
I get a Future warning from xarray when creating a scene object

To Reproduce

# Your code here
from satpy import Scene
from satpy import find_files_and_readers
from datetime import datetime

DATA_DIR = "/home/a000680/laptop/Nordisk/EARS_NWC/data/case_20180314/ears"

myfiles = find_files_and_readers(base_dir=DATA_DIR,
                                 start_time=datetime(2018, 3, 14, 10, 5),
                                 end_time=datetime(2018, 3, 14, 10, 11),
                                 reader='nc_nwcsaf_pps')
scene = Scene(filenames=myfiles)
scene.load(['ct'])

Expected behavior
No future warning

Actual results

(0, ['/home/a000680/usr/src/satpy/satpy/etc/readers/nc_nwcsaf_pps.yaml'], ['nc_nwcsaf_pps'])

/usr/lib64/python2.7/_abcoll.py:391: FutureWarning: iteration over an xarray.Dataset will change in xarray v0.11 to only include data variables, not coordinates. Iterate over the Dataset.variables property instead to preserve existing behavior in a forwards compatible manner.
  return list(self)
/usr/lib64/python2.7/_abcoll.py:391: FutureWarning: calling len() on an xarray.Dataset will change in xarray v0.11 to only include data variables, not coordinates. Call len() on the Dataset.variables property instead, like ``len(ds.variables)``, to preserve existing behavior in a forwards compatible manner.
  return list(self)
/home/a000680/.local/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters

Also, notice the first line above! There seem to be a loose print somewhere!?

Environment Info:

  • OS: Linux
  • SatPy Version: 0.9.0b1.dev0
@adybbroe
Copy link
Contributor Author

Ok, the print is in __init__.py.
The warning I will see what I can do...

@djhoese
Copy link
Member

djhoese commented Aug 15, 2018

@adybbroe while debugging this I turned on all warnings and found this about geotiepoints:

/Users/davidh/repos/git/python-geotiepoints/geotiepoints/interpolator.py:242: DeprecationWarning: elementwise == comparison failed; this will raise an error in the future.
  if np.all(self.hrow_indices == self.row_indices):
import warnings
warnings.simplefilter('always')

@djhoese
Copy link
Member

djhoese commented Aug 15, 2018

And the warnings only show up in python 2.7.

@adybbroe
Copy link
Contributor Author

Thanks.
I have verified the above code snippet and the xarray future warning is now gone in the ,aster branch.
This is what I see now:

/home/a000680/.local/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters

I attribute this to h5py.

@adybbroe
Copy link
Contributor Author

The above h5py warning is gone when I upgrade from 2.7.1 to 2.8.0.

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