JuliaGeometry / CoordinateTransformations.jl

A fresh approach to coordinate transformations...
Other
179 stars 25 forks source link

Add an identity transformation #67

Closed yakir12 closed 3 years ago

yakir12 commented 3 years ago

It would be handy (albeit not necessary) to have a transformation that doesn't do anything, like the identity function. One that could be composed, inverted, etc with the other transformations. The use case would be where some part of a pipeline returns a transformation which sometimes can be null (do nothing), and since it's part of a pipeline it would need to work exactly like all the other transformations (be composable and invertible).

andyferris commented 3 years ago

Yes that’s a good idea, I’m a little surprised we don’t have that. identity should be composable but probably type piracy to make it invertable, so I suppose we should create and export our own.

PR’s welcome! :)

yakir12 commented 3 years ago

So I dev:ed CoordinateTransformations to start working on a PR, and wanted to look at an example of a transformation, and look what I found: https://github.com/JuliaGeometry/CoordinateTransformations.jl/blob/0875420ea690d94d3bce12379f4dbed9edd42125/src/core.jl#L21 which solved my specific problems... So I'll close this now. Thanks!

andyferris commented 3 years ago

Lol - I thought we would have had one :)