Skip to content

Conversation

xylar
Copy link
Collaborator

@xylar xylar commented Nov 29, 2017

Iterating over data sets will no longer iterate over coordinates in addition to data variables. We want both when we write out NetCDF files, so we switch to doing so explicitly.

@xylar xylar added the clean up label Nov 29, 2017
@xylar xylar self-assigned this Nov 29, 2017
@xylar
Copy link
Collaborator Author

xylar commented Nov 29, 2017

A potential future problem I noticed in the process of testing #280 under python 3 (because I'm spending a lot of time in the log files).

@milenaveneziani, a quick check to make sure you don't see any future warnings in the log files when NetCDF files get written out (e.g. during remapping) would be all that this would need. And obviously it would be good to make sure it doesn't break anything, but I don't expect any trouble since it passed my usual QU240 test.

@xylar
Copy link
Collaborator Author

xylar commented Dec 4, 2017

@vanroekel, is this a PR you would have time to test for me? @milenaveneziani has quite a bit on her plate right now on the A-Prime side. If not, no problem. Just say so.

@xylar xylar requested a review from vanroekel December 4, 2017 11:08
@vanroekel
Copy link
Collaborator

@xylar sure I can test this. Do you have steps to reproduce the warning with develop? I tried on titan just now and don't see any warnings about x-array. There is a numpy warning about masked arrays. Do I need to be using the new e3sm conda environment? I'm guessing that the default environment (acme) doesn't have python 3.

@xylar
Copy link
Collaborator Author

xylar commented Dec 4, 2017

@vanroekel, you don't need to check with python 3 but presumably you do need to check with the latest e3sm-unified environment, which is currently only available on Edison (module load e3sm-unified/1.1.2-py2-nox) or acme1. Or you can install the required libraries listed in the MPAS-Analysis documentation into a new anaconda environment of your own, in which case you should get new enough versions of numpy, xarray, etc. that you should see the issue.

@vanroekel
Copy link
Collaborator

@xylar I am unable to reproduce the future warning. It looks like this is because I can't get xarray v0.10. On all machines, including the environment you reference (e3sm-unified) xarray is version 0.9.6. If I do conda update -c conda-forge xarray I still get xarray 0.9.6. Any suggestions on how to update to v0.10?

@xylar
Copy link
Collaborator Author

xylar commented Dec 4, 2017 via email

@vanroekel
Copy link
Collaborator

I did grep -i future *.log and grep -i warn *.log in the logs directory, future turned up no hits and warn gave me

climatologyMapSeaIceThickNH.log:/global/project/projectdirs/acme/software/anaconda_envs/edison_e3sm_unified_1.1.2_py2_nox/lib/python2.7/site-packages/numpy/ma/core.py:2344: RuntimeWarning: invalid value encountered in less_equal
climatologyMapSeaIceThickSH.log:/global/project/projectdirs/acme/software/anaconda_envs/edison_e3sm_unified_1.1.2_py2_nox/lib/python2.7/site-packages/numpy/ma/core.py:2344: RuntimeWarning: invalid value encountered in less_equal
timeSeriesSST.log:/global/project/projectdirs/acme/software/anaconda_envs/edison_e3sm_unified_1.1.2_py2_nox/lib/python2.7/site-packages/matplotlib/axes/_axes.py:545: UserWarning: No labelled objects found. Use label='...' kwarg on individual plots.
timeSeriesSST.log:  warnings.warn("No labelled objects found. "
timeSeriesSeaIceAreaVol.log:/global/project/projectdirs/acme/software/anaconda_envs/edison_e3sm_unified_1.1.2_py2_nox/lib/python2.7/site-packages/matplotlib/axes/_axes.py:545: UserWarning: No labelled objects found. Use label='...' kwarg on individual plots.
timeSeriesSeaIceAreaVol.log:  warnings.warn("No labelled objects found. "

but these seem unrelated. When you have a chance tomorrow, could you post the text of the warning that you see?

@xylar
Copy link
Collaborator Author

xylar commented Dec 5, 2017

Sorry, @vanroekel. It does seem like I'm seeing this with xarray 0.10.0 on my personal laptop and not on Edison as I thought. I see the same warning more often in python 3 than in python 2 but I see it in both. I will set up a python 3 environment on Edison with xarray 0.10.0.

@xylar
Copy link
Collaborator Author

xylar commented Dec 5, 2017

@vanroekel, if you could do the following:

export PATH=/global/project/projectdirs/acme/software/anaconda_envs/edison_mpas_analysis_py3/bin:$PATH

you should be able to run with the python 3 environment I'm setting up right now. I would suggest running with this config file:
https://github.com/MPAS-Dev/MPAS-Analysis/blob/develop/configs/edison/config.20170807.beta1.G_oQU240.edison
so that everything goes pretty quickly. If you could verify that you see the future warning with develop but not with this branch, that would be great.

@xylar xylar force-pushed the fix_xarray_future_warning branch from 1a9921f to 7e8ce32 Compare December 5, 2017 08:47
Iterating over data sets will no longer iterate over coordinates
in addition to data variables.  We want both when we write out
NetCDF files, so we switch to doing so explicitly.
@xylar xylar force-pushed the fix_xarray_future_warning branch from 7e8ce32 to c327cea Compare December 5, 2017 08:48
@xylar
Copy link
Collaborator Author

xylar commented Dec 5, 2017

@vanroekel, I also had to rebase and make a small fix to this PR to make it work with python 3, so please update your local branch.

@xylar
Copy link
Collaborator Author

xylar commented Dec 5, 2017

Testing

I can confirm that I see the warnings with develop when I use a python 3 environment with xarray 0.10.0 but I do not see the warnings with the same environment and this branch.

@vanroekel
Copy link
Collaborator

@xylar I just tried the python environment from your comment and get permission denied errors

PermissionError: [Errno 13] Permission denied: '/global/project/projectdirs/acme/software/anaconda_envs/edison_mpas_analysis_py3/lib/python3.6/site-packages/fastcache-1.0.2-py3.6.egg-info'

@xylar
Copy link
Collaborator Author

xylar commented Dec 5, 2017

@vanroekel, sorry about that. Could you try again?

Copy link
Collaborator

@vanroekel vanroekel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xylar I can now confirm the FutureWarning with develop. Using your branch the Warning is gone. Thanks for this fix @xylar

@xylar
Copy link
Collaborator Author

xylar commented Dec 5, 2017

Great, sorry this was so much more trouble to test than it should have been. But it was helpful in the end since I fixed a python 3 problem in the process and set up some environments for testing that should be helpful in the future.

@xylar xylar merged commit a8ba818 into MPAS-Dev:develop Dec 5, 2017
@xylar xylar deleted the fix_xarray_future_warning branch December 5, 2017 15:58
@xylar xylar removed the request for review from milenaveneziani December 5, 2017 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants