Open rwijtvliet opened 4 months ago
PfLine({'w': pd.Series([1, 2], pd.date_range('2024', freq='AS', periods=2), dtype='pint[MWh]')}) # raises error (incorrect dimensionality) by calling it i get IndexError: tuple index out of range. is it correct?
Yes, it's correct. w
indicates a power and expects a unit with dimension [energy]/[time], such as MW
. q
indicates an energy and expects a unit such as MWh
or J
. See here
To simplify the code, raise errors where before assumptions were made, about the unit of a value. Require the user to be more specific.
branch
remove_defaults
.Some desired behaviour:
When creating a
PfLine
, it is no longer sufficient to only specify the dimension abbreviation (w
,q
,p
orr
). A unit must also be provided, because a default is not assumed. So:Adding a float to a Price-PfLine:
The documentation is already updated.
Best approach is probably to first update the tests.
Tackle this issue before doing https://github.com/rwijtvliet/portfolyo/issues/88