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

Time-invariant file ignores freq #315

Open
ecomodeller opened this issue Apr 26, 2022 · 0 comments
Open

Time-invariant file ignores freq #315

ecomodeller opened this issue Apr 26, 2022 · 0 comments

Comments

@ecomodeller
Copy link
Member

Describe the bug
Time-invariant file ignores freq. In a file with a single timestep, dt is perhaps not as important as in a multistep file, but is still available in the file, but is currently set to 1s, despite the freq in the pandas DatetimeIndex

To Reproduce

Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> import numpy as np
>>> import mikeio
>>> da = mikeio.DataArray(data=np.zeros((1,10),dtype=float), geometry=mikeio.Grid1D(n=10,dx=0.1), time=pd.date_range(start="1970", freq='D', periods=1))
>>> da
<mikeio.DataArray>
name: NoName
dims: (time:1, x:10)
time: 1970-01-01 00:00:00 (time-invariant)
geometry: Grid1D (n=10, dx=0.1)
>>> da.to_dfs("single_timestep.dfs1")

Expected behavior
Time Step (sec) == 86400 1 day

Screenshots
image

System information:

  • Python 3.9.6
  • MIKEIO 0.10.a.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant