Skip to content

Commit

Permalink
Make source an argument for IFS, default of aws (#169)
Browse files Browse the repository at this point in the history
* Make source an argument for IFS

Signed-off-by: Luke Conibear <luke.conibear@tomorrow.io>

* Update changelog

Signed-off-by: Luke Conibear <luke.conibear@tomorrow.io>

* Updating docs to point people to ecmwf docs

---------

Signed-off-by: Luke Conibear <luke.conibear@tomorrow.io>
Co-authored-by: Nicholas Geneva <5533524+NickGeneva@users.noreply.github.com>
  • Loading branch information
luke-conibear and NickGeneva authored Dec 20, 2024
1 parent 4000de1 commit c2311c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Switched HRRR data source back to AWS grib
- Make source an argument for IFS, default of aws

### Deprecated

Expand Down
7 changes: 5 additions & 2 deletions earth2studio/data/ifs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class IFS:
Parameters
----------
source : str, optional
Data source to fetch data from. For possible options refer to ECMWF's open data
Python SDK, by default "aws".
cache : bool, optional
Cache data source on local memory, by default True
verbose : bool, optional
Expand Down Expand Up @@ -75,7 +78,7 @@ class IFS:
IFS_LAT = np.linspace(90, -90, 721)
IFS_LON = np.linspace(0, 359.75, 1440)

def __init__(self, cache: bool = True, verbose: bool = True):
def __init__(self, source: str = "aws", cache: bool = True, verbose: bool = True):
# Optional import not installed error
if opendata is None:
raise ImportError(
Expand All @@ -84,7 +87,7 @@ def __init__(self, cache: bool = True, verbose: bool = True):

self._cache = cache
self._verbose = verbose
self.client = opendata.Client(source="azure")
self.client = opendata.Client(source=source)

def __call__(
self,
Expand Down

0 comments on commit c2311c9

Please sign in to comment.