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 collapse #1832

Merged
merged 3 commits into from
Nov 11, 2015
Merged

Py3k unicode collapse #1832

merged 3 commits into from
Nov 11, 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
"f9cc0f9 py3k: Use Unicode in coord collapse."
Make it unicode only in Python 3.

TO TEST :
python3 -m unittest iris.tests.unit.coords.test_Coord.Test_collapsed 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.

bounds = np.array(bounds, dtype=dtype).reshape((1,) + shape)
points = serialize(self.points)
dtype = np.dtype('S{}'.format(len(points)))
dtype = np.dtype(string_type_fmt.format(len(points)))
Copy link
Member

Choose a reason for hiding this comment

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

string_type_fmt is only set if self.bounds is not None?

@pp-mo
Copy link
Member Author

pp-mo commented Nov 8, 2015

@QuLogic string_type_fmt is only set if self.bounds is not None?

Good spot !
I hope the latest fixes it, and I added a test. It seems we had no test coverage for collapsing a string coord without bounds. No great surprise really, as they aren't common in real files.

@QuLogic QuLogic added this to the v1.9 milestone Nov 8, 2015
QuLogic added a commit that referenced this pull request Nov 11, 2015
@QuLogic QuLogic merged commit 136e319 into SciTools:master Nov 11, 2015
@pp-mo pp-mo deleted the py3k-unicode-collapse 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.

2 participants