diff --git a/Project.toml b/Project.toml index 4bdde93..4185a4c 100644 --- a/Project.toml +++ b/Project.toml @@ -17,7 +17,7 @@ TimeseriesFeatures = "f3112013-b923-4dfa-b867-8806c885f823" catch22_jll = "8a07c0c5-99ad-56cb-bc82-72eed1bb61ce" [compat] -DimensionalData = "0.19 - 0.25" +DimensionalData = "0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26" ProgressLogging = "0.1" Reexport = "0.2, 1" Requires = "1" diff --git a/README.md b/README.md index 6badeac..d161426 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ A Julia package wrapping [_catch22_](https://www.github.com/chlubba/catch22), wh The [_catch22_](https://www.github.com/chlubba/catch22) repository provides these 22 features, originally coded in Matlab as part of the [_hctsa_](https://github.com/benfulcher/hctsa) toolbox, as C functions (in addition to Matlab and Python wrappers). This package simply uses Julia's `ccall` to wrap these C functions from a shared library that is accessed through [catch22_jll](https://github.com/JuliaBinaryWrappers/catch22_jll.jl) and compiled by the fantastic [BinaryBuilder](https://github.com/JuliaPackaging/BinaryBuilder.jl) package. +Below we provide a brief getting-started guide to using Catch22.jl. For more detailed information on the _catch22_ feature set, such as in-depth descriptions of each feature and a list of publications that use _catch22_, see the [_catch22_ wiki](https://time-series-features.gitbook.io/catch22). +
# Usage diff --git a/docs/src/index.md b/docs/src/index.md index 15c515e..3597ef5 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -4,8 +4,8 @@ CurrentModule = Catch22 # Catch22.jl -Documentation for [Catch22.jl](https://github.com/brendanjohnharris/Catch22.jl). -For detailed information about the _catch22_ feature set, see the [_catch22_ wiki](https://github.com/DynamicsAndNeuralSystems/catch22/wiki) and the original publication, [Lubba et al. (2019)](https://doi.org/10.1007/s10618-019-00647-x). For further documentation, see [TimeseriesFeatures.jl](https://https://github.com/brendanjohnharris/TimeseriesFeatures.jl) +API reference for [Catch22.jl](https://github.com/brendanjohnharris/Catch22.jl). +For detailed information about the _catch22_ feature set, see the [_catch22_ wiki](https://time-series-features.gitbook.io/catch22/) and the original publication, [Lubba et al. (2019)](https://doi.org/10.1007/s10618-019-00647-x). For further documentation, see [TimeseriesFeatures.jl](https://https://github.com/brendanjohnharris/TimeseriesFeatures.jl) ```@index Modules = [Catch22, TimeseriesFeatures, TimeseriesFeatures.FeatureArrays, TimeseriesFeatures.Features, TimeseriesFeatures.FeatureSets] diff --git a/src/Catch22.jl b/src/Catch22.jl index 99b9aec..0642e63 100644 --- a/src/Catch22.jl +++ b/src/Catch22.jl @@ -48,13 +48,13 @@ Evaluate the feature `fName` on the single time series `𝐱`. See `Catch22.feat Catch22._catch22(𝐱, :DN_HistogramMode_5) ``` """ -function _catch22(𝐱::AbstractVector, fName::Symbol) +function _catch22(𝐱::AbstractVector, fName::Symbol)::Float64 nancheck(𝐱) && return NaN 𝐱 = 𝐱 |> Vector{Float64} fType = featuretypes[fName] return _ccall(fName, fType)(𝐱) end -function _catch22(X::AbstractArray{Float64, 2}, fName::Symbol)::AbstractArray{Float64, 2} +function _catch22(X::AbstractMatrix, fName::Symbol)::Matrix{Float64} mapslices(𝐱 -> _catch22(𝐱, fName), X, dims = [1]) end diff --git a/test/runtests.jl b/test/runtests.jl index b4699c2..e59e8d6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -20,6 +20,10 @@ using SafeTestsets # Test features one by one println("Testing individual features") @testset "Feature $(getname(f))" for f in catch24 + if f in catch22 + @inferred Catch22._catch22(testdata[:test], getname(f)) + @inferred Catch22._catch22(randn(100, 10), getname(f)) + end @test isnearlyequalorallnan(f(testdata[:test]), testoutput[:test][getname(f)]) end