rafaqz / Extents.jl

A shared Extent object for Julia spatial data, with DE-9IM spatial predicates
MIT License
4 stars 3 forks source link

`Extents.intersect` is still exported in v 0.1.2 #18

Closed alex-s-gardner closed 10 months ago

alex-s-gardner commented 10 months ago

I'm not sure why by it looks like Extents inherits intersect from Base

alex-s-gardner commented 10 months ago

This caused an issue with MapTile where Extents.intersect() returned an empty Any() when Extents what upgraded from 0.1.1 to 0.1.2

rafaqz commented 10 months ago

Its a mistake that the depricated method was deleted in a minor release, I'll return it

rafaqz commented 10 months ago

Actually what youre seeing is just any base method works like that.

alex-s-gardner commented 10 months ago

That seems a bit strange. Is all of Base explicitly added to Extents? I don't see this behavior with other packages

rafaqz commented 10 months ago
julia> using Revise

julia> Revise.intersect
intersect (generic function with 23 methods)

julia> Revise.intersect == Base.intersect
true
rafaqz commented 10 months ago

Finally solved this mystery - what you are seeing is that you get autocompletion for intersect with Extents.jl because it has both intersection and intersects. All packages have the base method, but Extents will accidentally autocomplete it.

You get the same behaviour with GeoInterface as it also has both of those methods

(there was also an old typoed deprecation clouding the issue, thats removed now)

alex-s-gardner commented 10 months ago

Oh man.. that's a tough one to track down.

It seems strange that all base methods are added to packages and can be accessed as Pkg.method... It seems like it would have been safer to only have methods introduced by the Package accessed this way. But I'm sure there is a good reason that came with this compromise.