Upload README.md
Browse files
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
|
| 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
|
|
|
|
| 110 |
|
| 111 |
# Download NetCDF artifacts from HF into a local cache directory.
|
| 112 |
-
root =
|
|
|
|
| 113 |
|
| 114 |
# Open as three virtual datasets (lazy / dask-friendly).
|
| 115 |
-
ds = open_climx_virtual_datasets(root, variant="full")
|
| 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)
|