-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add developers doc; accordingly rename abstract supertypes (#72)
* start devdocs * change supertype docstring for changes * rename IndicatorsChangesConfig -> ChangesConfig * rename IndicatorsChangesResults -> ChangesResults * finish core steps for new change metric * rename estimate_indicator_changes -> estimate_changes * finish the devdocs * rename TransitionsSIgnificance -> SignificanceConfig * add devdocs to the doc build * rename SignificanceConfig -> Significance; not confuse with ChangeConfig
- Loading branch information
Showing
20 changed files
with
134 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ pages = [ | |
"Examples" => example_pages, | ||
"api.md", | ||
"refs.md", | ||
"devdocs.md", | ||
] | ||
|
||
import Downloads | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Developer's documentation | ||
|
||
This documentation addresses users that would like to contribute to the software by either solving bugs, improving documentation, or adding new methods. | ||
All contributions come in the form of Pull Requests, for which we strongly advise to follow [good practices in scientific code](https://github.com/JuliaDynamics/GoodScientificCodeWorkshop), which means that they properly formatted, documented, tested, etc. | ||
|
||
## New indicators or change metrics | ||
|
||
As explained already in e.g., [`SlidingIndicatorConfig`](@ref), new indicators or change metrics are standard Julia functions, so you only need to define such a function (and document it, test it, etc.). | ||
|
||
## New pipeline for estimating changes | ||
|
||
This means to contribute a fundamentally new "pipeline" for estimating/detecting | ||
transitions in timeseries. This new pipeline defines what a "transition" means. | ||
To add a new pipeline follow these steps: | ||
|
||
1. Define a new subtype of [`ChangesConfig`](@ref) | ||
2. Define a new subtype of [`ChangesResults`](@ref) | ||
3. Add a method for [`estimate_changes`](@ref) which accepts | ||
the new `ChangesConfig` subtype you defined and | ||
returns the `ChangesResults` subtype you defined. | ||
|
||
And that's it! | ||
|
||
_Optionally_ you can further extend: | ||
|
||
- `TransitionsInTimeseries.plot_indicator_changes` with the new `ChangesResults` type you defined. Note the plotting functions are in the `ext` folder of the repository. | ||
- `significant_transitions(res::ChangesResults, signif::Significance)` | ||
with your new `ChangesResults` type and as many `Significance` | ||
subtypes you have the capacity to extend for. | ||
|
||
|
||
## New pipeline for estimating significance | ||
|
||
Statistically significant changes are "transitions". | ||
However, what "significant" means is not universal. There are different ways to | ||
test for significance and TransitionsInTimeseries.jl allows various methods. | ||
|
||
To add a new pipeline for estimating significance follow these steps: | ||
|
||
1. Define a new subtype of [`Significance`](@ref) | ||
2. Extend `significant_transitions(res::ChangesResults, signif::Significance)` | ||
with your new type and as many `ChangesResults` subtypes as you have | ||
capacity for. | ||
|
||
And that's it! Unfortunately so far we have found no way to make the | ||
`significant_transitions` code agnostic of the changes result, so you would | ||
need to add a method manually for every `ChangesResults`. | ||
|
||
_Optionally_ you can further extend `TransitionsInTimeseries.plot_significance!` | ||
(which you can find in the `ext` folder) for visualizing the significance results. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,37 @@ | ||
""" | ||
IndicatorsChangesConfig | ||
ChangesConfig | ||
Supertype used to define how indicators and their changes are estimated in | ||
[`estimate_indicator_changes`](@ref). Valid subtypes are: | ||
Supertype for how "changes" in a timeseries are estimated in [`estimate_changes`](@ref). | ||
"Changes" deemed statistically significant in [`significant_transitions`](@ref) | ||
are "transitions" in the timeseries. | ||
Existing subtypes of `ChangesConfig` are: | ||
- [`SlidingWindowConfig`](@ref). | ||
- [`SegmentedWindowConfig`](@ref). | ||
""" | ||
abstract type IndicatorsChangesConfig end | ||
abstract type ChangesConfig end | ||
|
||
""" | ||
estimate_indicator_changes(config::IndicatorsChangesConfig, x [,t]) → result | ||
estimate_changes(config::ChangesConfig, x [,t]) → result | ||
Estimate possible transitions for input timeseries `x` using the approach specified | ||
in the configuration type `config`, see [`IndicatorsChangesConfig`](@ref) for possibilities. | ||
in the configuration type `config`, see [`ChangesConfig`](@ref) for possibilities. | ||
`t` is the time vector corresponding to `x`, which defaults to `eachindex(x)`. | ||
Return the output as subtype of [`IndicatorsChangesResults`](@ref). | ||
Return the output as subtype of [`ChangesResults`](@ref). | ||
The particular form of the output depends on the `config` and is described in its docstring. | ||
Regardless of type, `result` can always be given to | ||
[`significant_transitions`](@ref) to deduce which possible transitions are statistically | ||
significant using a variety of significance tests. | ||
""" | ||
function estimate_indicator_changes end | ||
function estimate_changes end | ||
# The function is extended via multiple dispatch in the specific files | ||
|
||
""" | ||
IndicatorsChangesResults | ||
ChangesResults | ||
Supertype used to gather results of [`estimate_indicator_changes`](@ref). | ||
Supertype used to gather results of [`estimate_changes`](@ref). | ||
The concrete subtype instances are described in the docstrings of configuration types. | ||
""" | ||
abstract type IndicatorsChangesResults end | ||
abstract type ChangesResults end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.