From f2e3c9e778504779905c6b79daebb6dd9328a604 Mon Sep 17 00:00:00 2001 From: Kristian Haaga Date: Mon, 19 Sep 2022 13:26:21 +0200 Subject: [PATCH 1/9] Equivalent to, not equivalent with --- src/entropies/shannon.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/entropies/shannon.jl b/src/entropies/shannon.jl index b1a143aae..ee2a50350 100644 --- a/src/entropies/shannon.jl +++ b/src/entropies/shannon.jl @@ -2,7 +2,7 @@ export entropy_shannon """ entropy_shannon(args...; base = MathConstants.e) -Equivalent with `entropy_renyi(args...; base, q = 1)` and provided solely for convenience. +Equivalent to `entropy_renyi(args...; base, q = 1)` and provided solely for convenience. Compute the Shannon entropy, given by ```math H(p) = - \\sum_i p[i] \\log(p[i]) From 52335d653aa24e42e93fbd4969c8abf081144267 Mon Sep 17 00:00:00 2001 From: Kristian Haaga Date: Mon, 19 Sep 2022 13:28:05 +0200 Subject: [PATCH 2/9] Include dispersion entropy --- src/entropies/entropies.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/entropies/entropies.jl b/src/entropies/entropies.jl index 291bf6ed9..8aa8f0a26 100644 --- a/src/entropies/entropies.jl +++ b/src/entropies/entropies.jl @@ -3,4 +3,6 @@ include("tsallis.jl") include("shannon.jl") include("convenience_definitions.jl") include("direct_entropies/nearest_neighbors/nearest_neighbors.jl") -# TODO: What else is included here from direct entropies? \ No newline at end of file +include("direct_entropies/entropy_dispersion.jl") + +# TODO: What else is included here from direct entropies? From b5891b7ee0fae006b6de0a7701233bfa4b9e4c2b Mon Sep 17 00:00:00 2001 From: Kristian Haaga Date: Mon, 19 Sep 2022 13:32:08 +0200 Subject: [PATCH 3/9] Clearer wording --- src/Entropies.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entropies.jl b/src/Entropies.jl index 18e4b2625..173e5c181 100644 --- a/src/Entropies.jl +++ b/src/Entropies.jl @@ -1,7 +1,7 @@ """ A Julia package that provides estimators for probabilities, entropies, and complexity measures for timeseries, nonlinear dynamics and complex systems. -It can be used as standalone or part of several projects in the JuliaDynamics organization, +It can be used as a standalone package, or as part of several projects in the JuliaDynamics organization, such as [DynamicalSystems.jl](https://juliadynamics.github.io/DynamicalSystems.jl/dev/) or [CausalityTools.jl](https://juliadynamics.github.io/CausalityTools.jl/dev/). """ From ae410c308c98638cc5f6d997aee355d413db4ce3 Mon Sep 17 00:00:00 2001 From: Kristian Haaga Date: Mon, 19 Sep 2022 13:32:29 +0200 Subject: [PATCH 4/9] Symbolization routines need to be imported before estimators using them --- src/Entropies.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entropies.jl b/src/Entropies.jl index 173e5c181..a6af61930 100644 --- a/src/Entropies.jl +++ b/src/Entropies.jl @@ -12,10 +12,10 @@ using DelayEmbeddings: AbstractDataset, Dataset, dimension export AbstractDataset, Dataset const Array_or_Dataset = Union{<:AbstractArray, <:AbstractDataset} +include("symbolization/symbolize.jl") include("probabilities.jl") include("probabilities_estimators/probabilities_estimators.jl") include("entropies/entropies.jl") -include("symbolization/symbolize.jl") include("deprecations.jl") From 1c7555f0aaeab6753086dba9e8c23e9953dba646 Mon Sep 17 00:00:00 2001 From: Kristian Haaga Date: Mon, 19 Sep 2022 13:34:01 +0200 Subject: [PATCH 5/9] Export in-place version. --- src/entropies/renyi.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/entropies/renyi.jl b/src/entropies/renyi.jl index a12491e5f..636a04464 100644 --- a/src/entropies/renyi.jl +++ b/src/entropies/renyi.jl @@ -1,4 +1,4 @@ -export entropy_renyi +export entropy_renyi, entropy_renyi! """ entropy_renyi(p::Probabilities; q = 1.0, base = MathConstants.e) From 0f8164ece9603a6ebb870cf42aa6182485c29feb Mon Sep 17 00:00:00 2001 From: Kristian Haaga Date: Mon, 19 Sep 2022 13:35:33 +0200 Subject: [PATCH 6/9] Follow Julia's linting conventions --- test/runtests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index e3b1d5827..019aae464 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -290,7 +290,7 @@ end RectangularBinning([0.2, 0.3, 0.3]) ] - @testset "Binning test $i" for i in 1:length(binnings) + @testset "Binning test $i" for i in eachindex(binnings) est = VisitationFrequency(binnings[i]) @test probabilities(D, est) isa Probabilities @test entropy_renyi(D, est, q=1, base = 3) isa Real # Regular order-1 entropy @@ -310,7 +310,7 @@ end RectangularBinning([0.2, 0.3, 0.3]) ] - @testset "Binning test $i" for i in 1:length(binnings) + @testset "Binning test $i" for i in eachindex(binnings) to = Entropies.transferoperator(D, binnings[i]) @test to isa Entropies.TransferOperatorApproximationRectangular From 3c54e1a91525089f8e620eef1588187fa6a7f4bc Mon Sep 17 00:00:00 2001 From: Kristian Haaga Date: Mon, 19 Sep 2022 13:42:07 +0200 Subject: [PATCH 7/9] Run CI on all pull requests --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7ee7bcbd..36d1b416f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,7 @@ on: pull_request: branches: - main + - '**' # matches every branch push: branches: - main From 14ed42c1e2b4711ab65a5f869225e2f5de13d3c6 Mon Sep 17 00:00:00 2001 From: Kristian Haaga Date: Mon, 19 Sep 2022 14:06:31 +0200 Subject: [PATCH 8/9] Don't export in-place version --- src/entropies/renyi.jl | 2 +- test/runtests.jl | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/entropies/renyi.jl b/src/entropies/renyi.jl index 636a04464..a12491e5f 100644 --- a/src/entropies/renyi.jl +++ b/src/entropies/renyi.jl @@ -1,4 +1,4 @@ -export entropy_renyi, entropy_renyi! +export entropy_renyi """ entropy_renyi(p::Probabilities; q = 1.0, base = MathConstants.e) diff --git a/test/runtests.jl b/test/runtests.jl index 019aae464..5c8ab8585 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -158,16 +158,16 @@ end @test sum(p2) ≈ 1.0 # Entropies - @test entropy_renyi!(s, x, est, q = 1) ≈ 0 # Regular order-1 entropy - @test entropy_renyi!(s, y, est, q = 1) >= 0 # Regular order-1 entropy - @test entropy_renyi!(s, x, est, q = 2) ≈ 0 # Higher-order entropy - @test entropy_renyi!(s, y, est, q = 2) >= 0 # Higher-order entropy + @test Entropies.entropy_renyi!(s, x, est, q = 1) ≈ 0 # Regular order-1 entropy + @test Entropies.entropy_renyi!(s, y, est, q = 1) >= 0 # Regular order-1 entropy + @test Entropies.entropy_renyi!(s, x, est, q = 2) ≈ 0 # Higher-order entropy + @test Entropies.entropy_renyi!(s, y, est, q = 2) >= 0 # Higher-order entropy # For a time series sz = zeros(Int, N - (est.m-1)*est.τ) @test probabilities!(sz, z, est) isa Probabilities @test probabilities(z, est) isa Probabilities - @test entropy_renyi!(sz, z, est) isa Real + @test Entropies.entropy_renyi!(sz, z, est) isa Real @test entropy_renyi(z, est) isa Real end From bd69b66b8d7e4a9f16c7041dcfdfa25dbf06eec2 Mon Sep 17 00:00:00 2001 From: Kristian Haaga Date: Mon, 19 Sep 2022 14:06:41 +0200 Subject: [PATCH 9/9] Missing a letter --- docs/src/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/index.md b/docs/src/index.md index 8f96cd1bf..3609dc576 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -50,4 +50,4 @@ The input data type typically depend on the probability estimator chosen. In gen - _Timeseries_, which are `AbstractVector{<:Real}`, used in e.g. with [`WaveletOverlap`](@ref). - _Multi-dimensional timeseries, or datasets, or state space sets_, which are `Dataset`, used e.g. with [`NaiveKernel`](@ref). -- _Spatial data_, which are higher dimensional standard `Array`, used e.g. with [`SpatialSymbolicPermutation`](@ref). +- _Spatial data_, which are higher dimensional standard `Array`s, used e.g. with [`SpatialSymbolicPermutation`](@ref).