Skip to content

fetch_forecast fails silently #20

@jamesthesken

Description

@jamesthesken

Looking into the examples, I'm having a tough time getting fetch_forecast.py running successfully.

My environment:

Python 3.11.3
requests==2.31.0
urllib3==2.0.3
matplotlib==3.7.2
numpy==1.25.0

Running

$ python3 fetch_forecast.py

Fetching GFS Wave Data
Failed to fetch wave forecast data

Some steps I took to debug:

Cloned the grippy repository and installed in my conda environment.

I came across a warning

Failed to download https://noaa-gfs-bdp-pds.s3.amazonaws.com/gfs.20230713/18/wave/gridded/gfswave.t18z.atlocn.0p16.f000.grib2: Retry.__init__() got an unexpected keyword argument 'method_whitelist'

Which prompted me to upgrade requests and urllib3 to the latest versions and modify tools.py:

# method_whitelist deprecated in favor of allowed_methods
def retry_session(retries=1):
    session = requests.Session()
    retries = Retry(total=retries,
                backoff_factor=0.1,
                status_forcelist=[500, 502, 503, 504],
                allowed_methods=frozenset(['GET', 'POST']))

    session.mount('https://', HTTPAdapter(max_retries=retries))
    session.mount('http://', HTTPAdapter(max_retries=retries))
    return session

What package versions are working for you? I would love to help document and assist with this project where possible.

Thank you for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions