From 6ca0351b3628ef6e29533893469c29713718eef5 Mon Sep 17 00:00:00 2001 From: Jaakko Ruohio Date: Sun, 12 Jan 2025 20:43:50 +0200 Subject: [PATCH] Run JuliaFormatter --- src/geo_interface.jl | 2 +- src/geos_types.jl | 10 +++++----- test/runtests.jl | 4 ++-- test/test_geo_interface.jl | 16 ++++++++-------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/geo_interface.jl b/src/geo_interface.jl index d82dae7..32214e1 100644 --- a/src/geo_interface.jl +++ b/src/geo_interface.jl @@ -194,7 +194,7 @@ function GI.convert( # We call the full invocation for LibGEOS directly, # so the context can be passed through, since # `GI.convert(Mod, x)` does not allow kwargs. - GI.convert(lg, t, g; context) + GI.convert(lg, t, g; context) end return GeometryCollection(geometries) end diff --git a/src/geos_types.jl b/src/geos_types.jl index 0d45a5e..729e922 100644 --- a/src/geos_types.jl +++ b/src/geos_types.jl @@ -501,7 +501,7 @@ function compare( ng1 = ngeom(geo1) ng2 = ngeom(geo2) ng1 == ng2 || return false - for i in 1:ng1 + for i = 1:ng1 compare(cmp, getgeom(geo1, i), getgeom(geo2, i), ctx) || return false end end @@ -521,7 +521,7 @@ function compare_coord_seqs(cmp, geo1, geo2, ctx) np1 == np2 || return false coords1 = Vector{Float64}(undef, ncoords1) coords2 = Vector{Float64}(undef, ncoords1) - for i in 1:np1 + for i = 1:np1 coordinates!(coords1, geo1, i, ctx) coordinates!(coords2, geo2, i, ctx) cmp(coords1, coords2) || return false @@ -546,7 +546,7 @@ function compare_coord_seqs(cmp::IsApprox, geo1, geo2, ctx) s1 = 0.0 s2 = 0.0 s12 = 0.0 - for i in 1:np1 + for i = 1:np1 coordinates!(coords1, geo1, i, ctx) coordinates!(coords2, geo2, i, ctx) if ncoords1 == 2 @@ -579,7 +579,7 @@ function Base.hash(geo::AbstractGeometry, h::UInt)::UInt if has_coord_seq(geo) return hash_coord_seq(geo, h) else - for i in 1:ngeom(geo) + for i = 1:ngeom(geo) h = hash(getgeom(geo, i), h) end end @@ -592,7 +592,7 @@ function hash_coord_seq(geo::HasCoordSeq, h::UInt)::UInt end buf = Vector{Float64}(undef, nc) ctx = get_context(geo) - for i in 1:npoints(geo) + for i = 1:npoints(geo) coordinates!(buf, geo, i, ctx) h = hash(buf, h) end diff --git a/test/runtests.jl b/test/runtests.jl index 9f88891..eba88b4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -19,8 +19,8 @@ end @testset "Aqua.jl" begin Aqua.test_all( LibGEOS; - ambiguities=(exclude=[GeoInterfaceRecipes.RecipesBase.apply_recipe],), - stale_deps=(ignore=[:GeoInterfaceMakie],), + ambiguities = (exclude = [GeoInterfaceRecipes.RecipesBase.apply_recipe],), + stale_deps = (ignore = [:GeoInterfaceMakie],), ) end diff --git a/test/test_geo_interface.jl b/test/test_geo_interface.jl index 30a3e00..d13ec02 100644 --- a/test/test_geo_interface.jl +++ b/test/test_geo_interface.jl @@ -12,7 +12,7 @@ const LG = LibGEOS @test GeoInterface.getcoord(pt, 1) ≈ 1.0 @test GeoInterface.testgeometry(pt) @test GeoInterface.is3d(pt) == false - @test GeoInterface.extent(pt) == Extent(X=(1.0, 1.0), Y=(2.0, 2.0)) + @test GeoInterface.extent(pt) == Extent(X = (1.0, 1.0), Y = (2.0, 2.0)) Plots.plot(pt) Makie.plot(pt) @@ -84,12 +84,12 @@ const LG = LibGEOS p = GeoInterface.getgeom(ls, 3) @test p isa LibGEOS.Point @test GeoInterface.coordinates(p) == [9, 2] - @test GeoInterface.testgeometry(ls) + @test GeoInterface.testgeometry(ls) @test GeoInterface.is3d(ls) == false Plots.plot(ls) Makie.plot(ls) - + @inferred GeoInterface.ncoord(ls) @inferred GeoInterface.ngeom(ls) @inferred GeoInterface.getgeom(ls) @@ -108,7 +108,7 @@ const LG = LibGEOS @test GeoInterface.is3d(mls) == false Plots.plot(mls) Makie.plot(mls) - + @inferred GeoInterface.ncoord(mls) @inferred GeoInterface.ngeom(mls) @@ -153,7 +153,7 @@ const LG = LibGEOS @test GeoInterface.is3d(polygon) == false Plots.plot(polygon) Makie.plot(polygon) - + @inferred GeoInterface.ncoord(polygon) @inferred GeoInterface.ngeom(polygon) @@ -177,7 +177,7 @@ const LG = LibGEOS @test GeoInterface.geomtrait(multipolygon) == MultiPolygonTrait() @test GeoInterface.testgeometry(multipolygon) @test GeoInterface.is3d(multipolygon) == false - @test GeoInterface.extent(multipolygon) == Extent(X=(0.0, 10.0), Y=(0.0, 10.0)) + @test GeoInterface.extent(multipolygon) == Extent(X = (0.0, 10.0), Y = (0.0, 10.0)) Plots.plot(multipolygon) Makie.plot(multipolygon) @@ -190,7 +190,7 @@ const LG = LibGEOS @test GeoInterface.geomtrait(pmultipolygon) == MultiPolygonTrait() @test GeoInterface.testgeometry(pmultipolygon) @test GeoInterface.is3d(pmultipolygon) == false - @test GeoInterface.extent(pmultipolygon) == Extent(X=(0.0, 10.0), Y=(0.0, 10.0)) + @test GeoInterface.extent(pmultipolygon) == Extent(X = (0.0, 10.0), Y = (0.0, 10.0)) LibGEOS.destroyGeom(pmultipolygon) geomcollection = LibGEOS.readgeom( @@ -267,7 +267,7 @@ const LG = LibGEOS Plots.plot(geomcollection) # Can't plot geometry collection yet with Makie @test_broken Makie.plot(geomcollection) - + @inferred GeoInterface.ncoord(geomcollection) @inferred GeoInterface.ngeom(geomcollection)