Version Checks (indicate both or one)
Issue Description
The snapshots configuration section has the inclusive argument. In combination with the defaults, it is confusing:
e.g.
snapshots:
start: "2019-01-01"
end: "2020-01-01"
inclusive: left
Gives us a full year:
DatetimeIndex(['2019-01-01 00:00:00', '2019-01-01 01:00:00',
'2019-01-01 02:00:00', '2019-01-01 03:00:00',
'2019-01-01 04:00:00', '2019-01-01 05:00:00',
'2019-01-01 06:00:00', '2019-01-01 07:00:00',
'2019-01-01 08:00:00', '2019-01-01 09:00:00',
...
'2019-12-31 14:00:00', '2019-12-31 15:00:00',
'2019-12-31 16:00:00', '2019-12-31 17:00:00',
'2019-12-31 18:00:00', '2019-12-31 19:00:00',
'2019-12-31 20:00:00', '2019-12-31 21:00:00',
'2019-12-31 22:00:00', '2019-12-31 23:00:00'],
dtype='datetime64[ns]', length=8760, freq=None)
However
snapshots:
start: "2019-01-01"
end: "2020-01-01"
inclusive: right
doesn't give us 2019-01-02 until 2020-01-01, but only excludes the first hour for 2019-01-01 and includes only the first hour of 2020-01-01:
DatetimeIndex(['2019-01-01 01:00:00', '2019-01-01 02:00:00',
'2019-01-01 03:00:00', '2019-01-01 04:00:00',
'2019-01-01 05:00:00', '2019-01-01 06:00:00',
'2019-01-01 07:00:00', '2019-01-01 08:00:00',
'2019-01-01 09:00:00', '2019-01-01 10:00:00',
...
'2019-12-31 15:00:00', '2019-12-31 16:00:00',
'2019-12-31 17:00:00', '2019-12-31 18:00:00',
'2019-12-31 19:00:00', '2019-12-31 20:00:00',
'2019-12-31 21:00:00', '2019-12-31 22:00:00',
'2019-12-31 23:00:00', '2020-01-01 00:00:00'],
dtype='datetime64[ns]', length=8760, freq=None)
In my mind, the following two configuration options should behave identically:
# Option 1
snapshots:
start: "2019-01-01"
end: "2020-01-01"
inclusive: left
and
# Option 2
snapshots:
start: "2019-01-01"
end: "2019-12-31"
inclusive: both
But they don't.
Option 1 covers the full year of 2019.
Option 2 covers the year of 2019 except for 2019-12-31, where it only includes 2019-12-31 00:00:00 and excludes the rest of the day.
The problem here is either documentation of the default configuration entry.
There is the implicit assumption that the day specified in the config refers to the start of the day,
whilst logically left should indicate the start of the day, right the end of the dayandboththe start of thestart timestamp and the end of theend` timestamp.
It would be cleaner to use the hour of the day in the configuration as well.
Then the inclusive option works as designed and
snapshots:
start: "2019-01-01 00:00:00"
end: "2020-01-01 00:00:00"
inclusive: left
becomes identical to
snapshots:
start: "2019-01-01 00:00:00"
end: "2019-12-31 23:00:00"
inclusive: left
Reproducible Example
Expected Behavior
see above
Installed Versions
Details
Replace this line.
Version Checks (indicate both or one)
I have confirmed this bug exists on the lastest release of PyPSA-Eur.
I have confirmed this bug exists on the current
masterbranch of PyPSA-Eur.Issue Description
The
snapshotsconfiguration section has theinclusiveargument. In combination with the defaults, it is confusing:e.g.
Gives us a full year:
However
doesn't give us 2019-01-02 until 2020-01-01, but only excludes the first hour for
2019-01-01and includes only the first hour of2020-01-01:In my mind, the following two configuration options should behave identically:
and
But they don't.
Option 1 covers the full year of 2019.
Option 2 covers the year of 2019 except for
2019-12-31, where it only includes2019-12-31 00:00:00and excludes the rest of the day.The problem here is either documentation of the default configuration entry.
There is the implicit assumption that the day specified in the config refers to the start of the day,
whilst logically
leftshould indicate the start of the day,rightthe end of the dayandboththe start of thestarttimestamp and the end of theend` timestamp.It would be cleaner to use the hour of the day in the configuration as well.
Then the
inclusiveoption works as designed andbecomes identical to
Reproducible Example
Expected Behavior
see above
Installed Versions
Details
Replace this line.