Skip to content

Commit

Permalink
Links to new Catch22 wiki, small type stability tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanjohnharris committed Apr 9, 2024
1 parent a9860fe commit 25ebe42
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ A Julia package wrapping [_catch22_](https://github.com/chlubba/catch22), wh

The [_catch22_](https://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).

<br>

# Usage
Expand Down
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions src/Catch22.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 25ebe42

Please sign in to comment.