Skip to content

Refactor api #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7ccca83
Remove @show
kahaaga Sep 6, 2022
9eea571
Refactor nearest neighbors methods
kahaaga Sep 6, 2022
327dff7
Typos
kahaaga Sep 6, 2022
6b435b2
Remove duplicate function
kahaaga Sep 6, 2022
89e5b62
Reorganize docs
kahaaga Sep 6, 2022
8281f50
API renaming
kahaaga Sep 6, 2022
37eee1e
Switch order of docs
kahaaga Sep 6, 2022
0d76704
Refactoring
kahaaga Sep 7, 2022
6537561
Unnecessary capitalization
kahaaga Sep 7, 2022
50aa265
Further refactoring
kahaaga Sep 7, 2022
1ea12f8
Missing part of equation
kahaaga Sep 7, 2022
873e7c6
Use new name
kahaaga Sep 7, 2022
256b4e1
Add deprecations
kahaaga Sep 8, 2022
46c86db
Add note for single-symbol encoding in docstring
kahaaga Sep 8, 2022
e23dbcc
Add note for single-symbol encoding in docstring
kahaaga Sep 8, 2022
6110d54
Merge remote-tracking branch 'origin/refactor_api' into refactor_api
kahaaga Sep 8, 2022
25fd231
Remove redundant note
kahaaga Sep 8, 2022
73f0a58
Use @deprecate for genentropy
kahaaga Sep 8, 2022
ddeb1db
Add (preliminary) update message
Datseris Sep 9, 2022
bf07639
[wip] reusable docs
Datseris Sep 9, 2022
bb9019b
re-write intro page
Datseris Sep 10, 2022
51cf580
improve entropy wording
Datseris Sep 10, 2022
48c5ba2
Complete re-organization of source code folders
Datseris Sep 10, 2022
b7b2758
correct includes state
Datseris Sep 10, 2022
fd97c39
finish first draft of docs new way (many TODOs left_)
Datseris Sep 10, 2022
c9084cf
Fix wavelet entropy docs
Datseris Sep 10, 2022
ed6f2ac
add docstrings to convenience calls
Datseris Sep 10, 2022
c5acd2f
final touches
Datseris Sep 10, 2022
47189f0
add documentation build phase
Datseris Sep 11, 2022
a9e6512
Add power spectrum probability estimator (#94)
Datseris Sep 14, 2022
8b4dd4b
even better test reorganization
Datseris Sep 14, 2022
608a804
add one more depth level
Datseris Sep 16, 2022
aace207
WIP: reviewing new api (#95)
kahaaga Sep 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
branches:
- main
- '**' # matches every branch
push:
branches:
- main
Expand All @@ -15,20 +16,18 @@ jobs:
fail-fast: false
matrix:
version:
- '1' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
os:
- ubuntu-latest
- '1'
os: [ubuntu-latest] # adjust according to need, e.g. os: [ubuntu-latest] if testing only on linux
arch:
- x64

steps:
# Cancel ongoing CI test runs if pushing to branch again before the previous tests
# Cancel ongoing CI test runs if pushing to branch again before the previous tests
# have finished
- name: Cancel ongoing test runs for previous commits
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

# Do tests
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
Expand All @@ -51,3 +50,31 @@ jobs:
- uses: codecov/codecov-action@v1
with:
file: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
# Cancel ongoing documentation build if pushing to branch again before the previous
# build is finished.
- name: Cancel ongoing documentation builds for previous commits
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

# Build docs
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- name: Instantiate and install dependencies
run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- name: Generate documentation and deploy
env: # needed for pushing to gh-pages branch
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
run:
julia --project=docs docs/make.jl
4 changes: 4 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ version = "1.3.0"
[deps]
DelayEmbeddings = "5732040d-69e3-5649-938a-b6b4f237613f"
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Neighborhood = "645ca80c-8b79-4109-87ea-e1f58159d116"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Scratch = "6c6a2e73-6563-6170-7368-637461726353"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Expand All @@ -21,8 +23,10 @@ Wavelets = "29a6e085-ba6d-5f35-a997-948ac2efa89a"
[compat]
DelayEmbeddings = "2"
Distances = "0.9, 0.10"
FFTW = "1"
Neighborhood = "0.1, 0.2"
QuadGK = "2"
Scratch = "1"
SpecialFunctions = "0.10, 1.0, 2"
StaticArrays = "0.12, 1.0"
StatsBase = "0.33"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
DynamicalSystems = "61744808-ddfa-5f27-97ff-6e42cc95d634"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Entropies = "ed8fcbec-b94c-44b6-89df-898894ad9591"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Wavelets = "29a6e085-ba6d-5f35-a997-948ac2efa89a"
35 changes: 15 additions & 20 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
using Entropies # using before activation of environment ensures dev'ed version
cd(@__DIR__)
using Pkg
CI = get(ENV, "CI", nothing) == "true" || get(ENV, "GITHUB_TOKEN", nothing) !== nothing
CI && Pkg.activate(@__DIR__)
Pkg.activate(@__DIR__)
CI && Pkg.instantiate()
CI && (ENV["GKSwstype"] = "100")
using DelayEmbeddings
using Documenter
using DocumenterTools: Themes
using Entropies
using PyPlot
using CairoMakie
using Entropies.Wavelets
using DynamicalSystems
using Wavelets

# %% JuliaDynamics theme.
# download the themes
# %% JuliaDynamics theme
# It includes themeing for the HTML build
# and themeing for the Makie plotting

using DocumenterTools: Themes
for file in ("juliadynamics-lightdefs.scss", "juliadynamics-darkdefs.scss", "juliadynamics-style.scss")
download("https://raw.githubusercontent.com/JuliaDynamics/doctheme/master/$file", joinpath(@__DIR__, file))
filepath = joinpath(@__DIR__, file)
if !isfile(filepath)
download("https://raw.githubusercontent.com/JuliaDynamics/doctheme/master/$file", joinpath(@__DIR__, file))
end
end
# create the themes
for w in ("light", "dark")
Expand All @@ -29,18 +33,10 @@ Themes.compile(joinpath(@__DIR__, "juliadynamics-light.scss"), joinpath(@__DIR__
Themes.compile(joinpath(@__DIR__, "juliadynamics-dark.scss"), joinpath(@__DIR__, "src/assets/themes/documenter-dark.css"))

# %% Build docs
PyPlot.ioff()
cd(@__DIR__)
ENV["JULIA_DEBUG"] = "Documenter"

PAGES = [
"Entropies.jl" => "index.md",
"Estimators" => "estimators.md",
"Remaining" => [
"DispersionEntropy.md",
],
"Utility methods" => "utils.md",
]
PAGES = include("toc.jl")
include("style.jl")

makedocs(
modules = [Entropies],
Expand All @@ -49,6 +45,7 @@ makedocs(
assets = [
asset("https://fonts.googleapis.com/css?family=Montserrat|Source+Code+Pro&display=swap", class=:css),
],
collapselevel = 3,
),
sitename = "Entropies.jl",
authors = "Kristian Agasøster Haaga, George Datseris",
Expand All @@ -62,5 +59,3 @@ if CI
push_preview = true
)
end
PyPlot.close("all")
PyPlot.ion()
5 changes: 0 additions & 5 deletions docs/src/DispersionEntropy.md

This file was deleted.

7 changes: 7 additions & 0 deletions docs/src/complexity_measures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Complexity measures

## Sample entropy

## Approximate entropy

## Disequilibrium
36 changes: 36 additions & 0 deletions docs/src/entropies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Entropies

## Rényi (generalized) entropy

```@docs
entropy_renyi
```

## Tsallis (generalized) entropy

```@docs
entropy_tsallis
```

## Shannon entropy (convenience)
```@docs
entropy_shannon
```

## Indirect entropies
Here we list functions which compute Shannon entropies via alternate means, without explicitly computing some probability distributions and then using the Shannon formulat.

### Nearest neighbors entropy
```@docs
entropy_kraskov
entropy_kozachenkoleonenko
```

## Convenience functions
In this subsection we expand documentation strings of "entropy names" that are used commonly in the literature, such as "permutation entropy". As we made clear in [API & terminology](@ref), these are just the existing Shannon/Rényi/Tsallis entropy with a particularly chosen probability estimator. We have only defined convenience functions for the most used names, and arbitrary more specialized convenience functions can be easily defined in a couple lines of code.
```@docs
entropy_permutation
entropy_spatial_permutation
entropy_wavelet
entropy_dispersion
```
Loading