Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
3d35329
Adding a new testing file for PR
Dec 2, 2025
dcacdd8
Merge pull request #1 from KULcoder/data-tests
KULcoder Dec 2, 2025
d1b75d9
A commit to check test
Dec 2, 2025
9dddcfe
fix: Debug Update test_dataset_comprehensive.py
KULcoder Dec 2, 2025
4c8073c
Merge pull request #2 from KULcoder/data-tests
KULcoder Dec 2, 2025
aa043d6
fix: modify the test file, such that it allows the tolerance for xr.s…
KULcoder Dec 2, 2025
991de7e
Merge pull request #3 from KULcoder/data-tests
KULcoder Dec 2, 2025
511cba1
test: adding a test_era5_wind3d test to ensures wind3d workflow
KULcoder Dec 3, 2025
7dc5fd0
fix: trying to check why RuntimeError: Unspecified error in H5DSget_…
KULcoder Dec 3, 2025
f80c953
fix: remove unuseful test (.prepare(), where do we need this function?)
KULcoder Dec 3, 2025
8074b93
fix: correct turbine name
KULcoder Dec 3, 2025
5e92282
fix: trying to make the flow smooth
KULcoder Dec 3, 2025
d398091
fix: trying to ensure the interpolate flow behave correctly
KULcoder Dec 3, 2025
b3c1816
fix: trying to ensure the interpolate flow behave correctly: modify _…
KULcoder Dec 3, 2025
df7c540
Revert "fix: trying to make the flow smooth"
KULcoder Dec 3, 2025
187d31c
Revert "fix: trying to ensure the interpolate flow behave correctly: …
KULcoder Dec 3, 2025
3f0a2d3
Revert "fix: trying to ensure the interpolate flow behave correctly"
KULcoder Dec 3, 2025
403acda
Adding a simple file to check for possible errors
KULcoder Dec 3, 2025
c41d17a
fix: deal with client
KULcoder Dec 3, 2025
15968fa
fix: add download
KULcoder Dec 3, 2025
12016dc
fix: add my download path
KULcoder Dec 3, 2025
4266a8e
fix: use general source of dataset
KULcoder Dec 3, 2025
257744f
fix: moving path setting to the top
KULcoder Dec 3, 2025
5748222
fix: finish the test file at least on TSCC
KULcoder Dec 3, 2025
27f6f1b
Testing on the if previous errors
KULcoder Dec 3, 2025
f20a585
Revert "Testing on the if previous errors"
KULcoder Dec 3, 2025
a6fda0b
fix: solve the bug appears in model.prepare stage
Dec 3, 2025
5ad4218
fix: improve the new test file to fulfill the lint requirement
Dec 3, 2025
cef9158
fix: delete not useful file
Dec 3, 2025
715fe65
fix: fixing linux opening h5netcdf error
KULcoder Dec 3, 2025
e6646e4
fix: continuing fixing linux opening h5netcdf error
KULcoder Dec 3, 2025
6ef404e
fix: lint style fix
KULcoder Dec 3, 2025
4e4fb4b
feat: enable debugging methods used for testing
KULcoder Dec 3, 2025
f8d9de5
fix: fix daily.py and monthly.py for the h5dsget_num_scales issue
KULcoder Dec 3, 2025
6125e4b
fix: modify gitignore
KULcoder Dec 4, 2025
9a573c7
feat: refactor the era5 to reverse the order
KULcoder Dec 4, 2025
677c1ff
fix: small bug fixes on the inter connections in era5
KULcoder Dec 4, 2025
d6c547e
feat: adding specific prepare function for wind-solar, adding some ce…
KULcoder Dec 4, 2025
b8df0f5
fix: solving could not load types.PathLike: change to absolute path
KULcoder Dec 4, 2025
5fadadf
fix: lint style fix
KULcoder Dec 4, 2025
5460f71
Merge pull request #4 from KULcoder/reorg-dataset
KULcoder Dec 4, 2025
18a60bd
feat: new branch trying to reimplement the pvlib into dataset refacto…
KULcoder Dec 19, 2025
54fa725
fix: implement a abstract method
KULcoder Dec 19, 2025
7b22478
fix: renaming longtitude/latitude to x/y for slicing
KULcoder Dec 19, 2025
1d3c60f
fix: make pvlib model to use h5netcdf engine only
KULcoder Dec 19, 2025
8c3fc4c
fix: naming issue: for humidity calculation, move from ds.d2m to ds.d…
KULcoder Dec 19, 2025
a9c0a1c
fix: adding dewpoint_temperature back into the processed dataset
KULcoder Dec 19, 2025
4f759dd
feat: add timing functions and testing
KULcoder Dec 19, 2025
ae70b5d
fix: modify hourly / monthly wind-solar download file with default en…
KULcoder Dec 19, 2025
9fdd339
fix: also modify the save engine
KULcoder Dec 19, 2025
68cbb92
fix: modify the engine in the base dataset object: h5netcdf for wind-…
KULcoder Dec 20, 2025
4de098f
feat: adding the parallelism for pvlib coordinate processing
KULcoder Dec 22, 2025
84d979f
fix: fix the logic in detecing cpus and prioritize slurm in detection
KULcoder Dec 23, 2025
b6551ff
feat: adding the testing file for era5-windsolar workflow
KULcoder Jan 8, 2026
583ddb5
fix: fix some lint errors
KULcoder Jan 8, 2026
5c1df1f
fix: make the testing flag working correctly for era5-windsolar-hourl…
KULcoder Jan 9, 2026
eb4568a
fix: choose a subset of coordinates that is meaningful
KULcoder Jan 10, 2026
61328c7
fix: disable merra2 tests for debugging usage
KULcoder Jan 10, 2026
d1d5aef
fix: fix the version numbers of all dependencies
KULcoder Jan 13, 2026
96cd3e5
fix: fixing the pyproject dependencies with the download flag
KULcoder Jan 13, 2026
6e37272
Revert "fix: fixing the pyproject dependencies with the download flag"
KULcoder Jan 14, 2026
9f9f244
Revert "fix: fix the version numbers of all dependencies"
KULcoder Jan 14, 2026
998b984
fix: remove netcdf4 support
KULcoder Jan 14, 2026
3b16626
fix: continue to remove the netcdf4 support and turn everything into …
KULcoder Jan 15, 2026
7d79464
fix: ensure h5netcdf for wind-3d, also add file sync mechanism to wai…
KULcoder Jan 15, 2026
28fcde3
Merge pull request #5 from KULcoder/integrate-pvlib-new
KULcoder Jan 15, 2026
d281b6b
fix: move the cdsapi from optional to neccessary pacakge
KULcoder Feb 4, 2026
6de703d
Merge pull request #6 from KULcoder/integrate-pvlib-new
KULcoder Feb 4, 2026
f7f0d29
feat: adding the pvlib documentation into the documentation
KULcoder Feb 6, 2026
4fb12da
feat: adding a some code in calculation for pvlib to debug zero size …
KULcoder Feb 6, 2026
15905b4
feat: adding a some code in calculation for pvlib to debug zero size …
KULcoder Feb 6, 2026
4295da5
fix: update the debug method for for zenith val check
KULcoder Feb 6, 2026
caf3e4a
fix: add a new method to allow a more flexible xs, ys range selection
KULcoder Feb 6, 2026
b0a104b
fix: update the new method to allow a more flexible xs, ys range sele…
KULcoder Feb 7, 2026
4e1be0f
Merge pull request #7 from KULcoder/integrate-pvlib-new
KULcoder Feb 10, 2026
df34a30
fix: trying to solve the wind model issue
KULcoder Feb 17, 2026
7584446
Revert "fix: trying to solve the wind model issue"
KULcoder Feb 18, 2026
29eb06a
fix: fixing the coordinate problem with pvlib model and the wind model
KULcoder Mar 18, 2026
37cad4b
feat: removing the dependency to for api to download dataset, using a…
KULcoder Apr 18, 2026
a6ecdba
fix: disable the CDS download feature defaultly
KULcoder Apr 18, 2026
e9ca343
Merge pull request #9 from KULcoder/integrate-pvlib-new
KULcoder Apr 20, 2026
dad4ddb
feat: adding a compact output parameter for pvlib estimate, to remove…
KULcoder Apr 20, 2026
dd7bfd9
Merge pull request #10 from KULcoder/integrate-pvlib-new
KULcoder Apr 20, 2026
51fc551
fix: debugging the sequential bug for x/y order for the wind-interpol…
KULcoder Apr 20, 2026
e9a2a58
Merge pull request #11 from KULcoder/integrate-pvlib-new
KULcoder Apr 20, 2026
a4c68e3
feat: implement xarray-based masking workflow and migration plan
KULcoder Apr 23, 2026
f9381a5
refactor: streamline imports and remove unused functions in cutout.py
KULcoder Apr 23, 2026
e71625c
Merge pull request #12 from KULcoder/integrate-pvlib-new
KULcoder Apr 24, 2026
a06fe6f
feat: enhance mask module with in-memory layer support and improved d…
KULcoder Jun 3, 2026
a612687
Merge pull request #13 from KULcoder/integrate-pvlib-new
KULcoder Jun 3, 2026
6bbd77d
docs: update documentation structure and introduce legacy workflow
KULcoder Jun 3, 2026
529a19e
docs: update modeling documentation to reflect recent API changes
KULcoder Jun 3, 2026
0711d38
docs: add xarray_mask_tutorial notebook and update references
KULcoder Jun 4, 2026
1815481
docs: enhance wind modeling documentation for capacity factor estimation
KULcoder Jun 4, 2026
46f2c8b
docs: update documentation for MERRA2 and legacy workflows
KULcoder Jun 4, 2026
fc75956
docs: update Read the Docs configuration and version handling
KULcoder Jun 4, 2026
d00b371
docs: reorganize mask documentation and update references
KULcoder Jun 4, 2026
96e182c
docs: update ERA5 dataset documentation for clarity and workflow
KULcoder Jun 4, 2026
ac92f5c
docs: update wind modeling documentation and remove extrapolation tut…
KULcoder Jun 4, 2026
384cabc
docs: update documentation structure and remove obsolete ERA5 outputs
KULcoder Jun 4, 2026
128ea3f
Merge pull request #14 from KULcoder/documentation
KULcoder Jun 4, 2026
307fc9b
docs: remove obsolete Jupyter notebooks from documentation
KULcoder Jun 10, 2026
80d8036
Merge pull request #15 from KULcoder/documentation
KULcoder Jun 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/pr_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,14 @@ jobs:
pip install pytest
pip install setuptools
pip install -e ".[download]"
pytest tests/pr/
# Set environment variables for debugging
export PYTEST_CURRENT_TEST=1
export DASK_DISTRIBUTED__DIAGNOSTICS__NVML=False
# Run pytest with verbose output and show all logs
pytest tests/pr/ \
-v \
--tb=long \
--log-cli-level=DEBUG \
--log-cli-format="%(asctime)s [%(levelname)8s] %(name)s: %(message)s" \
--capture=no \
-s
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,6 @@ scripts/cluster

