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

Update cdms2 to deal with all common datatypes (uint8, uint16, char, str etc) #537

Open
durack1 opened this issue Aug 6, 2014 · 5 comments
Assignees

Comments

@durack1
Copy link
Member

durack1 commented Aug 6, 2014

It appears that UV-CDAT 2.0 beta doesn't play nicely with the unsigned integer data types, and it would appear this is a hangover from numeric data types a long time ago:

Taking a look in https://github.com/UV-CDAT/uvcdat/blob/master/Packages/cdms2/Lib/cdmsNode.py#L23-65 do not include these unsigned types:

# Data types

CdChar = CDML.CdChar
CdByte = CDML.CdByte
CdShort = CDML.CdShort
CdInt = CDML.CdInt
CdLong = CDML.CdLong
CdInt64 = CDML.CdInt64
CdFloat = CDML.CdFloat
CdDouble = CDML.CdDouble
CdString = CDML.CdString
CdFromObject = CDML.CdFromObject
CdAny = CDML.CdAny
CdDatatypes = [CdChar,CdByte,CdShort,CdInt,CdLong,CdInt64,CdFloat,CdDouble,CdString]

CdScalar = CDML.CdScalar
CdArray = CDML.CdArray

NumericToCdType = {numpy.sctype2char(numpy.float32):CdFloat,
                   numpy.sctype2char(numpy.float):CdDouble,
                   numpy.sctype2char(numpy.int16):CdShort,
                   numpy.sctype2char(numpy.int32):CdInt,
                   numpy.sctype2char(numpy.int):CdLong,
                   numpy.sctype2char(numpy.int64):CdInt64,
                   numpy.sctype2char(numpy.intc):CdLong,
                   numpy.sctype2char(numpy.int8):CdByte,
                   'c':CdChar,
                   'B':'B',
                   'H':'H',
                   'L':'L',
                   'q':CdInt64,
                   'Q':'Q',
                   'S':'S'
                   }

CdToNumericType = {CdChar:'c',
                   CdByte:numpy.int8,
                   CdShort:numpy.int16,
                   CdInt:numpy.int32,
                   CdLong:numpy.int,
                   CdInt64:numpy.int64,
                   CdFloat:numpy.float32,
                   CdDouble:numpy.float}

It would be great to include these, as netcdf 4 also includes these types as NC_ubyte (uint8; unsigned byte), NC_ushort (uint16; unsigned short), NC_uint (uint32; unsigned int), NC_uint64 (uint64; unsigned long long)

@durack1
Copy link
Member Author

durack1 commented Sep 22, 2014

You folks might want to assign this as a 2.1 milestone to get if off the to-do list

@durack1 durack1 changed the title Update UV-CDAT to deal with all common datatypes (uint8, uint16 etc) Update UV-CDAT to deal with all common datatypes (uint8, uint16, char, str etc) Oct 23, 2014
@durack1
Copy link
Member Author

durack1 commented Nov 24, 2014

@doutriaux1 @aashish24 can you mark this as a 2.2 milestone please?

@doutriaux1 doutriaux1 added this to the 2.2 milestone Nov 24, 2014
@durack1
Copy link
Member Author

durack1 commented Feb 20, 2015

@doutriaux1 another candidate for 2.3, likely related to #885 and #481

@doutriaux1 doutriaux1 modified the milestones: 2.3, 2.2 Feb 20, 2015
@durack1
Copy link
Member Author

durack1 commented May 6, 2015

@doutriaux1 can you assign the enhancement label please?

@durack1 durack1 changed the title Update UV-CDAT to deal with all common datatypes (uint8, uint16, char, str etc) Update cdms2 to deal with all common datatypes (uint8, uint16, char, str etc) Jul 16, 2015
@doutriaux1 doutriaux1 modified the milestones: 3.0, 2.4 Sep 16, 2015
@dnadeau4
Copy link
Contributor

Same as #481

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

No branches or pull requests

4 participants