Open nhoening opened 3 years ago
Can you please add a short example to help me investigate?
In our flexmeasures-entsoe plugin, I am using the function client.query_generation_forecast
from entsoe-py. It returns a pd.Series with a name.
Then I want to create a BeliefsDataFrame from that series:
bdf = BeliefsDataFrame(
series,
source=data_source,
sensor=sensor,
belief_time=now,
)
This created an error.
I worked around that error by adding this line before the BDF creation:
series.name = "event_value"
Setting it to None
would also have worked.
Hope that helps.
Bump: Could this be something we get into the next release? I could imagine it's a one-liner. I could also do this, but @Flix6x, you said you want to investigate, as well.
It should be a simple fix indeed, I just didn't get around to it. Feel free to submit a PR.
In this line, TB will use the name of the series if it has one instead of
event_value
, but then fail later on because the resulting BeliefsDataFrame requires a column of that name.I propose we drop names of such series if they are argument 0.
P.S. It could be documented a bit clearer that you use a kw arg
beliefs
for initialization method 1, but non-kw args for method 2 & 3.