OSeMOSYS / otoole

OSeMOSYS Tools for Energy
https://otoole.readthedocs.io
MIT License
25 stars 18 forks source link

Correct CRF calcualtions for empty discount rates #234

Closed trevorb1 closed 1 month ago

trevorb1 commented 1 month ago

Description

In this PR I have addressed the failing CRF calculation if no discount rate is provided (which was partially addressed in PR #216). Following @willu47's suggestion in ticket #217, the _expand_default() function is used to ensure discount rate data is always passed into the CRF, PVA, and Discount Factor functions. Since handling the DiscountRate and DiscountRateIdv differences is a little confusing (imo), I also added in ValueError checks to the functions to check for non-empty discount rates - but these shouldnt really be needed. Just added as double check.

Issue Ticket Number

closes #217

Documentation

na