Skip to content

Commit 4c8108e

Browse files
committed
chore: Flush file
1 parent 4c5a962 commit 4c8108e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

changelog/354.fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Removes ERA5 ta dataset from obs4REF in preference for obs4MIP

src/ref_sample_data/data_request/obs4ref.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ def fetch_datasets(self) -> pd.DataFrame:
5555
response = requests.get(registry_url, timeout=30)
5656
response.raise_for_status()
5757
with tempfile.NamedTemporaryFile(mode="w", encoding="utf-8") as tmpfile:
58+
# Write the registry to a temporary file
5859
tmpfile.write(response.text)
60+
tmpfile.flush()
61+
logger.debug(f"Downloaded {tmpfile.name}: {response.text.count(os.linesep)} lines")
62+
63+
# Load the registry from the temporary file
5964
registry.load_registry(tmpfile.name)
6065
logger.info(f"Loaded dataset registry from {registry_url}: {len(registry.registry)} entries")
6166
datasets = []

0 commit comments

Comments
 (0)