cbherbert / stochrare

This Python package aims at providing tools to study stochastic processes: integrate SDEs, solve Fokker-Planck equations, sample rare events,...
GNU General Public License v3.0
8 stars 5 forks source link

I8 add 1d decorator #19

Closed tlestang closed 4 years ago

tlestang commented 4 years ago

This adds a new decorator one_d_method in stochrare.utils that protects methods that should only be available for 1d dynamics. Caveat: the decorator should only be used on objects that have an attribute dimension.

Additonally, this PR makes the dimension attribute of class DiffusionProcess a property, checking that the dimension is not lower than 1.

Addresses #8

codecov-commenter commented 4 years ago

Codecov Report

Merging #19 into dev will increase coverage by 0.69%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev      #19      +/-   ##
==========================================
+ Coverage   77.83%   78.53%   +0.69%     
==========================================
  Files          14       14              
  Lines        1092     1202     +110     
==========================================
+ Hits          850      944      +94     
- Misses        242      258      +16     
Impacted Files Coverage Δ
stochrare/dynamics/diffusion.py 86.56% <100.00%> (-1.46%) :arrow_down:
stochrare/utils.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 22af6bc...bcc5d13. Read the comment docs.