JuliaDynamics / ComplexityMeasures.jl

Estimators for probabilities, entropies, and other complexity measures derived from data in the context of nonlinear dynamics and complex systems
MIT License
48 stars 11 forks source link

Reproducibility for `TransferOperator` #340

Closed kahaaga closed 7 months ago

kahaaga commented 7 months ago

Background in #337. Fixes #339.

Changes

Example

# Resetting rng will lead to identical results.
p1 = probabilities(TransferOperator(b; rng = MersenneTwister(1234)), D)
p2 = probabilities(TransferOperator(b; rng = MersenneTwister(1234)), D)
@test all(p1 .== p2) # true

# Not resetting rng will lead to non-identical results.
rng = MersenneTwister(1234)
p1 = probabilities(TransferOperator(b; rng), D)
p2 = probabilities(TransferOperator(b; rng), D)
@test !all(p1 .== p2) # true
@test p1[1] ≈ p2[1] # true, since estimates are close
codecov[bot] commented 7 months ago

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (dc6f26f) 88.17% compared to head (fd7cd13) 88.17%.

Files Patch % Lines
...come_spaces/transfer_operator/transfer_operator.jl 50.00% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #340 +/- ## ======================================= Coverage 88.17% 88.17% ======================================= Files 78 78 Lines 2046 2046 ======================================= Hits 1804 1804 Misses 242 242 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.