File tree Expand file tree Collapse file tree 3 files changed +4
-9
lines changed
src/osc_physrisk_financial Expand file tree Collapse file tree 3 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ Contributors
5
5
* Arfima Dev <dev@arfima.com>
6
6
* Gonzalo Álvarez <galvarez@arfima.com>
7
7
* Jonathan Yánez <jyanez@arfima.com>
8
+ * Jose M. Cano <jmcano@arfimaconsulting.com>
8
9
* Víctor de Luna <vdeluna@arfima.com>
9
10
* Virginia Morales <vmorales@arfima.com>
10
11
* Xavier Barrachina <xbarrachina@arfima.com>
Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ def financial_losses(
305
305
energy_price : float ,
306
306
r : Sequence [float ],
307
307
n : Optional [int ] = 1 ,
308
- ) -> DiscreteRandomVariable :
308
+ ) -> Union [ DiscreteRandomVariable , float ] :
309
309
r"""Compute financial losses for a PowerPlant asset.
310
310
311
311
Parameters
@@ -333,10 +333,5 @@ def financial_losses(
333
333
334
334
335
335
"""
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)
Original file line number Diff line number Diff line change @@ -353,7 +353,6 @@ def __init__(
353
353
"Impact bins must be sorted in non-decreasing order."
354
354
)
355
355
total_prob = np .sum (probabilities_np )
356
- print (total_prob )
357
356
if not np .isclose (total_prob , 1 ):
358
357
if 0 in intervals_np :
359
358
zero_index = np .where (intervals_np == 0 )[0 ][0 ]
You can’t perform that action at this time.
0 commit comments