From 57b6e722f90c78ba936d9bef8851f91dd6b7c56b Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Dec 2023 16:50:59 +0100 Subject: [PATCH 1/9] add Makie extension --- Project.toml | 13 ++++++++++++- test/test_geo_interface.jl | 32 ++++++++++++++++++++++---------- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/Project.toml b/Project.toml index 5df8fa4..fe6fa57 100644 --- a/Project.toml +++ b/Project.toml @@ -8,20 +8,31 @@ CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" Extents = "411431e0-e8b7-467b-b5e0-f676ba4f2910" GEOS_jll = "d604d12d-fa86-5845-992e-78dc15976526" GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" +GeoInterfaceMakie = "0edc0954-3250-4c18-859d-ec71c1660c08" GeoInterfaceRecipes = "0329782f-3d07-4b52-b9f6-d3137cf03c7a" +Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" + +[weakdeps] +Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" + +[extensions] +LibGEOSMakie = "Makie" [compat] CEnum = "0.2, 0.3, 0.4, 0.5" Extents = "0.1.1" GEOS_jll = "3.12" GeoInterface = "1" +GeoInterfaceMakie = "0.1" GeoInterfaceRecipes = "1" +Makie = "0.20" julia = "1.6" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua", "Plots", "Test"] +test = ["Aqua", "Makie", "Plots", "Test"] diff --git a/test/test_geo_interface.jl b/test/test_geo_interface.jl index 9f00a9d..a97d512 100644 --- a/test/test_geo_interface.jl +++ b/test/test_geo_interface.jl @@ -1,4 +1,5 @@ -using Test, Plots, GeoInterface, LibGEOS, Extents +using Test, Makie, Plots, +using Test, GeoInterface, LibGEOS, Extents const GI = GeoInterface const LG = LibGEOS @@ -12,7 +13,8 @@ const LG = LibGEOS @test GeoInterface.getcoord(pt, 1) ≈ 1.0 @test GeoInterface.testgeometry(pt) @test GeoInterface.extent(pt) == Extent(X=(1.0, 1.0), Y=(2.0, 2.0)) - plot(pt) + Plots.plot(pt) + Makie.plot(pt) pt = LibGEOS.Point(1.0, 2.0, 3.0) @test GeoInterface.x(pt) == 1.0 @@ -25,7 +27,9 @@ const LG = LibGEOS # This doesn't return the Z extent @test_broken GeoInterface.extent(pt) == Extent(X = (1.0, 1.0), Y = (2.0, 2.0), Z = (3.0, 3.0)) - plot(pt) + Plots.plot(pt) + Makie.plot(pt) + Makie.plot(pt) pt = LibGEOS.Point(1, 2) @test GeoInterface.coordinates(pt) ≈ [1, 2] atol = 1e-5 @@ -52,7 +56,8 @@ const LG = LibGEOS @test p isa LibGEOS.Point @test GeoInterface.coordinates(p) == [10, 0] @test GeoInterface.testgeometry(mpt) - plot(mpt) + Plots.plot(mpt) + Makie.plot(mpt) @inferred GeoInterface.ncoord(mpt) @inferred GeoInterface.ngeom(mpt) @@ -68,7 +73,8 @@ const LG = LibGEOS @test p isa LibGEOS.Point @test GeoInterface.coordinates(p) == [9, 2] @test GeoInterface.testgeometry(ls) - plot(ls) + Plots.plot(ls) + Makie.plot(ls) @inferred GeoInterface.ncoord(ls) @inferred GeoInterface.ngeom(ls) @@ -85,7 +91,8 @@ const LG = LibGEOS @test GeoInterface.geomtrait(mls) == MultiLineStringTrait() @test GeoInterface.ngeom(mls) == 2 @test GeoInterface.testgeometry(mls) - plot(mls) + Plots.plot(mls) + Makie.plot(mls) @inferred GeoInterface.ncoord(mls) @inferred GeoInterface.ngeom(mls) @@ -102,7 +109,8 @@ const LG = LibGEOS @test GeoInterface.coordinates(p) == [9, 2] @test GeoInterface.testgeometry(lr) # Cannot convert LinearRingTrait to series data for plotting - # plot(lr) + # Plots.plot(lr) + # Makie.plot(lr) @inferred GeoInterface.ncoord(lr) @inferred GeoInterface.ngeom(lr) @@ -122,7 +130,8 @@ const LG = LibGEOS @test ls isa LibGEOS.LinearRing @test GeoInterface.coordinates(ls) == coords[2] @test GeoInterface.testgeometry(polygon) - plot(polygon) + Plots.plot(polygon) + Makie.plot(polygon) @inferred GeoInterface.ncoord(polygon) @inferred GeoInterface.ngeom(polygon) @@ -146,7 +155,8 @@ const LG = LibGEOS @test GeoInterface.geomtrait(multipolygon) == MultiPolygonTrait() @test GeoInterface.testgeometry(multipolygon) @test GeoInterface.extent(multipolygon) == Extent(X=(0.0, 10.0), Y=(0.0, 10.0)) - plot(multipolygon) + Plots.plot(multipolygon) + Makie.plot(multipolygon) @inferred GeoInterface.ncoord(multipolygon) @inferred GeoInterface.ngeom(multipolygon) @@ -229,7 +239,9 @@ const LG = LibGEOS end @test GeoInterface.geomtrait(geomcollection) == GeometryCollectionTrait() @test GeoInterface.testgeometry(geomcollection) - plot(geomcollection) + Plots.plot(geomcollection) + # Can't plot geometry collection yet with Makie + @test_broken Makie.plot(geomcollection) @inferred GeoInterface.ncoord(geomcollection) @inferred GeoInterface.ngeom(geomcollection) From d472ac2f8f57fabea36eaaae023411ac4b0c92d7 Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Dec 2023 16:52:21 +0100 Subject: [PATCH 2/9] tweak --- test/test_geo_interface.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/test_geo_interface.jl b/test/test_geo_interface.jl index a97d512..98403a1 100644 --- a/test/test_geo_interface.jl +++ b/test/test_geo_interface.jl @@ -1,5 +1,4 @@ -using Test, Makie, Plots, -using Test, GeoInterface, LibGEOS, Extents +using Test, Makie, Plots, GeoInterface, LibGEOS, Extents const GI = GeoInterface const LG = LibGEOS From cb196f09a133ffe91b35cfbd00216129d666e455 Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Dec 2023 17:02:09 +0100 Subject: [PATCH 3/9] fix deps versions --- Project.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Project.toml b/Project.toml index fe6fa57..c6183d3 100644 --- a/Project.toml +++ b/Project.toml @@ -19,6 +19,7 @@ Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" LibGEOSMakie = "Makie" [compat] +Aqua = "0.8" CEnum = "0.2, 0.3, 0.4, 0.5" Extents = "0.1.1" GEOS_jll = "3.12" @@ -26,6 +27,7 @@ GeoInterface = "1" GeoInterfaceMakie = "0.1" GeoInterfaceRecipes = "1" Makie = "0.20" +Plots = "1" julia = "1.6" [extras] From cf71dc052c1d676d4077dd58521005997c9383b6 Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Dec 2023 17:02:17 +0100 Subject: [PATCH 4/9] actually add the extension --- ext/LibGEOSMakie.jl | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ext/LibGEOSMakie.jl diff --git a/ext/LibGEOSMakie.jl b/ext/LibGEOSMakie.jl new file mode 100644 index 0000000..6d0dfc5 --- /dev/null +++ b/ext/LibGEOSMakie.jl @@ -0,0 +1,7 @@ +module LibGEOSMakie +using GeoInterfaceMakie: GeoInterfaceMakie +using LibGEOS: LibGEOS + +GeoInterfaceMakie.@enable LibGEOS.AbstractGeometry + +end From 6b33f25602877f753cc0e7c681c488defdbe367e Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Dec 2023 18:11:54 +0100 Subject: [PATCH 5/9] better extension name --- Project.toml | 2 +- ext/{LibGEOSMakie.jl => LibGEOSMakieExt.jl} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename ext/{LibGEOSMakie.jl => LibGEOSMakieExt.jl} (84%) diff --git a/Project.toml b/Project.toml index c6183d3..e8cb128 100644 --- a/Project.toml +++ b/Project.toml @@ -16,7 +16,7 @@ Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" [extensions] -LibGEOSMakie = "Makie" +LibGEOSMakieExt = "Makie" [compat] Aqua = "0.8" diff --git a/ext/LibGEOSMakie.jl b/ext/LibGEOSMakieExt.jl similarity index 84% rename from ext/LibGEOSMakie.jl rename to ext/LibGEOSMakieExt.jl index 6d0dfc5..8d5c847 100644 --- a/ext/LibGEOSMakie.jl +++ b/ext/LibGEOSMakieExt.jl @@ -1,4 +1,4 @@ -module LibGEOSMakie +module LibGEOSMakieExt using GeoInterfaceMakie: GeoInterfaceMakie using LibGEOS: LibGEOS From 400b3eab3957ac486e849b6f0135a2c4f825216f Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Dec 2023 18:22:37 +0100 Subject: [PATCH 6/9] test fixes --- Project.toml | 1 + test/runtests.jl | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index e8cb128..61e5581 100644 --- a/Project.toml +++ b/Project.toml @@ -28,6 +28,7 @@ GeoInterfaceMakie = "0.1" GeoInterfaceRecipes = "1" Makie = "0.20" Plots = "1" +Test = "<0.0.1,1" julia = "1.6" [extras] diff --git a/test/runtests.jl b/test/runtests.jl index f0b222c..000fa1c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -14,6 +14,12 @@ if version != LibGEOS.GEOS_CAPI_VERSION end @testset "LibGEOS" begin + @testset "Aqua.jl" begin + Aqua.test_all( + LibGEOS; + stale_deps=(ignore=[:GeoInterfaceMakie],), + ) + end include("test_geos_types.jl") include("test_geos_functions.jl") include("test_geos_operations.jl") @@ -22,5 +28,4 @@ end include("test_invalid_geometry.jl") include("test_strtree.jl") include("test_misc.jl") - Aqua.test_all(LibGEOS) end From f93d7524d10f7c0f0219c30494ee591a111b01ae Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Dec 2023 18:43:54 +0100 Subject: [PATCH 7/9] fix Aqua again --- test/runtests.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 000fa1c..f92982c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,4 @@ -using GeoInterface, Extents +using GeoInterface, GeoInterfaceRecipes, Extents using Test, LibGEOS import Aqua @@ -17,6 +17,7 @@ end @testset "Aqua.jl" begin Aqua.test_all( LibGEOS; + ambiguities=(exclude=[GeoInterfaceRecipes.RecipesBase.apply_recipe],), stale_deps=(ignore=[:GeoInterfaceMakie],), ) end From a3175ed22b9b02facc0276bab159355d79eb407f Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Dec 2023 23:33:09 +0100 Subject: [PATCH 8/9] stop supporting < 1.9 --- .github/workflows/CI.yml | 2 +- Project.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 76e653d..93bab72 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: version: - - '1.6' + - '1.9' - '1' - 'nightly' os: diff --git a/Project.toml b/Project.toml index 61e5581..c0a0f7c 100644 --- a/Project.toml +++ b/Project.toml @@ -29,7 +29,7 @@ GeoInterfaceRecipes = "1" Makie = "0.20" Plots = "1" Test = "<0.0.1,1" -julia = "1.6" +julia = "1.9" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" From 1f2d9ef03235f63314833fd0b1c963a9dadf4149 Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Sun, 7 Jan 2024 02:39:26 +0100 Subject: [PATCH 9/9] remove dup makie dep --- Project.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Project.toml b/Project.toml index c0a0f7c..049677f 100644 --- a/Project.toml +++ b/Project.toml @@ -10,7 +10,6 @@ GEOS_jll = "d604d12d-fa86-5845-992e-78dc15976526" GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" GeoInterfaceMakie = "0edc0954-3250-4c18-859d-ec71c1660c08" GeoInterfaceRecipes = "0329782f-3d07-4b52-b9f6-d3137cf03c7a" -Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" [weakdeps] Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"