-
Notifications
You must be signed in to change notification settings - Fork 14
Entropy signature and folder structure cleanup #168
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #168 +/- ##
==========================================
+ Coverage 84.01% 84.94% +0.92%
==========================================
Files 37 37
Lines 951 963 +12
==========================================
+ Hits 799 818 +19
+ Misses 152 145 -7
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Why make a change to the existing API, that was |
Two reasons:
|
That said, which I completely forgot, because I don't explicitly use it in CausalityTools at the moment - we should also change the order of the arguments for I don't see any downside of doing so, other than "it is a change". But we're releasing 2.0, so we might as well be consistent everywhere. |
ok, are you changing the order here? There is a massive git conflict. |
Yes, I will change the order here.
Yes, I think that's because of the folder structure change. However, that can easily be fixed. I'll fix it as I do the remaining changes for the |
@Datseris The refactoring, according to our discussion above, is now ready. All tests pass, and the documentation looks good. The git diff looks massive due to folder structure changes, but in reality, there aren't really any changes except for the ordering of method arguments. Exact overview is found in my updated initial comment.
|
Work in progress. Addresses #167. I will update this when #162 is merged.
Changes
Small bug fix for
Zhu
andZhuSingh
estimators: thebase
belongs in the entropy struct, not in the estimator.IndirectEntropy
is nowEntropyEstimator
. Documentation strings for subtypes ofEntropyEstimator
explicitly say what type of entropy they estimate. For example, the docstring forKraskov
says that it estimates Shannon entropy.Folder structures, both for source code and tests, are changed to reflect this conceptual change.
B
lives in foldersrc/entropies/estimators/...
, and its tests live intest/entropies/estimators/B.jl
A
lives in foldersrc/probabilities_estimators/A
, and its tests live intest/probabilities/estimators/A.jl
.Order of arguments
See discussion above for justification for the following changes.
Entropy API is now
entropy(e::Entropy, est::EntropyEstimator, x)
entropy(e::Entropy, est::ProbabilityEstimator, x)
entropy(e::Entropy, probs::Probabilities
)entropy_maximum
andentropy_normalized
have been adjusted accordingly.Probabilities API is now
probabilities(est::ProbabilitiesEstimator, x)
TODO: