@@ -48,8 +48,7 @@ def __init__(self, method: str, available_methods: list):
4848class CMethods :
4949 """
5050 The CMethods class serves a collection of bias correction procedures to adjust
51- time-series of climate data. It accept no parameters but must be instantiated
52- to apply the bias correction techniques.
51+ time-series of climate data.
5352
5453 The following bias correction techniques are available:
5554 Scaling-based techniques:
@@ -91,8 +90,9 @@ def get_available_methods(cls) -> list:
9190 :linenos:
9291 :caption: Example: Get available methods
9392
94- >>> from cmethods.CMethods import CMethods
95- >>> CMethods().get_available_methods()
93+ >>> from cmethods.CMethods import CMethods as cm
94+
95+ >>> cm.get_available_methods()
9696 [
9797 "linear_scaling", "variance_scaling", "delta_method",
9898 "quantile_mapping", "quantile_delta_mapping"
@@ -169,7 +169,7 @@ def adjust_3d(
169169 :caption: Example application - 3-dimensinoal bias correction
170170
171171 >>> import xarray as xr
172- >>> from cmethods.CMethods import CMethods
172+ >>> from cmethods.CMethods import CMethods as cm
173173
174174 >>> # Note: The data sets must contain the dimensions "time", "lat", and "lon"
175175 >>> # for the respective variable.
@@ -178,8 +178,6 @@ def adjust_3d(
178178 >>> simp = xr.open_dataset("path/to/the_dataset_to_adjust-scenario_period.nc")
179179 >>> variable = "tas" # temperatures
180180
181- >>> cm = CMethods()
182-
183181 '''
184182 In the following the Quantile Delta Mapping techniques is applied on
185183 3-dimensional time-series data sets containing the variable "tas". The
@@ -422,7 +420,7 @@ def linear_scaling(
422420 :caption: Example: Linear Scaling
423421
424422 >>> import xarray as xr
425- >>> from cmethods.CMethods import CMethods
423+ >>> from cmethods.CMethods import CMethods as cm
426424
427425 >>> # Note: The data sets must contain the dimension "time"
428426 >>> # for the respective variable.
@@ -431,7 +429,6 @@ def linear_scaling(
431429 >>> simp = xr.open_dataset("path/to/the_dataset_to_adjust-scenario_period.nc")
432430 >>> variable = "tas" # temperatures
433431
434- >>> cm = CMethods()
435432 >>> ls_adjusted = cm.linear_scaling(
436433 ... obs=obs[variable],
437434 ... simh=simh[variable],
@@ -543,7 +540,7 @@ def variance_scaling(
543540 :caption: Example: Variance Scaling
544541
545542 >>> import xarray as xr
546- >>> from cmethods.CMethods import CMethods
543+ >>> from cmethods.CMethods import CMethods as cm
547544
548545 >>> # Note: The data sets must contain the dimension "time"
549546 >>> # for the respective variable.
@@ -552,7 +549,6 @@ def variance_scaling(
552549 >>> simp = xr.open_dataset("path/to/the_dataset_to_adjust-scenario_period.nc")
553550 >>> variable = "tas" # temperatures
554551
555- >>> cm = CMethods()
556552 >>> vs_adjusted = cm.variance_scaling(
557553 ... obs=obs[variable],
558554 ... simh=simh[variable],
@@ -663,7 +659,7 @@ def delta_method(
663659 :caption: Example: Delta Method
664660
665661 >>> import xarray as xr
666- >>> from cmethods.CMethods import CMethods
662+ >>> from cmethods.CMethods import CMethods as cm
667663
668664 >>> # Note: The data sets must contain the dimension "time"
669665 >>> # for the respective variable.
@@ -672,7 +668,6 @@ def delta_method(
672668 >>> simp = xr.open_dataset("path/to/the_dataset_to_adjust-scenario_period.nc")
673669 >>> variable = "tas" # temperatures
674670
675- >>> cm = CMethods()
676671 >>> dm_adjusted = cm.delta_method(
677672 ... obs=obs[variable],
678673 ... simh=simh[variable],
@@ -775,7 +770,7 @@ def quantile_mapping(
775770 :caption: Example: Quantile Mapping
776771
777772 >>> import xarray as xr
778- >>> from cmethods.CMethods import CMethods
773+ >>> from cmethods.CMethods import CMethods as cm
779774
780775 >>> # Note: The data sets must contain the dimension "time"
781776 >>> # for the respective variable.
@@ -784,7 +779,6 @@ def quantile_mapping(
784779 >>> simp = xr.open_dataset("path/to/the_dataset_to_adjust-scenario_period.nc")
785780 >>> variable = "tas" # temperatures
786781
787- >>> cm = CMethods()
788782 >>> qm_adjusted = cm.quantile_mapping(
789783 ... obs=obs[variable],
790784 ... simh=simh[variable],
@@ -1005,7 +999,7 @@ def quantile_delta_mapping(
1005999 :caption: Example: Quantile Delta Mapping
10061000
10071001 >>> import xarray as xr
1008- >>> from cmethods.CMethods import CMethods
1002+ >>> from cmethods.CMethods import CMethods as cm
10091003
10101004 >>> # Note: The data sets must contain the dimension "time"
10111005 >>> # for the respective variable.
@@ -1014,7 +1008,6 @@ def quantile_delta_mapping(
10141008 >>> simp = xr.open_dataset("path/to/the_dataset_to_adjust-scenario_period.nc")
10151009 >>> variable = "tas" # temperatures
10161010
1017- >>> cm = CMethods()
10181011 >>> qdm_adjusted = cm.quantile_delta_mapping(
10191012 ... obs=obs[variable],
10201013 ... simh=simh[variable],
@@ -1089,8 +1082,8 @@ def get_pdf(x: Union[list, np.array], xbins: Union[list, np.array]) -> np.array:
10891082 :linenos:
10901083 :caption: Compute the probability density function :math:`P(x)`
10911084
1092- >>> from cmethods.CMethods import CMethods
1093- >>> cm = CMethods()
1085+ >>> from cmethods.CMethods import CMethods as cm
1086+
10941087 >>> x = [1, 2, 3, 4, 5, 5, 5, 6, 7, 8, 9, 10]
10951088 >>> xbins = [0, 3, 6, 10]
10961089 >>> print(cm.get_pdf(x=x, xbins=xbins))
@@ -1117,8 +1110,8 @@ def get_cdf(x: Union[list, np.array], xbins: Union[list, np.array]) -> np.array:
11171110 :linenos:
11181111 :caption: Compute the cmmulative distribution function :math:`F(x)`
11191112
1120- >>> from cmethods.CMethods import CMethods
1121- >>> cm = CMethods()
1113+ >>> from cmethods.CMethods import CMethods as cm
1114+
11221115 >>> x = [1, 2, 3, 4, 5, 5, 5, 6, 7, 8, 9, 10]
11231116 >>> xbins = [0, 3, 6, 10]
11241117 >>> print(cm.get_cdf(x=x, xbins=xbins))
0 commit comments