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 stamp error #20

Closed
sebourban opened this issue Mar 2, 2024 · 1 comment
Closed

Time stamp error #20

sebourban opened this issue Mar 2, 2024 · 1 comment

Comments

@sebourban
Copy link

Hello,

I tried loading a geometry file using

import xarray as xr
ds = xr.open_dataset("geo.slf", engine="selafin")

and I get the following error message:

Traceback (most recent call last):
  File "/home/sebourban/opentelemac/test.py", line 2, in <module>
    ds = xr.open_dataset("geom_world06_stb.slf", engine="selafin")
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sebourban/opentelemac/bin/miniforge/envs/otm-env/lib/python3.12/site-packages/xarray/backends/api.py", line 573, in open_dataset
    backend_ds = backend.open_dataset(
                 ^^^^^^^^^^^^^^^^^^^^^
  File "/home/sebourban/opentelemac/bin/miniforge/envs/otm-env/lib/python3.12/site-packages/xarray_selafin/xarray_backend.py", line 272, in open_dataset
    times = [datetime(*slf.header.date) + timedelta(seconds=t) for t in slf.time]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: datetime.datetime() argument after * must be an iterable, not NoneType

When I try on a time varying file I get :
Format "" is unknown and is forced to "SERAFIN "
but maybe this is OK - just a little odd to confirm that I have a SERAFIN when I know I do ..

You probably know the answer already ? thanks for looking into it.
Sébastien.

@tomsail tomsail closed this as completed in 0c0b3fc Mar 4, 2024
tomsail added a commit that referenced this issue Mar 4, 2024
@tomsail
Copy link
Contributor

tomsail commented Mar 4, 2024

@sebourban
try to pip install xarray-selafin again and let us know if your problem was solved with the latest fix
check maybe if you have the right version: it should be 0.1.4

so to be sure:
pip install xarray-selafin==0.1.4

@tomsail tomsail reopened this Mar 4, 2024
@tomsail tomsail closed this as completed Oct 16, 2024
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

2 participants