# PDM
.pdm-python

# macos specific
.DS_Store
13 changes: 6 additions & 7 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ build:
os: "ubuntu-22.04"
tools:
python: "3.12"

python:
install:
- method: pip
path: .
extra_requirements:
- docs
jobs:
# Avoid `pip install .[docs]`, which resolves geopandas, rasterio, dask, pvlib,
# etc. and often OOMs on RTD builders. Docs only need Sphinx + the source tree.
install:
- pip install -r docs/requirements.txt
- pip install --no-deps .

sphinx:
configuration: docs/source/conf.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Installation will also install the following dependencies:
* `bottleneck`
* `numexpr`
* `xarray`
* `netcdf4`
* `h5netcdf`
* `dask`
* `boto3`
* `toolz`
Expand Down
8 changes: 8 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Sphinx stack (matches pyproject [project.optional-dependencies] docs)
sphinx>=8.0.0
myst-nb>=1.1.2
sphinx-book-theme>=1.1.3
sphinx-autoapi==3.3.2

# Install geodata itself without pulling the full runtime dependency tree
# (see .readthedocs.yaml: pip install --no-deps .)
13 changes: 11 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

from geodata import __version__
import re
from pathlib import Path

# Read version without importing geodata (RTD installs with --no-deps).
_version_file = Path(__file__).resolve().parents[2] / "src" / "geodata" / "_version.py"
_release = re.search(
r'^__version__\s*=\s*["\']([^"\']+)["\']', _version_file.read_text(), re.M
)
if _release is None:
raise RuntimeError(f"Could not parse __version__ from {_version_file}")
release = _release.group(1)

