spine-tools / SpineInterface.jl

A package to interact with Spine databases from a Julia session
http://www.spine-model.org
GNU Lesser General Public License v3.0
8 stars 4 forks source link

The `ignore_year` option causes problems #27

Open spine-o-bot opened 3 years ago

spine-o-bot commented 3 years ago

In GitLab by @Tasqu on Oct 16, 2019, 08:14

The ignore year option doesn't work as it was probably intended, nor am I sure if it ever can. The current implementation seems to simply "remove" the year from the time series data, reducing the year to zero. However, year zero is a leap year, while the timeseries data tagged in Spine Toolbox as ignore year can be entered for a normal year as well. This is kind of an issue with datetimes, since you cannot use timeseries for leap years for non-leap years or vice versa.

For example, I had a case where I used time series data from 2013 (not a leap year) tagged as ignore year. This resulted in the interface reducing the data to match year 0 (a leap year), which in turn resulted in data for the day 2013-03-01 being interpreted as data for the day 0000-02-29 instead, and so on. Since Spine Model operates on datetime stamps for an actual year (in my case 2013), however, the data for the day 0000-02-29 is skipped, resulting in all time series data becoming displaced by one day in the model.

spine-o-bot commented 3 years ago

In GitLab by @manuelma on Nov 11, 2019, 11:36

assigned to @manuelma

spine-o-bot commented 3 years ago

In GitLab by @manuelma on Nov 11, 2019, 11:37

I don't immediately see a solution but we could try something like 'normalizing' to a different year than zero, a leap year in your above example... How don't know if this works though...

Tasqu commented 3 years ago

The ignore_year option also causes issues for time-dependent data arithmetic. See further discussion in the wiki.

In the long run, I feel like we should redo a lot of the time-dependent data stuff we currently have, but I don't know when we'll have the opportunity to do so...