Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 1.91 KB

File metadata and controls

25 lines (19 loc) · 1.91 KB

Entropies.jl Dev Docs

Good practices in developing a code base apply in every Pull Request. The Good Scientific Code Workshop is worth checking out for this.

Adding a new ProbabilitiesEstimator

Mandatory steps

  1. Decide on the outcome space and how the estimator will map probabilities to outcomes.
  2. Define your type and make it subtype ProbabilitiesEstimator.
  3. Add a docstring to your type following the style of the docstrings of other estimators.
  4. If suitable, the estimator may be able to operate based on [Encoding]s. If so, it is preferred to implement an Encoding subtype and extend the methods encode and decode. This will allow your probabilities estimator to be used with a larger span of entropy and complexity methods without additional effort.
  5. Implement dispatch for probabilities_and_outcomes and your probabilities estimator type.
  6. Implement dispatch for outcome_space and your probabilities estimator type.
  7. Add your probabilities estimator type to the table list in the documentation page of probabilities. If you made an encoding, also add it to corresponding table in the encodings section.

Optional steps

You may extend any of the following functions if there are potential performance benefits in doing so:

  1. probabilities. By default it calls probabilities_and_outcomes and returns the first value.
  2. outcomes. By default calls probabilities_and_outcomes and returns the second value.
  3. total_outcomes. By default it returns the length of outcome_space. This is the function that most typically has performance benefits if implemented explicitly, so most existing estimators extend it by default.

Tests

You also need to add tests for all functions that you explicitly extended. Not extended functions do not need to be tested.