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

Py3k unicode cf #1830

Merged
merged 3 commits into from
Nov 17, 2015
Merged

Py3k unicode cf #1830

merged 3 commits into from
Nov 17, 2015

Conversation

pp-mo
Copy link
Member

@pp-mo pp-mo commented Nov 6, 2015

A step towards an alternative version of #1782 which conserves existing Python 2 behaviour : see comment there

An adjusted version of @QuLogic "a02e863 py3k: Handle strings from netCDF consistently."
Decode to unicode only in Python 3.

TO TEST :
python3 -m unittest iris.tests.test_cf fails before this, succeeds after

NOTE :
As the second commit effectively reverts some changes from the first one, it probably makes good sense to squish before merging.

@QuLogic
Copy link
Member

QuLogic commented Nov 6, 2015

Also pretty reasonable. Since it's only a partial change though, I'm not sure it's necessary to squash this one.

@pp-mo
Copy link
Member Author

pp-mo commented Nov 9, 2015

I'm not sure it's necessary to squash this one.

No, I probably got carried away in the excitement of cut-and-paste.

Is this good as-is, then ?

@QuLogic QuLogic added this to the v1.9 milestone Nov 9, 2015
if np.issubdtype(variables[name].dtype, np.str):
result[name] = CFLabelVariable(name, variables[name])
if _is_str_dtype(variables[name]):
var = variables[name]
Copy link
Member

Choose a reason for hiding this comment

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

I think maybe you meant to move this assignment outside the if to reduce the duplicate indexing?

@pp-mo
Copy link
Member Author

pp-mo commented Nov 12, 2015

I think maybe you meant to move this assignment outside the if to reduce the duplicate indexing?

No I didn't, but it looks like a good idea !

rhattersley added a commit that referenced this pull request Nov 17, 2015
@rhattersley rhattersley merged commit 7fed0ca into SciTools:master Nov 17, 2015
@pp-mo pp-mo deleted the py3k-unicode-cf branch March 14, 2016 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants