Skip to content

Commit 2a06a8c

Browse files
misc
1 parent 611d3b5 commit 2a06a8c

File tree

5 files changed

+38
-1325
lines changed

5 files changed

+38
-1325
lines changed

.github/workflows/_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
required: true
1919

2020
jobs:
21-
Test-Spot:
21+
Test:
2222
name: Test ${{ inputs.os }} ${{ inputs.python-version }}
2323
runs-on: ${{ inputs.os }}
2424
steps:
@@ -37,5 +37,5 @@ jobs:
3737
- name: Install package
3838
run: python -m pip install ".[dev]"
3939

40-
- name: Testing Spot REST endpoints
40+
- name: Run unit tests
4141
run: pytest tests/

cmethods/CMethods.py

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ def get_function(cls, method: str):
119119
return cls.delta_method
120120
if method == "quantile_mapping":
121121
return cls.quantile_mapping
122-
# if method == "empirical_quantile_mapping":
123-
# return cls.empirical_quantile_mapping
122+
if method == "empirical_quantile_mapping":
123+
return cls.empirical_quantile_mapping
124124
if method == "quantile_delta_mapping":
125125
return cls.quantile_delta_mapping
126126
raise UnknownMethodError(method, cls.METHODS)
@@ -862,20 +862,39 @@ def quantile_mapping(
862862
)
863863

864864
# ? -----========= E M P I R I C A L - Q U A N T I L E - M A P P I N G =========------
865-
# @classmethod
866-
# def empirical_quantile_mapping(
867-
# cls,
868-
# obs: xr.core.dataarray.DataArray,
869-
# simh: xr.core.dataarray.DataArray,
870-
# simp: xr.core.dataarray.DataArray,
871-
# n_quantiles: int = 10,
872-
# extrapolate: Union[str, None] = None,
873-
# **kwargs,
874-
# ) -> xr.core.dataarray.DataArray:
875-
# """Method to adjust 1 dimensional climate data by empirical quantile mapping"""
876-
# raise NotImplementedError(
877-
# "Not implemented; please have a look at: https://svn.oss.deltares.nl/repos/openearthtools/trunk/python/applications/hydrotools/hydrotools/statistics/bias_correction.py "
878-
# )
865+
@classmethod
866+
def empirical_quantile_mapping(
867+
cls,
868+
obs: xr.core.dataarray.DataArray,
869+
simh: xr.core.dataarray.DataArray,
870+
simp: xr.core.dataarray.DataArray,
871+
n_quantiles: int = 100,
872+
extrapolate: Union[str, None] = None,
873+
**kwargs,
874+
) -> xr.core.dataarray.DataArray:
875+
"""
876+
Method to adjust 1-dimensional climate data by empirical quantile mapping
877+
878+
:param obs: The reference data set of the control period
879+
(in most cases the observational data)
880+
:type obs: xr.core.dataarray.DataArray
881+
:param simh: The modeled data of the control period
882+
:type simh: xr.core.dataarray.DataArray
883+
:param simp: The modeled data of the scenario period (this is the data set
884+
on which the bias correction takes action)
885+
:type simp: xr.core.dataarray.DataArray
886+
:param n_quantiles: Number of quantiles to respect/use, defaults to ``100``
887+
:type n_quantiles: int, optional
888+
:type kind: str, optional
889+
:param extrapolate: Bounded range or extrapolate, defaults to ``None``
890+
:type extrapolate: Union[str, None], optional
891+
:return: The bias-corrected time series
892+
:rtype: xr.core.dataarray.DataArray
893+
:raises NotImplementedError: This method is not implemented
894+
"""
895+
raise NotImplementedError(
896+
"Not implemented; please have a look at: https://svn.oss.deltares.nl/repos/openearthtools/trunk/python/applications/hydrotools/hydrotools/statistics/bias_correction.py "
897+
)
879898

880899
# ? -----========= Q U A N T I L E - D E L T A - M A P P I N G =========------
881900
@classmethod

docs/index.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,3 @@ Welcome to python-cmethods's documentation!
1515
src/cmethods.rst
1616
src/issues.rst
1717
src/license.rst
18-
19-
20-
Indices and tables
21-
==================
22-
23-
* :ref:`genindex`

0 commit comments

Comments
 (0)