-
Notifications
You must be signed in to change notification settings - Fork 19
Remove ambiguity and implement getgeom, ngeom for Wrappers.Point
#173
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
base: main
Are you sure you want to change the base?
Conversation
|
Not sure We could also just return the point from getgeom and ngeom could be 1 Or error |
|
Error might be best? |
|
Error is pretty safe as we can always change it later, but returning |
|
Maybe Then |
|
Eh that sounds too recursive for my liking...let's just error |
|
Where is this one at? |
| ngeom(::PointTrait, geom::Point) = 0 | ||
| getgeom(::PointTrait, geom::Point) = nothing | ||
| getgeom(::PointTrait, geom::Point, i) = nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ngeom(::PointTrait, geom::Point) = 0 | |
| getgeom(::PointTrait, geom::Point) = nothing | |
| getgeom(::PointTrait, geom::Point, i) = nothing | |
| ngeom(::PointTrait, geom::Point) = error("`GI.ngeom` on a Point is not allowed! To get the number of dimensions use `GI.ncoord` instead.") | |
| getgeom(::PointTrait, geom::Point) = error("`GI.getgeom` on a Point is not allowed! To get the number of dimensions use `GI.getcoord` instead, or `GI.x, GI.y, GI.z, GI.t`") | |
| getgeom(::PointTrait, geom::Point, i) = error("`GI.getgeom` on a Point is not allowed! To get the number of dimensions use `GI.getcoord` instead, or `GI.x, GI.y, GI.z, GI.t`") |
This was mentioned on Slack, the output is probably a bit better than a method ambiguity error now.