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

Outdated docs for use of multi-periods #978

Closed
henhuy opened this issue Sep 20, 2023 · 1 comment · Fixed by #981
Closed

Outdated docs for use of multi-periods #978

henhuy opened this issue Sep 20, 2023 · 1 comment · Fixed by #981
Assignees

Comments

@henhuy
Copy link
Contributor

henhuy commented Sep 20, 2023

In the multi-period section in the docs it's stated that you can parametrize the periods as dict:

oemof-solph/docs/usage.rst

Lines 1027 to 1035 in f02297e

import pandas as pd
import oemof.solph as solph
my_index = pd.date_range('1/1/2013', periods=17520, freq='H')
periods = {
0: pd.date_range('1/1/2013', periods=8760, freq='H'),
1: pd.date_range('1/1/2014', periods=8760, freq='H'),
}
my_energysystem = solph.EnergySystem(timeindex=my_index, periods=periods)

This seems to be outdated (I think a list should be used instead), as I get error AttributeError: 'int' object has no attribute 'min' in line

periods_years.append(v.min().year - start_year)

@jokochems
Copy link
Member

Thanks, @henhuy. I'll provide a fix shortly. If you have time, feel free to already do so.

@jokochems jokochems linked a pull request Oct 2, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants