Skip to content

Suppress numpy warnings? #1580

@durack1

Description

@durack1

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions