Skip to content

Commit 86f2bae

Browse files
jyv-arfimadevarfimajmcano-arfima
committed
Add financial_losses_pp to PowerPlants assets.
Co-authored-by: Arfima Dev <dev@arfima.com> Co-authored-by: Jose M. Cano <jmcano@arfimaconsulting.com> Signed-off-by: Jonathan Yanez Vargas <jyanez@arfima.com>
1 parent 6551d5c commit 86f2bae

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Contributors
55
* Arfima Dev <dev@arfima.com>
66
* Gonzalo Álvarez <galvarez@arfima.com>
77
* Jonathan Yánez <jyanez@arfima.com>
8+
* Jose M. Cano <jmcano@arfimaconsulting.com>
89
* Víctor de Luna <vdeluna@arfima.com>
910
* Virginia Morales <vmorales@arfima.com>
1011
* Xavier Barrachina <xbarrachina@arfima.com>

src/osc_physrisk_financial/assets.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def financial_losses(
305305
energy_price: float,
306306
r: Sequence[float],
307307
n: Optional[int] = 1,
308-
) -> DiscreteRandomVariable:
308+
) -> Union[DiscreteRandomVariable, float]:
309309
r"""Compute financial losses for a PowerPlant asset.
310310
311311
Parameters
@@ -333,10 +333,5 @@ def financial_losses(
333333
334334
335335
"""
336-
scaled_values = (
337-
damages.values * self.value_0 * energy_price * self.discount(r, n)
338-
)
339-
res = DiscreteRandomVariable(
340-
values=scaled_values, probabilities=damages.probabilities.tolist()
341-
)
342-
return res
336+
return self.value_0 * self.discount(r, n) * energy_price * damages
337+
# TODO SHOULD BE return self.cash_flows * self.discount(r, n)

src/osc_physrisk_financial/random_variables.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ def __init__(
353353
"Impact bins must be sorted in non-decreasing order."
354354
)
355355
total_prob = np.sum(probabilities_np)
356-
print(total_prob)
357356
if not np.isclose(total_prob, 1):
358357
if 0 in intervals_np:
359358
zero_index = np.where(intervals_np == 0)[0][0]

0 commit comments

Comments
 (0)