Skip to content

Commit

Permalink
patch asindices
Browse files Browse the repository at this point in the history
  • Loading branch information
mkborregaard committed Feb 5, 2020
1 parent cc1ca08 commit 7044cf3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.jl.cov
*.jl.*.cov
*.jl.mem
.DS_Store
Manifest.toml
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ keywords = ["macroecology", "ecology", "biology", "geography"]
license = "MIT"
desc = "Base package with abstract types for ecology"
authors = ["mkborregaard <mkborregaard@sund.ku.dk", "RichardReeve <Richard.Reeve@glasgow.ac.uk>"]
version = "0.1.0"
version = "0.1.1"

[deps]
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"

[compat]
julia = "1.0"
SpatialEcology = "0.9"
Diversity = "0.5"
RecipesBase = "0.7"
SpatialEcology = "0.9"
julia = "1.0"

[extras]
SpatialEcology = "348f2d5d-71a3-5ad4-b565-8af070f99681"
Diversity = "d3d5718d-52de-57ab-b67a-eca7fd6175a4"
SpatialEcology = "348f2d5d-71a3-5ad4-b565-8af070f99681"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
Expand Down
4 changes: 2 additions & 2 deletions src/Interface.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

asindices(x::Integer) = x
asindices(x::AbstractArray{T}) where T <: Union{Missing, Integer} = x
asindices(x::AbstractArray{Union{Missing, Bool}}) = findall(y->!ismissing(y) && y, x)
asindices(x::AbstractArray{T}) where T <: Bool = findall(x)
asindices(x, y) = asindices(x)
asindices(x::AbstractArray{T}, y::AbstractArray{T}) where T <: Union{Missing, AbstractString} = [el for el in indexin(x, y) if el !== nothing]
asindices(x::AbstractArray{T}, y::AbstractArray{<:AbstractString}) where T <: Union{Missing, Symbol} = asindices(string.(x), y)
asindices(x::T, y::AbstractArray) where T <: Union{Missing, Symbol, AbstractString} = asindices([x], y)
asindices(x::T, y::AbstractArray) where T <: Union{Missing, Symbol, AbstractString} = first(asindices([x], y))

# Functions - most have to be implemented with the concrete type
occurrences(asm::AbstractAssemblage)::AbstractMatrix = error("function not defined for $(typeof(asm))")
Expand Down

2 comments on commit 7044cf3

@mkborregaard
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 register()

@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/8907

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 Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.1 -m "<description of version>" 7044cf3150ba1d5378b9bc817509c4c449ebb724
git push origin v0.1.1

Please sign in to comment.