OSeMOSYS / otoole

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

Update Objective Cost Calculation #240

Closed trevorb1 closed 2 weeks ago

trevorb1 commented 3 weeks ago

Description

In this PR I have updated the objective cost calculation to account for storage costs. Additionally, I have added result calculations for non-discounted storage investment costs, discounted storage investment costs, discounted storage salvage value, and total discounted cost by storage.

Issue Ticket Number

Closes #237

Documentation

na

trevorb1 commented 3 weeks ago

@willu47 would you be able to review this? Since Im modifying the objective cost calculation, a double check that everything looks correct would be great! If you dont have time right now though, no worries at all :)

trevorb1 commented 3 weeks ago

Oh. Actually, sorry, maybe hold off on reviewing this @willu47. I dont think its working correctly. If no storage is in the model, total discounted cost isnt calculated and this warning comes up. It originates from the fact that if no storage is invested in, NewStorageCapacity isnt an available result and the rest of storage calculations fail. Il sort this out and tag you for a review when its fixed!

DEBUG:otoole.results.results:Error calculating TotalDiscountedCost: 'Cannot calculate TotalDiscountedCost due to missing data: \'Cannot calculate TotalDiscountedCostByStorage due to missing data: \\\'Cannot calculate DiscountedCapitalInvestmentStorage due to missing data: "Cannot calculate CapitalInvestmentStorage due to missing data: \\\\\\\'NewStorageCapacity is not accessible or available\\\\\\\'"\\\'\''
willu47 commented 3 weeks ago

NewStorageCapacity isnt an available result

Sounds like a good candidate for a unit test...

trevorb1 commented 3 weeks ago

Great! I believe I addressed the issue in this commit and is ready for a review; if you have a chance please, @willu47!