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

Suppress numpy warnings? #48

Closed
chaosphere2112 opened this Issue Nov 22, 2016 · 8 comments

Comments

Projects
None yet
4 participants
@chaosphere2112
Contributor

chaosphere2112 commented Nov 22, 2016

I've just started seeing these warnings:

import cdms2 as cdm
import MV2 as MV
# Set nc classic as outputs
cdm.setNetcdfShuffleFlag(0)
cdm.setNetcdfDeflateFlag(0)
cdm.setNetcdfDeflateLevelFlag(0)

os.chdir('/work/durack1/Shared/131118_PaperPlots_SaltyVariability/151001_NOEMP02_IPSL-CM6')
domains = ['glo','atl','pac','ind']
for i in domains:
    var = 'zosal' + i
    infile = ''.join(['NOEMP02_1850_1899_1Y_',var,'.nc'])
    print '** Processing: ',infile
    f_h = cdm.open(infile)
    var1850to1899 = f_h(var) ; f_h.close()
    infile = replace(infile,'1850_1899','1900_1949')
    f_h = cdm.open(infile)
    var1900to1949 = f_h(var) ; f_h.close()
    vars()[i] = MV.concatenate([var1850to1899,var1900to1949])
    del(var1850to1899,var1900to1949,var,infile) ; gc.collect()
del(i,domains) ; gc.collect()

>>> glo_1850to1899.shape
(50, 31, 149, 1)
>>> glo_1900to1949.shape
(50, 31, 149, 1)
>>> glo = MV.concatenate([glo_1850to1899,glo_1900to1949])
/usr/local/uvcdat/2.4.0rc1/lib/python2.7/site-packages/cdms2/axis.py:2266: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if None in boundsArray:

It will likely disappear in planned numpy/cdms updates #885 (and has already been noted before #576), but wondering whether this should be cleaned up before 2.4.0?

Migrated from: CDAT/cdat#1580

@durack1

This comment has been minimized.

Member

durack1 commented Nov 23, 2016

@dnadeau4 I am curious if this is resolved with numpy 1.11?

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Nov 23, 2016

@dnadeau4 we should definitely fix this asap it might not be evaluating what we think it is.

@durack1

This comment has been minimized.

Member

durack1 commented Nov 23, 2016

@dnadeau4 @doutriaux1 I recall there were some behavior changes in numpy 1.9 to numpy 1.1x so it would be a good idea to investigate this

@dnadeau4

This comment has been minimized.

Contributor

dnadeau4 commented Jan 23, 2018

@durack1 do you still have those files around or a new one?

@durack1

This comment has been minimized.

Member

durack1 commented Jan 23, 2018

@dnadeau4 those files are still on the same path on ocean.. Do you have an account?

@dnadeau4

This comment has been minimized.

Contributor

dnadeau4 commented Jan 23, 2018

I think the message is gone. Please re-open this issue if you think otherwise.

import MV2
import numpy
b=numpy.zeros((50,31,149,1),dtype=numpy.float32)
a=numpy.zeros((50,31,149,1),dtype=numpy.float32)
MV2.concatenate([a,b]).shape
(100, 31, 149, 1)
@dnadeau4

This comment has been minimized.

Contributor

dnadeau4 commented Jan 23, 2018

@durack1 I can't find them.

ls /work/durack1//Shared/131118_PaperPlots_SaltyVariability/
@durack1

This comment has been minimized.

Member

durack1 commented Jan 23, 2018

@dnadeau4 this was a numpy 1.9.x issue, so happy for you to close.. I'll reopen if it crops up again.. You might also want to close the UV-CDAT issue CDAT/cdat#1580

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment