PSLmodels / Cost-of-Capital-Calculator

A cost of capital and effective tax rate calculator
https://ccc.pslmodels.org
Other
17 stars 33 forks source link

Add exception for non-positive cost of capital #350

Closed jdebacker closed 3 years ago

jdebacker commented 3 years ago

A cost of capital that is non-positive does not make sense (the result would be infinite profits through infinite investment). This PR adds a RuntimeError that is raised if the parameters used result in a non-positive cost of capital.

cc @hdoupe -- this addresses a recent error seen in Compute Studio.

codecov-commenter commented 3 years ago

Codecov Report

Merging #350 (75b27f4) into master (b39cfeb) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #350   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        11           
  Lines         1104      1109    +5     
=========================================
+ Hits          1104      1109    +5     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
ccc/calcfunctions.py 100.00% <100.00%> (ø)