Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement periodic behaviour into plumbing.sequence #960

Closed
wants to merge 12 commits into from

Conversation

nailend
Copy link
Contributor

@nailend nailend commented Jul 27, 2023

close #959

A periodically changing sequence is handy for the multi-period investment, when the parameters should change per period.
For this I have adapted plumbing.sequence and plumbing._sequence. An additional distinction must be made for this behavior.

Apparently, the approach with the distinction by variability of the passed iterables in sequence does not work, because pandas.series are interpreted as immutable sequence.

I therefore decided to specify periodic behavior only when a dictionary is passed. The explicit keys len and values also make it more clear

>>> x = sequence({"len":9,"values":[1,2,3]})
>>> print(x)
[0, 0, 0, 1, 1, 1, 2, 2, 2]
>>> x[1]
0
>>> x[4]
1
>>> x[7]
2

I would appreciate your opinion on this @p-snft or @uvchik if this could break anything

If periodc_values and higest_index are passed a periodic
sequence is emulated. This can be used for the multi-period
investment if parameters change per period.
The periodic behaviour is triggered if an immutable iterable is
passed.
@nailend nailend requested a review from uvchik July 27, 2023 15:27
@nailend nailend linked an issue Jul 27, 2023 that may be closed by this pull request
@nailend nailend removed the request for review from uvchik July 27, 2023 15:27
@nailend nailend marked this pull request as draft July 27, 2023 15:27
As pd.series are frequently passed and interpretated as inmutable
iterables, this was a bad choice. Passing a dictionary to a sequence
is uncommon and therefore a better choice.
@nailend nailend marked this pull request as ready for review August 7, 2023 08:36
@nailend
Copy link
Contributor Author

nailend commented Oct 11, 2023

We decided to solve this in oemof.tabular as this approach comes with more difficulties then expected...

@nailend nailend closed this Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling period-specific parameters in multi-period-investment
3 participants