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

update cds to cds-beta in weather-dl. #472

Merged
merged 6 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ on:
workflow_dispatch:

env:
CDSAPI_URL: https://cds.climate.copernicus.eu/api/v2
CDSAPI_KEY: 12345:1234567-ab12-34cd-9876-4o4fake90909 # A fake key for testing

CDSAPI_URL: https://cds-beta.climate.copernicus.eu/api
CDSAPI_KEY: 1234567-ab12-34cd-9876-4o4fake90909 # A fake key for testing
jobs:
build:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion ci3.8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ channels:
dependencies:
- python=3.8.13
- apache-beam=2.40.0
- cdsapi=0.5.1
- pytest=7.2.0
- pytest-subtests=0.8.0
- cfgrib=0.9.10.2
Expand Down Expand Up @@ -37,4 +36,5 @@ dependencies:
- pip:
- cython==0.29.34
- earthengine-api==0.1.329
- git+https://github.com/dabhicusp/cdsapi-beta-google-weather-tools.git@master#egg=cdsapi # TODO([#474](https://github.com/google/weather-tools/issues/474)): Compatible cdsapi with weather-dl.
- .[test]
2 changes: 1 addition & 1 deletion ci3.9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ channels:
dependencies:
- python=3.9.13
- apache-beam=2.40.0
- cdsapi=0.5.1
- pytest=7.2.0
- pytest-subtests=0.8.0
- cfgrib=0.9.10.2
Expand Down Expand Up @@ -37,4 +36,5 @@ dependencies:
- pip:
- cython==0.29.34
- earthengine-api==0.1.329
- git+https://github.com/dabhicusp/cdsapi-beta-google-weather-tools.git@master#egg=cdsapi # TODO([#474](https://github.com/google/weather-tools/issues/474)): Compatible cdsapi with weather-dl.
- .[test]
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies:
- rioxarray=0.13.4
- gdal=3.5.1
- pyproj=3.4.0
- cdsapi=0.5.1
- ecmwf-api-client=1.6.3
- eccodes=2.27.0
- cfgrib=0.9.10.2
Expand All @@ -30,6 +29,7 @@ dependencies:
- cython==0.29.34
- earthengine-api==0.1.329
- firebase-admin==6.0.1
- git+https://github.com/dabhicusp/cdsapi-beta-google-weather-tools.git@master#egg=cdsapi # TODO([#474](https://github.com/google/weather-tools/issues/474)): Compatible cdsapi with weather-dl.
- .
- ./weather_dl
- ./weather_mv
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
]

weather_dl_requirements = [
"cdsapi",
"ecmwf-api-client",
"numpy>=1.19.1",
"pandas",
Expand Down Expand Up @@ -118,6 +117,8 @@
],
python_requires='>=3.8, <3.10',
install_requires=['apache-beam[gcp]==2.40.0', 'gcsfs==2022.11.0'],
dependency_links=['https://github.com/dabhicusp/cdsapi-beta-google-weather-tools.git@master#egg=cdsapi'], # TODO([
#474](https://github.com/google/weather-tools/issues/474)): Compatible cdsapi with weather-dl.
use_scm_version=True,
setup_requires=['setuptools_scm'],
scripts=['weather_dl/weather-dl', 'weather_mv/weather-mv', 'weather_sp/weather-sp'],
Expand Down
3 changes: 2 additions & 1 deletion weather_dl/download_pipeline/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from urllib.parse import urljoin

from cdsapi import api as cds_api
from cads_api_client import legacy_api_client
import urllib3
from ecmwfapi import api

Expand Down Expand Up @@ -73,7 +74,7 @@ def license_url(self):
pass


class SplitCDSRequest(cds_api.Client):
class SplitCDSRequest(legacy_api_client.LegacyApiClient):
"""Extended CDS class that separates fetch and download stage."""
@retry_with_exponential_backoff
def _download(self, url, path: str, size: int) -> None:
Expand Down
5 changes: 3 additions & 2 deletions weather_dl/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
]

base_requirements = [
"cdsapi==0.5.1",
"ecmwf-api-client==1.6.3",
"numpy>=1.19.1",
"pandas==1.5.1",
Expand All @@ -48,10 +47,12 @@
setup(
name='download_pipeline',
packages=find_packages(),
version='0.1.20',
version='0.1.21',
author='Anthromets',
author_email='[email protected]',
url='https://weather-tools.readthedocs.io/en/latest/weather_dl/',
description='A tool to download weather data.',
install_requires=beam_gcp_requirements + base_requirements,
dependency_links=['https://github.com/dabhicusp/cdsapi-beta-google-weather-tools.git@master#egg=cdsapi'], # TODO([
#474](https://github.com/google/weather-tools/issues/474)): Compatible cdsapi with weather-dl.
)
3 changes: 2 additions & 1 deletion weather_dl_v2/license_deployment/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from urllib.parse import urljoin

from cdsapi import api as cds_api
from cads_api_client import legacy_api_client
import urllib3
from ecmwfapi import api

Expand Down Expand Up @@ -75,7 +76,7 @@ def license_url(self):
pass


class SplitCDSRequest(cds_api.Client):
class SplitCDSRequest(legacy_api_client.LegacyApiClient):
"""Extended CDS class that separates fetch and download stage."""

@retry_with_exponential_backoff
Expand Down
2 changes: 1 addition & 1 deletion weather_dl_v2/license_deployment/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ channels:
dependencies:
- python=3.10
- geojson
- cdsapi=0.5.1
- ecmwf-api-client=1.6.3
- pip=22.3
- pip:
Expand All @@ -16,3 +15,4 @@ dependencies:
- xarray
- apache-beam[gcp]
- firebase-admin
- git+https://github.com/dabhicusp/cdsapi-beta-google-weather-tools.git@master#egg=cdsapi # TODO([#474](https://github.com/google/weather-tools/issues/474)): Compatible cdsapi with weather-dl.
Loading