ojpv commited on
Commit
2602fc0
·
verified ·
1 Parent(s): 3ab5cae

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -4
README.md CHANGED
@@ -97,7 +97,7 @@ This dataset is distributed as **NetCDF-4** files. There are two common ways to
97
 
98
  ### Option 1 (recommended): clone the ClimX code and use the helper loader
99
 
100
- The ClimX repository already includes a helper module (`src/data/climx_hf.py`) that allows you to download the dataset from Hugging Face and open it as three lazily-loaded “virtual” xarray datasets:
101
 
102
  ```bash
103
  git clone https://github.com/IPL-UV/ClimX.git
@@ -106,13 +106,15 @@ pip install -U "huggingface-hub" xarray netcdf4 dask
106
  ```
107
 
108
  ```python
109
- from src.data.climx_hf import download_climx_from_hf, open_climx_virtual_datasets
 
110
 
111
  # Download NetCDF artifacts from HF into a local cache directory.
112
- root = download_climx_from_hf("/path/to/hf_cache", variant="full")
 
113
 
114
  # Open as three virtual datasets (lazy / dask-friendly).
115
- ds = open_climx_virtual_datasets(root, variant="full") # or "lite"
116
 
117
  ds.hist # historical (targets + forcings)
118
  ds.train # projections training scenarios (targets + forcings; excludes `ssp245` scenario)
 
97
 
98
  ### Option 1 (recommended): clone the ClimX code and use the helper loader
99
 
100
+ The ClimX repository includes a helper module (`src/utils/hugging_face_utils.py`) that downloads the requested dataset variant from Hugging Face and opens it as three lazily-loaded “virtual” xarray datasets. Use Python 3.10 or newer:
101
 
102
  ```bash
103
  git clone https://github.com/IPL-UV/ClimX.git
 
106
  ```
107
 
108
  ```python
109
+ from pathlib import Path
110
+ from src.utils.hugging_face_utils import get_dataset_from_hf, open_climx_virtual_datasets
111
 
112
  # Download NetCDF artifacts from HF into a local cache directory.
113
+ root = Path("/path/to/hf_cache")
114
+ get_dataset_from_hf(root, variant="full")
115
 
116
  # Open as three virtual datasets (lazy / dask-friendly).
117
+ ds = open_climx_virtual_datasets(root, variant="full") # or "lite"
118
 
119
  ds.hist # historical (targets + forcings)
120
  ds.train # projections training scenarios (targets + forcings; excludes `ssp245` scenario)