project = "Geodata"
copyright = "2025, Geodata Contributors"
author = "Geodata Contributors"
release = __version__

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
124 changes: 66 additions & 58 deletions docs/source/datasets/era5.rst
Original file line number Diff line number Diff line change
@@ -1,81 +1,89 @@
ERA5 Specific Instructions
==========================

This page explains how you can set up access to ERA5 data from the `Copernicus Data Store <https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-single-levels?tab=overview>`_.
This page covers **CDS account and API credential setup** for ERA5. Once credentials
are in place, use the dataset classes — do not call ``cdsapi`` by hand for routine
downloads.

Creating a CDS account
----------------------

To download ERA5 data from the CDS, you'll need to create a free `CDS account here <https://cds.climate.copernicus.eu/>`_.

Download data through CDS API
Recommended download method
-----------------------------

Once your account has been created, set up access to the API by following these steps:
The **recommended way** to fetch ERA5 data in Geodata is:

1. Log into your CDS account and visit your `profile page <https://cds.climate.copernicus.eu/profile>`_.
2. Install the API key. There will be a section called **Personal Access Token**.
Copy these two lines into a file called ``.cdsapirc`` in your user root folder.
1. Complete the CDS setup below (one-time).
2. Follow :ref:`downloading-era5-data` in :doc:`overview` — ``load_dataset``,
instantiate with ``years`` / ``months`` / optional ``bounds``, then ``download()``.

