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

RuntimeError: Unable to load latest weather data for GFS #205

Closed
git-akihakune opened this issue Jul 28, 2022 · 11 comments · Fixed by #374
Closed

RuntimeError: Unable to load latest weather data for GFS #205

git-akihakune opened this issue Jul 28, 2022 · 11 comments · Fixed by #374
Assignees
Labels
Bug Something isn't working Environment Enviroment Class related features

Comments

@git-akihakune
Copy link

Describe the bug

Running the code in Colab Notebook preview led to an error.

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
[<ipython-input-17-71fdef7bdc29>](https://localhost:8080/#) in <module>()
----> 1 Env.setAtmosphericModel(type="Forecast", file="GFS")

[/usr/local/lib/python3.7/dist-packages/rocketpy/Environment.py](https://localhost:8080/#) in setAtmosphericModel(self, type, file, dictionary, pressure, temperature, wind_u, wind_v)
    935                 if not success:
    936                     raise RuntimeError(
--> 937                         "Unable to load latest weather data for GFS through " + file
    938                     )
    939             elif file == "FV3":

RuntimeError: Unable to load latest weather data for GFS through https://nomads.ncep.noaa.gov/dods/gfs_0p25/gfs20220717/gfs_0p25_06z

To Reproduce

Just run the default code in the preview.

Expected behavior

It's expected to run the demo smoothly.

Screenshots

image

Additional context

Checking the GrADS Data Server, indeed, I'm currently not seeing any "gfs20220717" dir. Maybe fixing the link can solve this issue.

@giovaniceotto
Copy link
Member

giovaniceotto commented Jul 28, 2022

@git-akihakune Thanks for letting us know that you are having an issue. We recently became aware of this and it seems to be a problem relating the netCDF4 library and Colab.

We have not been able to reproduce the error locally so far. I will perform further investigations and let you know.

Regarding you not seeing the any "gfs20220717", this is because RocketPy tries to retrieve data from each day up until 10 days in the past. This is done so that previous forecasts can be retrieved in case there is a temporary problem with GFS.

@giovaniceotto
Copy link
Member

I have just confirmed that running on a linux server (GitHub Codespaces) works properly. It really seems to be a problem specific to Google Colab.

Furthermore, I have tested a simple netCDF4 example using Colab and also got an error. You can see the example here: https://colab.research.google.com/drive/17juZulxoz8sahoDJVuU4uOMSnBC_xXDA?usp=sharing

On other systems, the example runs fine.

This maybe a related issue: Unidata/netcdf4-python#753

@giovaniceotto
Copy link
Member

I have created a new issue on netCDF4's repo for us to track while we investigate this: Unidata/netcdf4-python#1179

@giovaniceotto
Copy link
Member

@git-akihakune I found a quick workaraound: installing an earlier version of netCDF4 solves the problem for me.

You can try by running !pip install "netCDF4<1.6.0" in Colab and checking if it also solves your issue.

@git-akihakune
Copy link
Author

The workaround was great. I've tested on a few different Colab notebooks and no error was reported.

As for this issue, I suggest leaving it open until the problem is entirely solved.

@Gui-FernandesBR
Copy link
Member

As for this issue, I suggest leaving it open until the problem is entirely solved.

Agreed!!

@Gui-FernandesBR Gui-FernandesBR added the Bug Something isn't working label Sep 5, 2022
@Gui-FernandesBR Gui-FernandesBR added the Environment Enviroment Class related features label Sep 21, 2022
@Gui-FernandesBR Gui-FernandesBR removed this from the RocketPy at EuroC 2022 milestone Oct 4, 2022
@OliverKillane
Copy link

Env.setAtmosphericModel(type='Forecast', file='GFS', dictionary='NOAA')

Having the same problem here:

With netCDF4-1.6.1 the same error (date in url different)

With netcdf4-1.5.8 it works

@Gui-FernandesBR
Copy link
Member

Everything seems to be working now,

@giovaniceotto shall we close this one or wait for a resolution on Unidata/netcdf4-python#753 ?

imo we can already close

@giovaniceotto giovaniceotto pinned this issue Oct 25, 2022
@giovaniceotto
Copy link
Member

The issue we are tracking is actually Unidata/netcdf4-python#1179

Yes, let's leave it open until the problem is fully resolved.

@Gui-FernandesBR Gui-FernandesBR unpinned this issue Nov 3, 2022
@Gui-FernandesBR Gui-FernandesBR linked a pull request Jun 9, 2023 that will close this issue
5 tasks
@Gui-FernandesBR
Copy link
Member

The issue we are tracking is actually Unidata/netcdf4-python#1179

Yes, let's leave it open until the problem is fully resolved.

It seems like the referred issue is going to be closed in the short-term future, just waiting for someone else to confirm that the netcdf4==1.6.4 version addressed the problem. I can confirm it is running without errors on colab (which now has default python 3.10)

@Gui-FernandesBR
Copy link
Member

Solved, everything is running on rocketpy==1.0.0 and above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Environment Enviroment Class related features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants