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

Feature/uniform coords transform to uniform #396

Merged
merged 14 commits into from
Apr 21, 2020

Conversation

mpu-creare
Copy link
Contributor

This simplified any transformed coordinates to independent / array / uniform coordinates.

This only one missing is stacked array to stacked uniform (a pretty rare case).

@jmilloy please have a quick look in case I missed something. It's a little convoluted so I want to document that code a little better, but beyond that I think it's pretty good.

…ill do Uniform-> Uniform/Array, but not Dependent/Stacked -> Uniform/Array
* Stripped out a lot of repeated code
* A dependent coordinate will now get transformed back into uniform coordinates if possible.
…stransform). Also adding "alt" to the simplification.
@mpu-creare mpu-creare added the enhancement New feature or request label Apr 18, 2020
@mpu-creare mpu-creare requested a review from jmilloy April 18, 2020 11:08
@coveralls
Copy link

coveralls commented Apr 18, 2020

Coverage Status

Coverage increased (+0.02%) to 91.343% when pulling d057adf on feature/uniform-coords-transform-to-uniform into 4e13d1c on develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 91.615% when pulling 7aca61a on feature/uniform-coords-transform-to-uniform into 0fcf40f on develop.

@jmilloy
Copy link
Collaborator

jmilloy commented Apr 19, 2020

I will review this afternoon.

jmilloy added 3 commits April 19, 2020 18:55
…tart and stop are the same and the step is 0.

* raise an exception if the step is 0
* add a test for this case
* fix the typo in the datasource tests
jmilloy added 5 commits April 20, 2020 10:40
…ses allclose. Prefer allclose over explicit TOL check in dependent coordinates simplify.
Moves the error cases to the top of the file, and moves the inline function out. I find this a lot easier to read.
@jmilloy
Copy link
Collaborator

jmilloy commented Apr 20, 2020

Can you help me find two crs that that transform spatially uniform -> dependent but that I can add vunits to?

For example, +proj=merc +vunits=ft -> +proj=utm +vunits=m works, but the transformation does not require dependent lat, lon coordinates. Alternatively, EPSG:4326 -> EPSG:32629 requires dependent lat, lon coordinates, but EPSG:4326 uses +proj=latlon and you can't seem to add vunits to that.

jmilloy added 3 commits April 20, 2020 20:01
Use Coordinates1d simplify method instead of make_uniform helper.
Use np.linspace directly instead of clinspace(...).coordinates.
Use StackedCoordinates._transform instead of Coordinates(StackedCoordinates).transform
Includes improvement to StackedCoordinates._transform (use simplify) and associated test.
@jmilloy
Copy link
Collaborator

jmilloy commented Apr 21, 2020

Pending tests this is ready to merge.

@mpu-creare mpu-creare merged commit f3dbe9e into develop Apr 21, 2020
@mpu-creare mpu-creare deleted the feature/uniform-coords-transform-to-uniform branch April 21, 2020 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants