spencerahill / aospy

Python package for automated analysis and management of gridded climate data
Apache License 2.0
83 stars 12 forks source link

Catch xarray warning about out of range dates #239

Closed spencerahill closed 6 years ago

spencerahill commented 6 years ago

Closes #221.

Uses warnings.catch_warnings from the standard library.

Still needs tests

spencerahill commented 6 years ago

@spencerkclark this is ready as far as I can tell. A review would be great. @micahkim23 feel free to add comments also. Thanks!

spencerahill commented 6 years ago

Thanks @spencerkclark , I addressed both of those.

While I was at it, I noticed warnings from test_tutorial, which ultimately led me to discover that runipy has been deprecated, and instead you can use Jupyter directly to execute notebooks from within Python. So I took the liberty of updating those as well.

I'm still getting a weird RuntimeWarning about a "sticky bit" from the tutorial, but frankly I can live with that one. For reference, here's an example of that message:

========================================================================= warnings summary =========================================================================
aospy/test/test_tutorial.py::test_tutorial_notebook
  /Users/shill/Dropbox/miniconda3/envs/py36/lib/python3.6/site-packages/jupyter_client/connect.py:157: RuntimeWarning: Failed to set sticky bit on '/var/folders/_s/qf0zz57x5xzgbgn4dxbg7k_c0000gn/T': [Errno 1] Operation not permitted: '/var/folders/_s/qf0zz57x5xzgbgn4dxbg7k_c0000gn/T'
    RuntimeWarning,

Will merge tomorrow (Monday) unless you have anything further. Thanks!

spencerahill commented 6 years ago

Woops, tutorial test is getting skipped: https://ci.appveyor.com/project/spencerahill/aospy/build/1.0.423/job/egrh2h3cgm2kanh8#L330

I probably messed up the importorskip calls. Will fix tomorrow (Monday).

spencerkclark commented 6 years ago

While I was at it, I noticed warnings from test_tutorial, which ultimately led me to discover that runipy has been deprecated, and instead you can use Jupyter directly to execute notebooks from within Python. So I took the liberty of updating those as well.

Very nice!

Woops, tutorial test is getting skipped

Could the skipping just be a sign that the importorskip is working properly? In other words do we just need to add jupyter to our build environments?

spencerahill commented 6 years ago

The AppVeyor failures are #238 ; everything else green. So I'm going ahead and merging.

Thanks @spencerkclark for the review!