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

Commit

Permalink
Merge pull request #19 from EcoJulia/feature-queries
Browse files Browse the repository at this point in the history
[WIP] Use pairs instead of a dictionary for queries
  • Loading branch information
tpoisot authored Mar 28, 2020
2 parents 6b1616e + 10f41c1 commit a06817f
Show file tree
Hide file tree
Showing 28 changed files with 272 additions and 336 deletions.
1 change: 0 additions & 1 deletion .codecov.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI
on:
- push
- pull_request
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
version:
- '1.3'
- '1.4'
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1.4'
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
11 changes: 11 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
jobs:
TagBot:
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ deps/deps.jl
docs/build
docs/site
tags
Manifest.toml
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

73 changes: 28 additions & 45 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,21 @@
# This file is machine-generated - editing it directly is not advised

[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[BinaryProvider]]
deps = ["Libdl", "Pkg", "SHA", "Test"]
git-tree-sha1 = "2883bc1b389e3d57a134796c39c788db3f298cef"
uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
version = "0.4.0"

[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "277d3807440d9793421354b6680911fc95d91a84"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "1.0.1"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"

[[Distributed]]
deps = ["LinearAlgebra", "Random", "Serialization", "Sockets"]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[HTTP]]
deps = ["Base64", "Dates", "Distributed", "IniFile", "MbedTLS", "Sockets", "Test"]
git-tree-sha1 = "8a0f75e8b09df01d9f1ba9ad3fbf8b4983595d20"
deps = ["Base64", "Dates", "IniFile", "MbedTLS", "Sockets"]
git-tree-sha1 = "cd60d9a575d3b70c026d7e714212fd4ecf86b4bb"
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
version = "0.6.14"
version = "0.8.13"

[[IniFile]]
deps = ["Test"]
Expand All @@ -38,25 +24,22 @@ uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f"
version = "0.5.0"

[[InteractiveUtils]]
deps = ["LinearAlgebra", "Markdown"]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[JSON]]
deps = ["Dates", "Distributed", "Mmap", "Pkg", "Sockets", "Test", "Unicode"]
git-tree-sha1 = "fec8e4d433072731466d37ed0061b3ba7f70eeb9"
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.19.0"
version = "0.21.0"

[[LibGit2]]
deps = ["Printf"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[LinearAlgebra]]
deps = ["Libdl"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

Expand All @@ -65,16 +48,28 @@ deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[MbedTLS]]
deps = ["BinaryProvider", "Compat", "Libdl", "Pkg", "Sockets"]
git-tree-sha1 = "17d5a81dbb1e682d4ff707c01f0afe5948068fa6"
deps = ["Dates", "MbedTLS_jll", "Random", "Sockets"]
git-tree-sha1 = "a9e2221f06b42f56052f43ad7edecb01d0ef5ab4"
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
version = "0.6.0"
version = "1.0.1"

[[MbedTLS_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "066a4467008745eed36dad973ceb66405785a621"
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
version = "2.16.0+1"

[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[Parsers]]
deps = ["Dates", "Test"]
git-tree-sha1 = "0c16b3179190d3046c073440d94172cfc3bb0553"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "0.3.12"

[[Pkg]]
deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[Printf]]
Expand All @@ -95,27 +90,15 @@ uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[SharedArrays]]
deps = ["Distributed", "Mmap", "Random", "Serialization"]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[UUIDs]]
deps = ["Random"]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[[Unicode]]
Expand Down
12 changes: 11 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
name = "GBIF"
uuid = "ee291a33-5a6c-5552-a3c8-0f29a1181037"
authors = ["Timothée Poisot <timothee.poisot@umontreal.ca>"]
version = "0.1.4"
version = "0.2.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"

[compat]
julia = "1.3"
HTTP = "0.8"
JSON = "0.21"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Pkg.add("GBIF")

- get a single occurrence (`occurrence`)
- look for multiple occurrences (`occurrences`)
- paging function (`next!`, `restart!`, `complete!`)
- quality control (`qualitycontrol!`) and arbitrary filters
- paging function to get the next batch of occurrences (`occurrences!`)
- quality control (`filter!`) and arbitrary filters
- species and taxon lookup (`species`)

## How to contribute
Expand Down
3 changes: 0 additions & 3 deletions REQUIRE

This file was deleted.

47 changes: 0 additions & 47 deletions appveyor.yml

This file was deleted.

2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
7 changes: 4 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ push!(LOAD_PATH, "../src/")
using Documenter, GBIF

makedocs(
sitename = "GBIF wrapper in Julia",
sitename = "GBIF occurrences API wrapper in Julia",
authors = "Timothée Poisot",
modules = [GBIF],
pages = [
"Home" => "index.md",
"Manual" => [
"Getting data" => "data.md",
"Filtering records" => "qaqc.md"
"Filtering records" => "filter.md"
],
"Types" => "types.md"
]
)

deploydocs(
repo = "github.com/EcoJulia/GBIF.jl.git"
repo = "github.com/EcoJulia/GBIF.jl.git",
push_preview = true
)
7 changes: 3 additions & 4 deletions docs/src/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ end
### Query parameters

```@docs
occurrences(q::Dict)
occurrences(t::GBIFTaxon, q::Dict)
occurrences(query::Pair...)
occurrences(t::GBIFTaxon, query::Pair...)
```

### Batch-download of occurrences

```@docs
next!
complete!
occurrences!
```
File renamed without changes.
14 changes: 11 additions & 3 deletions src/GBIF.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ const gbifenums = Dict(
]
)

#=
HACK this is required because some GBIF strings fail to parse, and I do not know
why.
=#
import Base: convert
function convert(::Type{AbstractString}, t::T) where {T <: Nothing}
return "<nothing>"
end

# package code goes here
include("query.jl")

Expand All @@ -100,10 +109,9 @@ include("taxon.jl")
export taxon

include("occurrence.jl")
export occurrence, occurrences

include("paging.jl")
export next!, complete!
export occurrence, occurrences
export occurrences!

include("filter.jl")
export have_both_coordinates, have_neither_zero_coordinates,
Expand Down
Loading

0 comments on commit a06817f

Please sign in to comment.