- **macOS/Linux**: Open a terminal and run:
Geodata's ERA5 classes (for example ``ERA5Wind3DHourlyDataset``) create a
``cdsapi.Client`` internally and submit the correct product requests for each
registered ``weather_config``.

.. code-block:: bash
Creating a CDS account
----------------------

touch ~/.cdsapirc
To download ERA5 data from the CDS, create a free `CDS account here <https://cds.climate.copernicus.eu/>`_.

Then add the lines using:
Configure CDS API credentials
-----------------------------

.. code-block:: bash
Once your account exists, install local API access:

echo [line 1 of the code] >> ~/.cdsapirc
echo [line 2 of the code] >> ~/.cdsapirc
1. Log into your CDS account and visit your `profile page <https://cds.climate.copernicus.eu/profile>`_.
2. Under **Personal Access Token**, copy the two lines for your ``.cdsapirc`` file
(URL and key).

**macOS/Linux** — create ``~/.cdsapirc``:

- **Windows**: The process is slightly more complicated. Please refer to the in-depth guide at the Copernicus Knowledge Base `here <https://confluence.ecmwf.int/display/CKB/How+to+install+and+use+CDS+API+on+Windows>`_.
.. code-block:: bash

3. Install the CDS API client by opening a terminal/shell and running
touch ~/.cdsapirc
# Paste the two lines from your CDS profile into ~/.cdsapirc

.. code-block:: bash
**Windows** — see the Copernicus guide on
`installing the CDS API on Windows <https://confluence.ecmwf.int/display/CKB/How+to+install+and+use+CDS+API+on+Windows>`_.

pip install ".[download]"
Ensure ``cdsapi`` is available (it is a dependency of Geodata when you install the
package). Then proceed to :ref:`downloading-era5-data` in :doc:`overview`.

(Assuming you are in Geodata's *root directory*.)
Verify CDS API access (optional)
--------------------------------

1. Once you've installed the API key and the API client, confirm access by running an
example in a Python script or a Jupyter notebook:
You can confirm credentials with a minimal ``cdsapi`` script. This is **optional** —
Geodata dataset downloads use the same client and credentials.

.. code-block:: python

import cdsapi

c = cdsapi.Client()

c.retrieve(
"reanalysis-era5-single-levels",
{
"product_type": "reanalysis",
"format": "netcdf",
"variable": [
"2m_dewpoint_temperature",
"2m_temperature",
],
"year": "2011",
"month": [
"01",
],
"day": ["01", "02", "03"],
"time": [
"00:00",
"12:00",
],
},
"download.nc",
)

The above example downloads 2m temperature and 2m dewpoint temperature with data points
at 00:00 and 12:00 for each day, from January 1-3, 2011, in NetCDF format.

If this works, you have successfully set up access to the ERA5 data through the CDS API.
Please subsequently refer to the `general documentation on datasets <../overview.rst>`_
for more information on how to download ERA5-based datasets using the ``geodata``
package.
import cdsapi

c = cdsapi.Client()

c.retrieve(
"reanalysis-era5-single-levels",
{
"product_type": "reanalysis",
"format": "netcdf",
"variable": [
"2m_dewpoint_temperature",
"2m_temperature",
],
"year": "2011",
"month": ["01"],
"day": ["01", "02", "03"],
"time": ["00:00", "12:00"],
},
"download.nc",
)

This example fetches 2 m temperature and dewpoint at 00:00 and 12:00 UTC for
2011-01-01 through 2011-01-03. If it succeeds, your ``.cdsapirc`` is valid.

For production workflows, prefer :ref:`downloading-era5-data` in :doc:`overview` so
Geodata requests the correct ERA5 products, paths, and post-processing for
``wind_3d_hourly``, ``wind_solar_hourly``, and other registered configs.

What's next
-----------

- :ref:`downloading-era5-data` in :doc:`overview` — **recommended** download workflow
- :doc:`../development/offline-era5-fixture-datasets` — offline ``*_test`` configs for CI
- :doc:`../modeling/wind/index` or :doc:`../modeling/pvlib/index` — run models on downloaded data
Loading
Loading