rsd 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rsd-1.0.0/.github/workflows/publish.yml +88 -0
- rsd-1.0.0/.github/workflows/test.yml +46 -0
- rsd-1.0.0/.gitignore +56 -0
- rsd-1.0.0/.pre-commit-config.yaml +40 -0
- rsd-1.0.0/.readthedocs.yaml +26 -0
- rsd-1.0.0/.zenodo.json +36 -0
- rsd-1.0.0/CHANGELOG.md +59 -0
- rsd-1.0.0/CITATION.cff +46 -0
- rsd-1.0.0/CONTRIBUTING.md +78 -0
- rsd-1.0.0/LICENSE +29 -0
- rsd-1.0.0/PKG-INFO +200 -0
- rsd-1.0.0/README.md +159 -0
- rsd-1.0.0/assets/rsd_favicon.svg +22 -0
- rsd-1.0.0/assets/rsd_logo.png +0 -0
- rsd-1.0.0/assets/rsd_logo.svg +30 -0
- rsd-1.0.0/docs/api.md +98 -0
- rsd-1.0.0/docs/changelog.md +7 -0
- rsd-1.0.0/docs/citation.md +47 -0
- rsd-1.0.0/docs/examples/01_spi_basic.ipynb +314 -0
- rsd-1.0.0/docs/examples/02_ssi_bounded_xarray.ipynb +272 -0
- rsd-1.0.0/docs/examples/03_diagnostics_showcase.ipynb +473 -0
- rsd-1.0.0/docs/index.md +50 -0
- rsd-1.0.0/docs/install.md +77 -0
- rsd-1.0.0/docs/method.md +190 -0
- rsd-1.0.0/docs/quickstart.md +109 -0
- rsd-1.0.0/docs/requirements.txt +4 -0
- rsd-1.0.0/docs/stylesheets/extra.css +34 -0
- rsd-1.0.0/mkdocs.yml +100 -0
- rsd-1.0.0/pyproject.toml +87 -0
- rsd-1.0.0/src/rsd/README.md +156 -0
- rsd-1.0.0/src/rsd/__init__.py +57 -0
- rsd-1.0.0/src/rsd/_kernels.py +230 -0
- rsd-1.0.0/src/rsd/_validation.py +217 -0
- rsd-1.0.0/src/rsd/_version.py +11 -0
- rsd-1.0.0/src/rsd/_warnings.py +24 -0
- rsd-1.0.0/src/rsd/accumulation.py +78 -0
- rsd-1.0.0/src/rsd/core.py +264 -0
- rsd-1.0.0/src/rsd/defaults.py +56 -0
- rsd-1.0.0/src/rsd/deseasonalize.py +159 -0
- rsd-1.0.0/src/rsd/diagnostics.py +1142 -0
- rsd-1.0.0/src/rsd/ecdf.py +87 -0
- rsd-1.0.0/src/rsd/parametric.py +200 -0
- rsd-1.0.0/src/rsd/py.typed +0 -0
- rsd-1.0.0/src/rsd/tails.py +239 -0
- rsd-1.0.0/src/rsd/transform.py +137 -0
- rsd-1.0.0/src/rsd/xarray.py +474 -0
- rsd-1.0.0/tests/test_accumulation.py +108 -0
- rsd-1.0.0/tests/test_core.py +625 -0
- rsd-1.0.0/tests/test_defaults.py +77 -0
- rsd-1.0.0/tests/test_deseasonalize.py +154 -0
- rsd-1.0.0/tests/test_diagnostics.py +236 -0
- rsd-1.0.0/tests/test_ecdf.py +105 -0
- rsd-1.0.0/tests/test_kernels.py +170 -0
- rsd-1.0.0/tests/test_parametric.py +246 -0
- rsd-1.0.0/tests/test_tails.py +228 -0
- rsd-1.0.0/tests/test_transform.py +172 -0
- rsd-1.0.0/tests/test_xarray.py +406 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Release workflow: triggered when a version tag (vMAJOR.MINOR.PATCH) is
|
|
2
|
+
# pushed. Builds the sdist and wheel, publishes to PyPI via "trusted
|
|
3
|
+
# publishing" (OpenID Connect - no API tokens stored in the repo), and
|
|
4
|
+
# creates a corresponding GitHub Release.
|
|
5
|
+
#
|
|
6
|
+
# One-time setup on PyPI:
|
|
7
|
+
# 1. Create the project page (or use a pending publisher).
|
|
8
|
+
# 2. Add a Trusted Publisher pointing at thchilly/rsd, workflow
|
|
9
|
+
# publish.yml, environment "pypi".
|
|
10
|
+
# 3. No further configuration on the GitHub side beyond this file -
|
|
11
|
+
# the OIDC handshake authenticates the publish step automatically.
|
|
12
|
+
|
|
13
|
+
name: publish
|
|
14
|
+
|
|
15
|
+
on:
|
|
16
|
+
push:
|
|
17
|
+
tags: ["v*.*.*"]
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
build:
|
|
21
|
+
name: Build sdist and wheel
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- name: Check out repository
|
|
26
|
+
uses: actions/checkout@v4
|
|
27
|
+
with:
|
|
28
|
+
fetch-depth: 0 # hatch-vcs needs the full history to derive the version
|
|
29
|
+
|
|
30
|
+
- name: Set up Python
|
|
31
|
+
uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version: "3.12"
|
|
34
|
+
|
|
35
|
+
- name: Install build backend
|
|
36
|
+
run: |
|
|
37
|
+
python -m pip install --upgrade pip
|
|
38
|
+
python -m pip install build
|
|
39
|
+
|
|
40
|
+
- name: Build distributions
|
|
41
|
+
run: python -m build
|
|
42
|
+
|
|
43
|
+
- name: Upload build artefacts
|
|
44
|
+
uses: actions/upload-artifact@v4
|
|
45
|
+
with:
|
|
46
|
+
name: dist
|
|
47
|
+
path: dist/
|
|
48
|
+
|
|
49
|
+
pypi:
|
|
50
|
+
name: Publish to PyPI
|
|
51
|
+
needs: build
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
environment: pypi
|
|
54
|
+
permissions:
|
|
55
|
+
id-token: write # required for trusted publishing
|
|
56
|
+
|
|
57
|
+
steps:
|
|
58
|
+
- name: Download build artefacts
|
|
59
|
+
uses: actions/download-artifact@v4
|
|
60
|
+
with:
|
|
61
|
+
name: dist
|
|
62
|
+
path: dist/
|
|
63
|
+
|
|
64
|
+
- name: Publish to PyPI (trusted publishing)
|
|
65
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
66
|
+
|
|
67
|
+
github-release:
|
|
68
|
+
name: Create GitHub Release
|
|
69
|
+
needs: pypi
|
|
70
|
+
runs-on: ubuntu-latest
|
|
71
|
+
permissions:
|
|
72
|
+
contents: write
|
|
73
|
+
|
|
74
|
+
steps:
|
|
75
|
+
- name: Check out repository
|
|
76
|
+
uses: actions/checkout@v4
|
|
77
|
+
|
|
78
|
+
- name: Download build artefacts
|
|
79
|
+
uses: actions/download-artifact@v4
|
|
80
|
+
with:
|
|
81
|
+
name: dist
|
|
82
|
+
path: dist/
|
|
83
|
+
|
|
84
|
+
- name: Create release with attached distributions
|
|
85
|
+
uses: softprops/action-gh-release@v2
|
|
86
|
+
with:
|
|
87
|
+
generate_release_notes: true
|
|
88
|
+
files: dist/*
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Continuous integration: run the test suite on every push and pull request.
|
|
2
|
+
# Matrix-tests across Python 3.10, 3.11, and 3.12 to catch version-specific
|
|
3
|
+
# regressions before they land on main.
|
|
4
|
+
|
|
5
|
+
name: tests
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
branches: [main]
|
|
10
|
+
pull_request:
|
|
11
|
+
branches: [main]
|
|
12
|
+
workflow_dispatch: {}
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
test:
|
|
16
|
+
name: pytest (Python ${{ matrix.python-version }})
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
strategy:
|
|
19
|
+
fail-fast: false
|
|
20
|
+
matrix:
|
|
21
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- name: Check out repository
|
|
25
|
+
uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
28
|
+
uses: actions/setup-python@v5
|
|
29
|
+
with:
|
|
30
|
+
python-version: ${{ matrix.python-version }}
|
|
31
|
+
cache: pip
|
|
32
|
+
|
|
33
|
+
- name: Install package with dev extras
|
|
34
|
+
run: |
|
|
35
|
+
python -m pip install --upgrade pip
|
|
36
|
+
python -m pip install -e ".[dev]"
|
|
37
|
+
|
|
38
|
+
- name: Run pytest
|
|
39
|
+
run: pytest --cov=rsd --cov-report=xml --cov-report=term -ra
|
|
40
|
+
|
|
41
|
+
- name: Upload coverage to Codecov
|
|
42
|
+
if: matrix.python-version == '3.12'
|
|
43
|
+
uses: codecov/codecov-action@v4
|
|
44
|
+
with:
|
|
45
|
+
files: ./coverage.xml
|
|
46
|
+
fail_ci_if_error: false
|
rsd-1.0.0/.gitignore
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Byte-compiled / optimised
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
*.egg
|
|
11
|
+
.eggs/
|
|
12
|
+
wheels/
|
|
13
|
+
*.whl
|
|
14
|
+
|
|
15
|
+
# Testing / coverage
|
|
16
|
+
.pytest_cache/
|
|
17
|
+
.coverage
|
|
18
|
+
.coverage.*
|
|
19
|
+
htmlcov/
|
|
20
|
+
.tox/
|
|
21
|
+
.nox/
|
|
22
|
+
coverage.xml
|
|
23
|
+
*.cover
|
|
24
|
+
|
|
25
|
+
# Type checking caches
|
|
26
|
+
.mypy_cache/
|
|
27
|
+
.ruff_cache/
|
|
28
|
+
.pyre/
|
|
29
|
+
.pytype/
|
|
30
|
+
|
|
31
|
+
# Environments
|
|
32
|
+
.venv/
|
|
33
|
+
venv/
|
|
34
|
+
env/
|
|
35
|
+
.env
|
|
36
|
+
*.env
|
|
37
|
+
|
|
38
|
+
# Editor / IDE
|
|
39
|
+
.idea/
|
|
40
|
+
.vscode/
|
|
41
|
+
*.swp
|
|
42
|
+
*.swo
|
|
43
|
+
*~
|
|
44
|
+
|
|
45
|
+
# OS
|
|
46
|
+
.DS_Store
|
|
47
|
+
Thumbs.db
|
|
48
|
+
ehthumbs.db
|
|
49
|
+
|
|
50
|
+
# Jupyter
|
|
51
|
+
.ipynb_checkpoints/
|
|
52
|
+
|
|
53
|
+
# Docs builds
|
|
54
|
+
docs/_build/
|
|
55
|
+
site/
|
|
56
|
+
.cache/
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# pre-commit hooks for rsd.
|
|
2
|
+
#
|
|
3
|
+
# Install once per clone: pre-commit install
|
|
4
|
+
# Run manually: pre-commit run --all-files
|
|
5
|
+
#
|
|
6
|
+
# Hooks run automatically before every git commit. If a hook auto-fixes
|
|
7
|
+
# a file, the commit is aborted; re-stage the fixed file(s) and commit again.
|
|
8
|
+
|
|
9
|
+
repos:
|
|
10
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
11
|
+
rev: v0.6.9
|
|
12
|
+
hooks:
|
|
13
|
+
# Linter: catch unused imports, undefined names, common bug patterns.
|
|
14
|
+
- id: ruff
|
|
15
|
+
args: [--fix]
|
|
16
|
+
# Formatter: enforce consistent code style (replaces black + isort).
|
|
17
|
+
# Example notebooks are excluded: their code is hand-formatted for
|
|
18
|
+
# teaching clarity (grouped call signatures, aligned tables), which
|
|
19
|
+
# the mechanical formatter would undo.
|
|
20
|
+
- id: ruff-format
|
|
21
|
+
exclude: ^examples/.*\.ipynb$
|
|
22
|
+
|
|
23
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
24
|
+
rev: v4.6.0
|
|
25
|
+
hooks:
|
|
26
|
+
- id: trailing-whitespace
|
|
27
|
+
- id: end-of-file-fixer
|
|
28
|
+
- id: check-yaml
|
|
29
|
+
# --unsafe checks YAML syntax without resolving custom tags;
|
|
30
|
+
# mkdocs.yml uses a Python-specific tag for the Mermaid fence
|
|
31
|
+
# (!!python/name:pymdownx.superfences.fence_code_format).
|
|
32
|
+
args: [--unsafe]
|
|
33
|
+
- id: check-toml
|
|
34
|
+
- id: check-added-large-files
|
|
35
|
+
args: [--maxkb=1000]
|
|
36
|
+
# Brand assets (banner PNGs) are intentionally large and render
|
|
37
|
+
# the README header on GitHub; exempt them from the
|
|
38
|
+
# accidental-large-file guard while keeping the limit for code.
|
|
39
|
+
exclude: ^assets/
|
|
40
|
+
- id: check-merge-conflict
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Read the Docs configuration for rsd
|
|
2
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html
|
|
3
|
+
|
|
4
|
+
version: 2
|
|
5
|
+
|
|
6
|
+
build:
|
|
7
|
+
os: ubuntu-22.04
|
|
8
|
+
tools:
|
|
9
|
+
python: "3.12"
|
|
10
|
+
jobs:
|
|
11
|
+
pre_build:
|
|
12
|
+
# mkdocs-jupyter renders ../examples/*.ipynb via the symlink
|
|
13
|
+
# docs/examples -> ../examples. The symlink is checked into git
|
|
14
|
+
# so nothing extra is needed at build time.
|
|
15
|
+
- echo "Building rsd docs site"
|
|
16
|
+
|
|
17
|
+
mkdocs:
|
|
18
|
+
configuration: mkdocs.yml
|
|
19
|
+
|
|
20
|
+
python:
|
|
21
|
+
install:
|
|
22
|
+
- method: pip
|
|
23
|
+
path: .
|
|
24
|
+
extra_requirements:
|
|
25
|
+
- xarray
|
|
26
|
+
- requirements: docs/requirements.txt
|
rsd-1.0.0/.zenodo.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "rsd: Reference-based standardization framework for hydroclimate drought indices",
|
|
3
|
+
"description": "A Python package implementing a hybrid empirical-parametric framework for standardized hydroclimate drought indices (SPI, SSI, SDI, SPEI) under a fixed reference distribution. Deseasonalizes per calendar month, pools residuals, and splices a Generalized Pareto Distribution tail onto an empirical CDF core so that values from different model runs, scenarios, or observational products are directly comparable on the same scale. Provides 1-D and xarray/dask N-D entry points, public-API input validation, custom warning categories, and a one-call diagnose() that verifies the exchangeability assumption underlying pooling. Companion paper: Tsilimigkras, Grillakis, & Koutroulis (2026), submitted to Water Resources Research.",
|
|
4
|
+
"creators": [
|
|
5
|
+
{
|
|
6
|
+
"name": "Tsilimigkras, Athanasios",
|
|
7
|
+
"affiliation": "Technical University of Crete"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"drought",
|
|
12
|
+
"standardized-index",
|
|
13
|
+
"SPI",
|
|
14
|
+
"SSI",
|
|
15
|
+
"SDI",
|
|
16
|
+
"SPEI",
|
|
17
|
+
"hydroclimate",
|
|
18
|
+
"extreme-value-theory",
|
|
19
|
+
"distribution-shift",
|
|
20
|
+
"reference-based",
|
|
21
|
+
"python"
|
|
22
|
+
],
|
|
23
|
+
"license": "BSD-3-Clause",
|
|
24
|
+
"upload_type": "software",
|
|
25
|
+
"access_right": "open",
|
|
26
|
+
"related_identifiers": [
|
|
27
|
+
{
|
|
28
|
+
"identifier": "https://github.com/thchilly/rsd",
|
|
29
|
+
"relation": "isSourceOf",
|
|
30
|
+
"scheme": "url"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"references": [
|
|
34
|
+
"Tsilimigkras, A., Grillakis, M., & Koutroulis, A. (2026). A reference-based standardization framework for hydroclimate drought indices under distribution shift. Manuscript submitted to Water Resources Research."
|
|
35
|
+
]
|
|
36
|
+
}
|
rsd-1.0.0/CHANGELOG.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [1.0.0] - 2026-05-25
|
|
11
|
+
|
|
12
|
+
First public release, accompanying the methodology paper submitted to
|
|
13
|
+
*Water Resources Research* (Tsilimigkras, 2026).
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- `rsd.standardize` - 1-D entry point for three standardisation methods that
|
|
17
|
+
share a common interface: the hybrid empirical/parametric RSD method, a
|
|
18
|
+
monthwise ECDF baseline, and a monthwise parametric baseline.
|
|
19
|
+
- `rsd.standardize_xr` - xarray/dask wrapper for N-D spatial computation;
|
|
20
|
+
parallelises across pixels per chunk.
|
|
21
|
+
- `rsd.diagnose` - one-call diagnostics that verify the exchangeability
|
|
22
|
+
assumption underlying RSD pooling and compare baseline vs bounded vs
|
|
23
|
+
auto-bound pathways side by side.
|
|
24
|
+
- `rsd.estimate_bounds` - heuristic percentile-based bounds estimator for
|
|
25
|
+
bounded variables, paired with explicit warnings about its non-physical
|
|
26
|
+
nature.
|
|
27
|
+
- `bounds=` parameter on the RSD path for bounded variables (e.g. soil
|
|
28
|
+
moisture); the logit pre-transform is applied before accumulation so both
|
|
29
|
+
`agg="sum"` and `agg="mean"` work consistently.
|
|
30
|
+
- Custom warning categories `rsd.RSDFitWarning` and
|
|
31
|
+
`rsd.RSDDegenerateWarning` so users can filter or escalate them with
|
|
32
|
+
`warnings.filterwarnings`.
|
|
33
|
+
|
|
34
|
+
### Design choices
|
|
35
|
+
- Public API uses positional-or-keyword arguments for the data inputs and
|
|
36
|
+
keyword-only arguments for all configuration parameters, preventing silent
|
|
37
|
+
positional mix-ups.
|
|
38
|
+
- Internal pipeline runs in `float64`; outputs are cast to `float32` at the
|
|
39
|
+
storage boundary for memory efficiency.
|
|
40
|
+
- Public API rejects out-of-range parameters at the function boundary
|
|
41
|
+
(months outside [1, 12], `tail_quantile` outside `(0, 0.20]`,
|
|
42
|
+
`min_tail_size < 10`, references too short for the requested tail fit).
|
|
43
|
+
- The monthwise parametric path uses the canonical Stagge SPI convention
|
|
44
|
+
(`floc=0`) by default for distributions with non-negative support.
|
|
45
|
+
|
|
46
|
+
### Documentation
|
|
47
|
+
- Quick-start examples for both 1-D and N-D usage in `README.md`.
|
|
48
|
+
- API reference and method overview at
|
|
49
|
+
[hydro-rsd.readthedocs.io](https://hydro-rsd.readthedocs.io).
|
|
50
|
+
- Runnable example notebooks under `examples/`.
|
|
51
|
+
|
|
52
|
+
### Notes
|
|
53
|
+
- Companion paper: Tsilimigkras, A., Grillakis, M., & Koutroulis, A. (2026).
|
|
54
|
+
*A reference-based standardization framework for hydroclimate drought
|
|
55
|
+
indices under distribution shift*. Manuscript submitted to
|
|
56
|
+
*Water Resources Research*. DOI pending acceptance.
|
|
57
|
+
|
|
58
|
+
[Unreleased]: https://github.com/thchilly/rsd/compare/v1.0.0...HEAD
|
|
59
|
+
[1.0.0]: https://github.com/thchilly/rsd/releases/tag/v1.0.0
|
rsd-1.0.0/CITATION.cff
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# CITATION.cff - machine-readable citation metadata consumed by GitHub's
|
|
2
|
+
# "Cite this repository" button and by reference managers. The
|
|
3
|
+
# preferred-citation block points at the methodology paper.
|
|
4
|
+
|
|
5
|
+
cff-version: 1.2.0
|
|
6
|
+
title: "Reference-based Standardization (RSD) for hydroclimate indices"
|
|
7
|
+
message: "If you use this software, please cite the methodology paper listed under preferred-citation."
|
|
8
|
+
authors:
|
|
9
|
+
- family-names: Tsilimigkras
|
|
10
|
+
given-names: Athanasios
|
|
11
|
+
email: atsilimigkras1@tuc.gr
|
|
12
|
+
affiliation: "Technical University of Crete"
|
|
13
|
+
version: "1.0.0"
|
|
14
|
+
date-released: "2026-05-22"
|
|
15
|
+
license: BSD-3-Clause
|
|
16
|
+
repository-code: "https://github.com/thchilly/rsd"
|
|
17
|
+
url: "https://hydro-rsd.readthedocs.io"
|
|
18
|
+
keywords:
|
|
19
|
+
- drought
|
|
20
|
+
- standardized-index
|
|
21
|
+
- SPI
|
|
22
|
+
- SSI
|
|
23
|
+
- SDI
|
|
24
|
+
- SPEI
|
|
25
|
+
- hydroclimate
|
|
26
|
+
- extreme-value-theory
|
|
27
|
+
- distribution-shift
|
|
28
|
+
type: software
|
|
29
|
+
|
|
30
|
+
preferred-citation:
|
|
31
|
+
type: article
|
|
32
|
+
authors:
|
|
33
|
+
- family-names: Tsilimigkras
|
|
34
|
+
given-names: Athanasios
|
|
35
|
+
email: atsilimigkras1@tuc.gr
|
|
36
|
+
affiliation: "Technical University of Crete"
|
|
37
|
+
- family-names: Grillakis
|
|
38
|
+
given-names: Manolis
|
|
39
|
+
affiliation: "Technical University of Crete"
|
|
40
|
+
- family-names: Koutroulis
|
|
41
|
+
given-names: Aristeidis
|
|
42
|
+
affiliation: "Technical University of Crete"
|
|
43
|
+
title: "A reference-based standardization framework for hydroclimate drought indices under distribution shift"
|
|
44
|
+
journal: "Water Resources Research"
|
|
45
|
+
year: 2026
|
|
46
|
+
notes: "Manuscript submitted to Water Resources Research; DOI pending acceptance."
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Contributing to rsd
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing. This page covers how to set up a
|
|
4
|
+
development environment, run the tests, and propose a change.
|
|
5
|
+
|
|
6
|
+
## Setting up a development environment
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
git clone https://github.com/thchilly/rsd.git
|
|
10
|
+
cd rsd
|
|
11
|
+
pip install -e ".[dev]"
|
|
12
|
+
pre-commit install
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The `[dev]` extra pulls in `pytest`, `pytest-cov`, the xarray/dask
|
|
16
|
+
stack (`[xarray]`), and matplotlib (`[diagnostics]`). `pre-commit
|
|
17
|
+
install` activates the pre-commit hooks (ruff linting + formatting) so
|
|
18
|
+
every commit is automatically checked before it lands.
|
|
19
|
+
|
|
20
|
+
## Running tests
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pytest # full suite
|
|
24
|
+
pytest --cov=rsd # with a coverage report
|
|
25
|
+
pytest tests/test_core.py # a single test file
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Tests are expected to pass on Python 3.10, 3.11, and 3.12. Continuous
|
|
29
|
+
integration runs the suite across all three on every push and pull request.
|
|
30
|
+
|
|
31
|
+
## Proposing a change
|
|
32
|
+
|
|
33
|
+
1. **Open an issue first** describing what you want to change and why. This
|
|
34
|
+
avoids you spending time on a change that may not align with the project
|
|
35
|
+
scope, and it gives other contributors a chance to comment.
|
|
36
|
+
2. Fork the repository and create a feature branch off `main`.
|
|
37
|
+
3. Make your change. Add or update tests if the change affects behaviour.
|
|
38
|
+
4. Run `pytest` and `pre-commit run --all-files` until both are green.
|
|
39
|
+
5. Open a pull request that references the issue.
|
|
40
|
+
|
|
41
|
+
For non-trivial changes please also add a brief entry under `[Unreleased]`
|
|
42
|
+
in `CHANGELOG.md`.
|
|
43
|
+
|
|
44
|
+
## Reporting bugs
|
|
45
|
+
|
|
46
|
+
Open a [GitHub issue](https://github.com/thchilly/rsd/issues) with:
|
|
47
|
+
|
|
48
|
+
- A minimal reproducible example (a short script or notebook cell that
|
|
49
|
+
triggers the problem).
|
|
50
|
+
- The expected behaviour and what you observed instead.
|
|
51
|
+
- Your `rsd`, `numpy`, `scipy`, and Python versions.
|
|
52
|
+
|
|
53
|
+
## Scope
|
|
54
|
+
|
|
55
|
+
`rsd` is a focused methodology package for **reference-based standardisation
|
|
56
|
+
of hydroclimate drought indices**. Contributions that extend the existing
|
|
57
|
+
methodology (additional baseline methods, new diagnostics, better
|
|
58
|
+
documentation, performance improvements, bug fixes) are very welcome.
|
|
59
|
+
Feature requests that fall outside this scope (general time-series tooling,
|
|
60
|
+
non-hydroclimate use cases, climate-model post-processing utilities) are
|
|
61
|
+
better suited to other packages.
|
|
62
|
+
|
|
63
|
+
## Versioning and releases
|
|
64
|
+
|
|
65
|
+
The project follows [Semantic Versioning](https://semver.org/). Tagged
|
|
66
|
+
releases (`vMAJOR.MINOR.PATCH`) trigger an automatic build and publication
|
|
67
|
+
to PyPI via the `publish.yml` GitHub Actions workflow. Maintainers cut
|
|
68
|
+
releases; contributors do not need to interact with the release machinery.
|
|
69
|
+
|
|
70
|
+
## Code of conduct
|
|
71
|
+
|
|
72
|
+
Be respectful, constructive, and patient in all project communication.
|
|
73
|
+
Issue and pull-request discussions are public; please write accordingly.
|
|
74
|
+
|
|
75
|
+
## License
|
|
76
|
+
|
|
77
|
+
By contributing you agree that your contributions will be licensed under
|
|
78
|
+
the project's [BSD 3-Clause License](LICENSE).
|
rsd-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Athanasios Tsilimigkras
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|