mikeio icon indicating copy to clipboard operation
mikeio copied to clipboard

add time property to mikeio.open and add test

Open mohm-dhi opened this issue 3 years ago • 6 comments

It was often that we only need all the datetimes in the file without reading the entire file or any item. I just add that property

mohm-dhi avatar Jul 13 '22 15:07 mohm-dhi

Great idea - I have thinking about the same. We just need it on dfs0, 1, 2, and 3 also for consistency. At least in dfs0, we should handle non-equidistant time axis also.

jsmariegaard avatar Jul 28 '22 05:07 jsmariegaard

And another thing I noticed: the time property should be a pd.DatetimeIndex to be consistent with the time property of Dataset/DataArray 👍

jsmariegaard avatar Aug 01 '22 09:08 jsmariegaard

@jsmariegaard I am sorry, I was very busy that could not work on this. I hope to find some time next week to make the necessary changes.

mohm-dhi avatar Aug 03 '22 12:08 mohm-dhi

Great. No rush.

jsmariegaard avatar Aug 03 '22 15:08 jsmariegaard

pd.DatetimeIndex

output datetimes are in pd.DatetimeIndex, I added an assert to check for that too.

mohm-dhi avatar Aug 12 '22 19:08 mohm-dhi

Great idea - I have thinking about the same. We just need it on dfs0, 1, 2, and 3 also for consistency. At least in dfs0, we should handle non-equidistant time axis also.

I just added the time property to dfs0 equidistant and non-equidistant time axis, will do the dfs 1, 2 and 3 later

mohm-dhi avatar Aug 12 '22 19:08 mohm-dhi