NOAA-ORR-ERD / gridded

A single API for accessing / working with gridded model results on multiple grid types
https://noaa-orr-erd.github.io/gridded/index.html
The Unlicense
64 stars 14 forks source link

"No filename or dataset provided" on 0.3.4 #72

Open moisespr123 opened 1 year ago

moisespr123 commented 1 year ago

Hi,

I have been experimenting again with PyGnome and it seems something broke when I upgraded gridded to the latest release.

I'm now getting the following error:

...
 File "/PyGnome/py_gnome/gnome/environment/gridded_objects_base.py", line 546, in from_netCDF
    return super().from_netCDF(*args, **kwargs)
  File "/venv/lib64/python3.6/site-packages/gridded-0.3.4-py3.6.egg/gridded/variable.py", line 914, in from_netCDF
    grid_topology=grid_topology)
  File "/PyGnome/py_gnome/gnome/environment/gridded_objects_base.py", line 364, in from_netCDF
    return gridded.grids.Grid.from_netCDF(*args, **kwargs)
  File "/venv/lib64/python3.6/site-packages/gridded-0.3.4-py3.6.egg/gridded/grids.py", line 478, in from_netCDF
    raise ValueError('No filename or dataset provided')
ValueError: No filename or dataset provided

Reverting back to 0.3.3-dev0 (Commit dcd86483c6d0f16b8ffdb2b6412199f63fe94239) seems to allow PyGnome to run successfully with the NetCDF mover files.

These NetCDF files are as simple as they can be. This makes me wonder if I should be adding some specific metadata to the files or variables in order to allow them to run with the latest gridded library code?

Thanks!

PS. I've been using gs.PyWindMover('wind_mover_file.nc') and gs.PyCurrentMover('current_mover_file.nc'). to load the mover files into PyGnome and I believe this is where the gridded issue is happening based on the traceback I get.

ChrisBarker-NOAA commented 1 year ago

Maybe, but I think you've found a bug, the latest gridded should work with the same files it did before.

Can you post the netcdf file somewhere? or just the header here:

ncdump -h the_file_name.nc

Also more of the traceback might be helpful.

Finally -- be sure to update to the latest PyGNOME main branch.