Skip to content

Commit

Permalink
Merge pull request #18 from EcoJulia/next
Browse files Browse the repository at this point in the history
Prepare compatiblity with EcologicalNetworks 0.4
  • Loading branch information
tpoisot authored Dec 1, 2020
2 parents f68a3ca + b2d5c4f commit 9abdcff
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 30 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- master
tags:
- '*'
pull_request:

jobs:
Expand All @@ -13,8 +15,9 @@ jobs:
strategy:
matrix:
version:
- '1.3'
- '1.4'
- 'nightly'
- '1.5'
os:
- ubuntu-latest
- macOS-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CompatHelper

on:
schedule:
- cron: '00 00 * * *'
- cron: '0 * * * *'

jobs:
CompatHelper:
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
name: Documentation

on:
release:
push:
branches:
- master
tags: '*'
pull_request:

jobs:
docs:
name: Documentation
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@latest
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
version: '1.5'
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
GITHUB_TOKEN: ${{ secrets.TOKEN }} # For authentication with GitHub Actions token
run: julia --project=docs/ docs/make.jl
4 changes: 2 additions & 2 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: TagBot
on:
schedule:
- cron: 0 0 * * *
- cron: 0 * * * *
jobs:
TagBot:
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.TOKEN }}
12 changes: 3 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Mangal"
uuid = "b8b640a6-63d9-51e6-b784-5033db27bef2"
authors = ["Timothée Poisot <[email protected]>"]
version = "0.3.0"
version = "0.3.1"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand All @@ -11,14 +11,8 @@ HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"

[compat]
EcologicalNetworks = "0.3"
EcologicalNetworks = "0.3, 0.4"
GeoInterface = "0.5"
HTTP = "0.8"
HTTP = "0.8, 0.9"
JSON = "0.21"
julia = "1.3"

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

[targets]
test = ["Test"]
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
### Mangal.jl

[![Build Status](https://travis-ci.org/EcoJulia/Mangal.jl.svg?branch=master)](https://travis-ci.org/EcoJulia/Mangal.jl) [![Coverage Status](https://coveralls.io/repos/github/EcoJulia/Mangal.jl/badge.svg?branch=master)](https://coveralls.io/github/EcoJulia/Mangal.jl?branch=master)
[![Manual](https://img.shields.io/badge/manual-latest-orange.svg)](http://EcoJulia.github.io/Mangal.jl/dev/)
[![latest doc](https://img.shields.io/badge/documentation-stable-brightgreen)](https://ecojulia.github.io/Mangal.jl/stable/) [![latest doc](https://img.shields.io/badge/documentation-latest-green)](https://ecojulia.github.io/Mangal.jl/latest/)

![CI](https://github.com/EcoJulia/Mangal.jl/workflows/CI/badge.svg?branch=master) [![codecov](https://codecov.io/gh/EcoJulia/Mangal.jl/branch/master/graph/badge.svg?token=HKaubLliPG)](https://codecov.io/gh/EcoJulia/Mangal.jl)

[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![DOI](https://zenodo.org/badge/144035225.svg)](https://zenodo.org/badge/latestdoi/144035225)

This package is a wrapper around the *new* API for the mangal ecological
interactions database. It uses [Julia 1.1][jl] to provide a programmatic
Expand All @@ -12,3 +15,14 @@ database was funded by the [Canadian Foundation for Innovation][cfi] and
[cfi]: https://www.innovation.ca/
[nserc]: http://www.nserc-crsng.gc.ca/index_eng.asp
[jl]: https://julialang.org/

## Getting started

Enter package mode by pressing `]` from the Julia REPL. Then install:

~~~
add Mangal
~~~

That's it. Now head over to the
[documentation](https://ecojulia.github.io/Mangal.jl/dev/).
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ makedocs(

deploydocs(
deps = Deps.pip("pygments", "python-markdown-math"),
repo = "github.com/PoisotLab/Mangal.jl.git",
repo = "github.com/EcoJulia/Mangal.jl.git",
devbranch = "master"
)
12 changes: 9 additions & 3 deletions src/ecologicalnetworks.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
EcologicalNetworks.check_species_validity(::Type{MangalNode}) = nothing
EcologicalNetworks.check_species_validity(::Type{MangalReferenceTaxon}) = nothing
try
EcologicalNetworks._check_species_validity(::Type{MangalNode}) = nothing
EcologicalNetworks._check_species_validity(::Type{MangalReferenceTaxon}) = nothing
catch e
@info "Compatibility with EcologicalNetworks 0.3 will be removed soon"
EcologicalNetworks.check_species_validity(::Type{MangalNode}) = nothing
EcologicalNetworks.check_species_validity(::Type{MangalReferenceTaxon}) = nothing
end

function get_all_interactions(n::MangalNetwork, query::Pair...)
page_size = 250
Expand Down Expand Up @@ -91,7 +97,7 @@ end
missing are dropped
"""
function taxonize(N::T) where {T <: EcologicalNetworks.UnipartiteNetwork}
@assert last(eltype(N)) == MangalNode
@assert eltype(species(N)) == MangalNode
unique_ref_taxa = unique([s.taxon for s in EcologicalNetworks.species(N)])
@warn "This function really should inform of dropped nodes"
filter!(!ismissing, unique_ref_taxa)
Expand Down
3 changes: 3 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[deps]
EcologicalNetworks = "f03a62fe-f8ab-5b77-a061-bb599b765229"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2 changes: 2 additions & 0 deletions test/knownbugs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ module MangalTestKnownBugs
@test typeof(thisnet) <: MangalNetwork
U = convert(UnipartiteNetwork, thisnet)
@test typeof(U) <: UnipartiteNetwork
T = taxonize(U)
@test eltype(EcologicalNetworks.species(T)) <: MangalReferenceTaxon
end

end

2 comments on commit 9abdcff

@tpoisot
Copy link
Member Author

@tpoisot tpoisot commented on 9abdcff Dec 1, 2020

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/25591

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.1 -m "<description of version>" 9abdcff82159605df38e84323330fd4c4862a94e
git push origin v0.3.1

Please sign in to comment.