Skip to content

CDAT does not handle unicode string numpy datatypes #330

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

Closed
aashish24 opened this issue Nov 7, 2013 · 9 comments
Closed

CDAT does not handle unicode string numpy datatypes #330

aashish24 opened this issue Nov 7, 2013 · 9 comments

Comments

@aashish24
Copy link
Contributor

Which I think is odd :( we should have support for both of them.

@doutriaux1
Copy link
Contributor

What are you trying to do? Can you post an example?

@aashish24
Copy link
Contributor Author

Very simple passing a unicode string to the cdms2 open call and variable call and then passing a coordinate to retrieve the value something like this:

f = cdms2.open(unicode_filename_str)
v = f[unicode_varname_str]
....

@ghost ghost assigned doutriaux1 Nov 7, 2013
@doutriaux1
Copy link
Contributor

ok so you meant cdms2 not cdat. Easy enough to fix I'll push a branch today.

@aashish24
Copy link
Contributor Author

is cdms2 is not part of cdat -:) just wanted to make sure that I call them correctly. In general people separate these two things.

Thanks that would be great. Now a days most of the web work is using unicode string (for obvious reasons) and numpy data types are used because we get them from cdat.

@doutriaux1
Copy link
Contributor

it just helps to pinpoint the issue if we know what doesn't work ;)

@doutriaux1
Copy link
Contributor

The following works:

import cdms2
import sys
fnm= u"%s/sample_data/clt.nc"%sys.prefix
print fnm
f=cdms2.open(fnm)
var=u"clt"
print var
s=f[var]
print s.shape

Can you copy/paste an example that doesnt work

@aashish24
Copy link
Contributor Author

Sure, we have that example from the web work. I will see if I can copy paste here.

d = self._canvas.plot(data,self._plotTemplate,self._plotType,bg=1)

In this line, self._plotType had to be a non-unicode str.

@doutriaux1
Copy link
Contributor

ok so you can confirm cdms2 works, but it is in vcs? I should be able to push a fix today.
By the way, you probably shouldn't use _plotType, var starting with an underscore are usually meant to be private.

@doutriaux1
Copy link
Contributor

seems to be duplicte #537

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

2 participants