-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from pangeo-forge/npz/feature/internal-integr…
…ation-fixtures Move integration testing feedstock to tests directory
- Loading branch information
Showing
11 changed files
with
127 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
tests/test-data/gpcp-from-gcs/feedstock-0.10.x-dictobj/meta.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
title: "Test meta.yaml with list of recipes" | ||
recipes: | ||
- dict_object: 'recipe:recipes' |
1 change: 1 addition & 0 deletions
1
tests/test-data/gpcp-from-gcs/feedstock-0.10.x-dictobj/recipe.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
recipes = {"test_1": "test_1", "test_2": "test_2"} |
1 change: 1 addition & 0 deletions
1
tests/test-data/gpcp-from-gcs/feedstock-0.10.x-dictobj/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pangeo-forge-recipes>=0.10.0,<0.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
title: "Global Precipitation Climatology Project" | ||
description: > | ||
Global Precipitation Climatology Project (GPCP) Daily Version 1.3 gridded, merged ty | ||
satellite/gauge precipitation Climate data Record (CDR) from 1996 to present. | ||
pangeo_forge_version: "0.9.0" | ||
pangeo_notebook_version: "2022.06.02" | ||
recipes: | ||
- id: gpcp-from-gcs | ||
object: "recipe:recipe" | ||
provenance: | ||
providers: | ||
- name: "NOAA NCEI" | ||
description: "National Oceanographic & Atmospheric Administration National Centers for Environmental Information" | ||
roles: | ||
- host | ||
- licensor | ||
url: https://www.ncei.noaa.gov/products/global-precipitation-climatology-project | ||
- name: "University of Maryland" | ||
description: > | ||
University of Maryland College Park Earth System Science Interdisciplinary Center | ||
(ESSIC) and Cooperative Institute for Climate and Satellites (CICS). | ||
roles: | ||
- producer | ||
url: http://gpcp.umd.edu/ | ||
license: "No constraints on data access or use." | ||
maintainers: | ||
- name: "Charles Stern" | ||
orcid: "0000-0002-4078-0852" | ||
github: cisaacstern | ||
bakery: | ||
id: "pangeo-ldeo-nsf-earthcube" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import apache_beam as beam | ||
import pandas as pd | ||
from pangeo_forge_recipes.patterns import ConcatDim, FilePattern | ||
from pangeo_forge_recipes.transforms import ( | ||
OpenURLWithFSSpec, | ||
OpenWithXarray, | ||
StoreToZarr, | ||
) | ||
|
||
dates = [ | ||
d.to_pydatetime().strftime("%Y%m%d") | ||
for d in pd.date_range("1996-10-01", "1999-02-01", freq="D") | ||
] | ||
|
||
|
||
def make_url(time): | ||
url_base = "https://storage.googleapis.com/pforge-test-data" | ||
return f"{url_base}/gpcp/v01r03_daily_d{time}.nc" | ||
|
||
|
||
concat_dim = ConcatDim("time", dates, nitems_per_file=1) | ||
pattern = FilePattern(make_url, concat_dim) | ||
|
||
|
||
recipe = ( | ||
beam.Create(pattern.items()) | ||
| OpenURLWithFSSpec() | ||
| OpenWithXarray( | ||
file_type=pattern.file_type, xarray_open_kwargs={"decode_coords": "all"} | ||
) | ||
| StoreToZarr( | ||
store_name="gpcp", | ||
combine_dims=pattern.combine_dim_keys, | ||
) | ||
) |
3 changes: 3 additions & 0 deletions
3
tests/test-data/gpcp-from-gcs/feedstock-0.10.x/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
gcsfs | ||
pangeo-forge-recipes>=0.10.0,<0.11 | ||
s3fs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters