LRydin / KramersMoyal

kramersmoyal: Kramers-Moyal coefficients for stochastic data of any dimension, to any desired order
MIT License
67 stars 12 forks source link

Various simplifications #14

Closed fmeirinhos closed 1 year ago

fmeirinhos commented 2 years ago

Adds some slight simplifications and removes an unnecessary normalization of the kernel inside the internal computations of _km.

In essence, the pdf (zero-th power of km) was not being properly normalized anyway so this normalization was doing nada.

If you think the pdf should come out normalized, I suggest adding a normalization flag in km and doing that there. I also added a flag for the user to control whether it outputs the bin edges or the bin centers.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 97.08% and project coverage change: +3.84% :tada:

Comparison is base (57e5027) 82.84% compared to head (c37f9c8) 86.68%. Report is 2 commits behind head on master.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #14 +/- ## ========================================== + Coverage 82.84% 86.68% +3.84% ========================================== Files 8 8 Lines 274 323 +49 ========================================== + Hits 227 280 +53 + Misses 47 43 -4 ``` | [Files Changed](https://app.codecov.io/gh/LRydin/KramersMoyal/pull/14?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Rydin) | Coverage Δ | | |---|---|---| | [kramersmoyal/kernels.py](https://app.codecov.io/gh/LRydin/KramersMoyal/pull/14?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Rydin#diff-a3JhbWVyc21veWFsL2tlcm5lbHMucHk=) | `88.13% <82.35%> (-0.39%)` | :arrow_down: | | [kramersmoyal/kmc.py](https://app.codecov.io/gh/LRydin/KramersMoyal/pull/14?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Rydin#diff-a3JhbWVyc21veWFsL2ttYy5weQ==) | `96.82% <100.00%> (+1.91%)` | :arrow_up: | | [test/bincount\_test.py](https://app.codecov.io/gh/LRydin/KramersMoyal/pull/14?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Rydin#diff-dGVzdC9iaW5jb3VudF90ZXN0LnB5) | `100.00% <100.00%> (ø)` | | | [test/binning\_test.py](https://app.codecov.io/gh/LRydin/KramersMoyal/pull/14?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Rydin#diff-dGVzdC9iaW5uaW5nX3Rlc3QucHk=) | `100.00% <100.00%> (ø)` | | | [test/kmc\_test.py](https://app.codecov.io/gh/LRydin/KramersMoyal/pull/14?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Rydin#diff-dGVzdC9rbWNfdGVzdC5weQ==) | `100.00% <100.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/LRydin/KramersMoyal/pull/14/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Rydin)

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

LRydin commented 1 year ago

In the same line, the code was adjusted to increase the QoL:

Various tests were augmented