Skip to content

Commit

Permalink
change isGeoRegion to isgeo
Browse files Browse the repository at this point in the history
  • Loading branch information
natgeo-wong committed Sep 25, 2024
1 parent 01b212a commit b0050fc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/GeoRegions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export
GeoRegion,
RectRegion, PolyRegion, TiltRegion,

==, isGeoRegion, isID,
==, isgeo, isID,
add, rm, rmID, overwrite,

setupGeoRegions, readGeoRegions, addGeoRegions, deleteGeoRegions,
Expand Down
4 changes: 2 additions & 2 deletions src/georegions/is.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
==(geo1::T, geo2::T) where T <: TiltRegion =
getfield.(Ref(geo1),fieldnames(T)) == getfield.(Ref(geo2),fieldnames(T))

function isGeoRegion(
function isgeo(
geo :: GeoRegion;
path :: AbstractString = dirname(geo.path),
throw :: Bool = true
Expand Down Expand Up @@ -37,7 +37,7 @@ function isGeoRegion(
end

"""
isGeoRegion(
isID(
geoID :: AbstractString;
path :: AbstractString = homedir(),
throw :: Bool = true
Expand Down
2 changes: 1 addition & 1 deletion src/georegions/remove.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Keyword Arguments
rm(
geo :: GeoRegion;
path :: AbstractString = dirname(geo.path)
) = if isGeoRegion(geo,path=path)
) = if isgeo(geo,path=path)
rmID(geo.ID,path=path)
end

Expand Down
20 changes: 10 additions & 10 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ using Test

disable_logging(Logging.Warn)
geo = RectRegion("TRP","GLB","Tropics",[30,-30,360,0])
@test !isGeoRegion(geo,throw=false)
@test !isgeo(geo,throw=false)
@test add(geo) === nothing
@test isGeoRegion(geo,throw=false)
@test isgeo(geo,throw=false)
rm(geo)
disable_logging(Logging.Debug)

Expand All @@ -17,12 +17,12 @@ using Test
geo1 = RectRegion("TRP","GLB","Tropics",[30,-30,360,0],save=true)
geo2 = RectRegion("TRP_DTP","GLB","Deep Tropics",[10,-10,360,0],save=true)
@test isID("TRP",throw=false)
@test isGeoRegion(geo1,throw=false)
@test isgeo(geo1,throw=false)
@test rm(geo1) === nothing
@test !isGeoRegion(geo1,throw=false)
@test isGeoRegion(geo2,throw=false)
@test !isgeo(geo1,throw=false)
@test isgeo(geo2,throw=false)
@test rmID("TRP_DTP") === nothing
@test !isGeoRegion(geo2,throw=false)
@test !isgeo(geo2,throw=false)
disable_logging(Logging.Debug)

end
Expand All @@ -34,11 +34,11 @@ end
geo1 = RectRegion("TRP","GLB","Tropics",[30,-30,360,0],path=pwd(),save=true)
@test !isID("TRP",throw=false)
@test isID("TRP",path=pwd(),throw=false)
@test isGeoRegion(geo1,throw=false)
@test !isGeoRegion(geo1,path=homedir(),throw=false)
@test isgeo(geo1,throw=false)
@test !isgeo(geo1,path=homedir(),throw=false)
@test_throws "not a valid GeoRegion identifier" rm(geo1,path=homedir())
@test rm(geo1) === nothing
@test !isGeoRegion(geo1,throw=false)
@test !isgeo(geo1,throw=false)
disable_logging(Logging.Debug)

end
Expand All @@ -63,7 +63,7 @@ end
IDvec,_,_ = GeoRegions.listall()
for ID in IDvec
@test isID(ID,throw=false);
@test isGeoRegion(GeoRegion(ID),throw=false);
@test isgeo(GeoRegion(ID),throw=false);
end
disable_logging(Logging.Debug)

Expand Down

0 comments on commit b0050fc

Please sign in to comment.