Skip to content

made TransformDirection enum string based; added _missing_ method to raise error when value missing#300

Merged
snowman2 merged 3 commits intopyproj4:masterfrom
snowman2:enum_dir_str
May 15, 2019
Merged

made TransformDirection enum string based; added _missing_ method to raise error when value missing#300
snowman2 merged 3 commits intopyproj4:masterfrom
snowman2:enum_dir_str

Conversation

@snowman2
Copy link
Copy Markdown
Member

Addresses #298 and #288 (comment)

Uses idea from #288 (comment) to better handle invalid input.

@jorisvandenbossche

@snowman2 snowman2 requested a review from jswhit May 13, 2019 01:36
@snowman2
Copy link
Copy Markdown
Member Author

Looks like _missing_ only works post Python 3.5. Shame, it is really nice.

Copy link
Copy Markdown
Collaborator

@jswhit jswhit left a comment

Choose a reason for hiding this comment

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

@snowman2 - I won't be able to review any pull requests for the next couple of weeks. Please go ahead and merge when you see fit. I don't want to be the bottleneck here.

@snowman2
Copy link
Copy Markdown
Member Author

@jswhit, that sounds good. I will go ahead and merge. Would you be okay with me making a release as well (minus uploading to pypi)?

@snowman2
Copy link
Copy Markdown
Member Author

I was thinking about making a release along with PROJ 6.1.0 release on May 15. Is that okay? Or would you prefer to be able to review everything before then (which is fine - no rush on my end)?

@snowman2
Copy link
Copy Markdown
Member Author

I was thinking about making a release along with PROJ 6.1.0 release on May 15. Is that okay?

I think that does not make much sense. I think waiting until you are ready would be the better decision in this case. Better to have a good review before the release since there isn't a rush. I was just getting ahead of myself there.

@snowman2 snowman2 merged commit bde0412 into pyproj4:master May 15, 2019

#: Forward direction
FORWARD = 1
FORWARD = "FORWARD"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Small remark: we could also opt for lower case? (that might be a little bit nicer in user code (transform(..., direction='inverse') vs transform(..., direction='INVERSE'))

Just a remark, no strong preference either way!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I thought about doing that, and decided that the upper case version is consistent with the upper case WKT enum strings.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yep, on the other hand, WKT is an existing abbreviation that is written in upper case, while forward/inverse are normal words.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's true. What would be nice is a case insensitive solution.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That would preserve past behavior as that's how I had it before.

@snowman2 snowman2 deleted the enum_dir_str branch September 2, 2019 14:45
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