Skip to content

Commit 07242ce

Browse files
committed
bump to intake-esgf to allow time filtering of files
1 parent d03d70f commit 07242ce

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

pyproject.toml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ name = "ref-sample-data"
33
version = "0.6.1"
44
description = "CMIP Rapid Evaluation Framework Sample Data"
55
readme = "README.md"
6-
authors = [
7-
{ name= "Jared Lewis", email="jared.lewis@climate-resource.com" }
8-
]
6+
authors = [{ name = "Jared Lewis", email = "jared.lewis@climate-resource.com" }]
97
requires-python = ">=3.10"
108

119
[project.license]
@@ -18,7 +16,7 @@ platforms = ["osx-arm64", "linux-64", "win-64"]
1816
[tool.pixi.dependencies]
1917
python = ">=3.10"
2018
pooch = ">=1.8.2,<2"
21-
intake-esgf = ">=2025.5.9,<2026"
19+
intake-esgf = ">=2025.5.22,<2026"
2220
matplotlib = ">=3.10.3,<4"
2321
scipy = ">=1.15.2,<2"
2422
xarray = ">=2025.1.0,<2025.2"
@@ -64,18 +62,15 @@ exclude_also = [
6462
# Don't complain about missing type checking code:
6563
"if TYPE_CHECKING",
6664
# Exclude ... literals
67-
"\\.\\.\\."
65+
"\\.\\.\\.",
6866
]
6967

7068
[tool.jupytext]
7169
formats = "ipynb,py:percent"
7270

7371
[tool.pytest.ini_options]
74-
addopts = [
75-
"--import-mode=importlib",
76-
]
77-
filterwarnings = [
78-
]
72+
addopts = ["--import-mode=importlib"]
73+
filterwarnings = []
7974

8075
# We currently check for GPL licensed code, but this restriction may be removed
8176
[tool.liccheck]

src/ref_sample_data/data_request/base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ def fetch_datasets(self) -> pd.DataFrame:
8080
"""Fetch the datasets from the ESGF."""
8181
cat = ESGFCatalog()
8282

83-
cat.search(**self.facets)
83+
opts = {}
84+
if self.time_span:
85+
opts["file_start"] = self.time_span[0]
86+
opts["file_end"] = self.time_span[1]
87+
cat.search(**(opts | self.facets))
8488
if self.remove_ensembles:
8589
cat.remove_ensembles()
8690

0 commit comments

Comments
 (0)