Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Commit

Permalink
🧹 oneliners for taxonomic affiliation
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoisot committed Nov 27, 2020
1 parent a2ef9c8 commit 3f22bd4
Showing 1 changed file with 8 additions and 28 deletions.
36 changes: 8 additions & 28 deletions src/taxon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,34 +38,14 @@ function taxon(name::String;
]
args = Dict{String, Any}("name" => name, "strict" => strict)

if !isnothing(rank)
args["rank"] = String(rank)
end

if !isnothing(kingdom)
args["kingdom"] = String(kingdom)
end

if !isnothing(phylum)
args["phylum"] = String(phylum)
end

if !isnothing(class)
args["class"] = String(class)
end

if !isnothing(order)
args["order"] = String(order)
end

if !isnothing(family)
args["family"] = String(family)
end

if !isnothing(genus)
args["genus"] = String(genus)
end

isnothing(rank) || (args["rank"] = String(rank))
isnothing(kingdom) || (args["kingdom"] = String(kingdom))
isnothing(phylum) || (args["phylum"] = String(phylum))
isnothing(class) || (args["class"] = String(class))
isnothing(order) || (args["order"] = String(order))
isnothing(family) || (args["family"] = String(family))
isnothing(genus) || (args["genus"] = String(genus))

sp_s_url = gbifurl * "species/match"
sp_s_req = HTTP.get(sp_s_url, query=args)
if sp_s_req.status == 200
Expand Down

2 comments on commit 3f22bd4

@tpoisot
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/25405

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.2 -m "<description of version>" 3f22bd44dcd03212cf3cf4614356e25b1b4e510c
git push origin v0.3.2

Please sign in to comment.