rwijtvliet / portfolyo

Handling timeseries for power and gas retail portfolios.
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

[bug/performance] multiplying pfline with float-series #77

Open rwijtvliet opened 7 months ago

rwijtvliet commented 7 months ago

This takes a loooong time.

Prep:

import portfolyo as pf
import pandas as pd
import numpy as np
i = pd.date_range('2020', '2021', freq='15T', inclusive='left')
pfl = pf.dev.get_pfline(i, pf.Kind.PRICE)
factors = pd.Series(np.random.rand(len(i)), i)

Test:

pfl * factors

I aborted after 10 minutes.

Current workaround (and correct result):

pf.PfLine(pfl.p * factors)

Takes 0.1 seconds.