NREL / GEOPHIRES-X

MIT License
28 stars 24 forks source link

IRR is calculated as decimal but erroneously displayed as percent #137

Closed softwareengineerprogrammer closed 7 months ago

softwareengineerprogrammer commented 7 months ago

IRR is calculated with npf.irr: https://github.com/NREL/GEOPHIRES-X/blob/a463d1a7f9943a5e59fe49507bcd2796264f4a77/src/geophires_x/Economics.py#L113

npf.irr gives decimal results, not percent: https://numpy.org/numpy-financial/latest/irr.html

The decimal result is displayed with CurrentUnits.PERCENT:

So it appears that GEOPHIRES is currently underreporting IRR by a factor of 100 unless I'm missing something. (I have tentatively created a fix locally but will wait for confirmation that my assessment here is correct before including in PR)

softwareengineerprogrammer commented 7 months ago

@malcolm-dsider or @kfbeckers can either you confirm whether my assessment in the issue description is correct?

softwareengineerprogrammer commented 7 months ago

See https://github.com/softwareengineerprogrammer/GEOPHIRES-X/pull/13/files for PR into my own fork to fix (which I can convert to a PR for the main repo once I get confirmation I've correctly identified an issue here)

softwareengineerprogrammer commented 7 months ago

Issue is valid and fix in https://github.com/softwareengineerprogrammer/GEOPHIRES-X/pull/13 is appropriate, per discussion with @malcolm-dsider (thanks Malcolm!). Will include fix in https://github.com/NREL/GEOPHIRES-X/pull/136