From 992725556cd0b6a8d619373c13e0ee0b19a5a8f4 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Sun, 2 May 2021 22:14:24 -0600 Subject: [PATCH 1/4] Fix list indentation in docstrings --- xarray/core/dataset.py | 63 +++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 37 deletions(-) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index bab94f1b657..f991b7b403c 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -6741,37 +6741,26 @@ def pad( {dim: pad} is a shortcut for pad_before = pad_after = pad mode : str, default: "constant" One of the following string values (taken from numpy docs). - - 'constant' (default) - Pads with a constant value. - 'edge' - Pads with the edge values of array. - 'linear_ramp' - Pads with the linear ramp between end_value and the - array edge value. - 'maximum' - Pads with the maximum value of all or part of the - vector along each axis. - 'mean' - Pads with the mean value of all or part of the - vector along each axis. - 'median' - Pads with the median value of all or part of the - vector along each axis. - 'minimum' - Pads with the minimum value of all or part of the - vector along each axis. - 'reflect' - Pads with the reflection of the vector mirrored on - the first and last values of the vector along each - axis. - 'symmetric' - Pads with the reflection of the vector mirrored - along the edge of the array. - 'wrap' - Pads with the wrap of the vector along the axis. - The first values are used to pad the end and the - end values are used to pad the beginning. + - 'constant': Pads with a constant value. + - 'edge': Pads with the edge values of array. + - 'linear_ramp': Pads with the linear ramp between end_value and the + array edge value. + - 'maximum': Pads with the maximum value of all or part of the + vector along each axis. + - 'mean': Pads with the mean value of all or part of the + vector along each axis. + - 'median': Pads with the median value of all or part of the + vector along each axis. + - 'minimum': Pads with the minimum value of all or part of the + vector along each axis. + - 'reflect': Pads with the reflection of the vector mirrored on + the first and last values of the vector along each + axis. + - 'symmetric': Pads with the reflection of the vector mirrored + along the edge of the array. + - 'wrap': Pads with the wrap of the vector along the axis. + The first values are used to pad the end and the + end values are used to pad the beginning. stat_length : int, tuple or mapping of hashable to tuple, default: None Used in 'maximum', 'mean', 'median', and 'minimum'. Number of values at edge of each axis used to calculate the statistic value. @@ -7210,15 +7199,15 @@ def query( parser to retain strict Python semantics. engine : {"python", "numexpr", None}, default: None The engine used to evaluate the expression. Supported engines are: - - None: tries to use numexpr, falls back to python - - "numexpr": evaluates expressions using numexpr - - "python": performs operations as if you had eval’d in top level python + - None: tries to use numexpr, falls back to python + - "numexpr": evaluates expressions using numexpr + - "python": performs operations as if you had eval’d in top level python missing_dims : {"raise", "warn", "ignore"}, default: "raise" What to do if dimensions that should be selected from are not present in the Dataset: - - "raise": raise an exception - - "warning": raise a warning, and ignore the missing dimensions - - "ignore": ignore the missing dimensions + - "raise": raise an exception + - "warning": raise a warning, and ignore the missing dimensions + - "ignore": ignore the missing dimensions **queries_kwargs : {dim: query, ...}, optional The keyword arguments form of ``queries``. One of queries or queries_kwargs must be provided. From 9b0531393ba95adbeee3de299b41b24dab05cf44 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Sun, 2 May 2021 22:17:07 -0600 Subject: [PATCH 2/4] [skip-ci] From 749f9bf4e9411fc028f437baf7e65e607a5132ce Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Sun, 2 May 2021 23:32:00 -0600 Subject: [PATCH 3/4] [skip-ci] Attempt at fixing sphinx warning about indentation --- xarray/core/dataset.py | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 74486f04de3..a058d48b6b4 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -6741,24 +6741,23 @@ def pad( {dim: pad} is a shortcut for pad_before = pad_after = pad mode : str, default: "constant" One of the following string values (taken from numpy docs). - - 'constant': Pads with a constant value. - - 'edge': Pads with the edge values of array. - - 'linear_ramp': Pads with the linear ramp between end_value and the + - 'constant': Pads with a constant value. + - 'edge': Pads with the edge values of array. + - 'linear_ramp': Pads with the linear ramp between end_value and the array edge value. - - 'maximum': Pads with the maximum value of all or part of the + - 'maximum': Pads with the maximum value of all or part of the vector along each axis. - - 'mean': Pads with the mean value of all or part of the + - 'mean': Pads with the mean value of all or part of the vector along each axis. - - 'median': Pads with the median value of all or part of the + - 'median': Pads with the median value of all or part of the vector along each axis. - - 'minimum': Pads with the minimum value of all or part of the + - 'minimum': Pads with the minimum value of all or part of the vector along each axis. - - 'reflect': Pads with the reflection of the vector mirrored on - the first and last values of the vector along each - axis. - - 'symmetric': Pads with the reflection of the vector mirrored + - 'reflect': Pads with the reflection of the vector mirrored on + the first and last values of the vector along each axis. + - 'symmetric': Pads with the reflection of the vector mirrored along the edge of the array. - - 'wrap': Pads with the wrap of the vector along the axis. + - 'wrap': Pads with the wrap of the vector along the axis. The first values are used to pad the end and the end values are used to pad the beginning. stat_length : int, tuple or mapping of hashable to tuple, default: None @@ -7199,15 +7198,15 @@ def query( parser to retain strict Python semantics. engine : {"python", "numexpr", None}, default: None The engine used to evaluate the expression. Supported engines are: - - None: tries to use numexpr, falls back to python - - "numexpr": evaluates expressions using numexpr - - "python": performs operations as if you had eval’d in top level python + - None: tries to use numexpr, falls back to python + - "numexpr": evaluates expressions using numexpr + - "python": performs operations as if you had eval’d in top level python missing_dims : {"raise", "warn", "ignore"}, default: "raise" What to do if dimensions that should be selected from are not present in the Dataset: - - "raise": raise an exception - - "warning": raise a warning, and ignore the missing dimensions - - "ignore": ignore the missing dimensions + - "raise": raise an exception + - "warning": raise a warning, and ignore the missing dimensions + - "ignore": ignore the missing dimensions **queries_kwargs : {dim: query, ...}, optional The keyword arguments form of ``queries``. One of queries or queries_kwargs must be provided. From bd95091dee9366259564f596d40875ef52c8ecb2 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Mon, 3 May 2021 10:53:26 -0600 Subject: [PATCH 4/4] [skip-ci] Fix bad indentation --- xarray/core/dataset.py | 56 +++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index a058d48b6b4..811357c265d 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -6741,25 +6741,27 @@ def pad( {dim: pad} is a shortcut for pad_before = pad_after = pad mode : str, default: "constant" One of the following string values (taken from numpy docs). - - 'constant': Pads with a constant value. - - 'edge': Pads with the edge values of array. - - 'linear_ramp': Pads with the linear ramp between end_value and the - array edge value. - - 'maximum': Pads with the maximum value of all or part of the - vector along each axis. - - 'mean': Pads with the mean value of all or part of the - vector along each axis. - - 'median': Pads with the median value of all or part of the - vector along each axis. - - 'minimum': Pads with the minimum value of all or part of the - vector along each axis. - - 'reflect': Pads with the reflection of the vector mirrored on - the first and last values of the vector along each axis. - - 'symmetric': Pads with the reflection of the vector mirrored - along the edge of the array. - - 'wrap': Pads with the wrap of the vector along the axis. - The first values are used to pad the end and the - end values are used to pad the beginning. + + - constant: Pads with a constant value. + - edge: Pads with the edge values of array. + - linear_ramp: Pads with the linear ramp between end_value and the + array edge value. + - maximum: Pads with the maximum value of all or part of the + vector along each axis. + - mean: Pads with the mean value of all or part of the + vector along each axis. + - median: Pads with the median value of all or part of the + vector along each axis. + - minimum: Pads with the minimum value of all or part of the + vector along each axis. + - reflect: Pads with the reflection of the vector mirrored on + the first and last values of the vector along each axis. + - symmetric: Pads with the reflection of the vector mirrored + along the edge of the array. + - wrap: Pads with the wrap of the vector along the axis. + The first values are used to pad the end and the + end values are used to pad the beginning. + stat_length : int, tuple or mapping of hashable to tuple, default: None Used in 'maximum', 'mean', 'median', and 'minimum'. Number of values at edge of each axis used to calculate the statistic value. @@ -7198,15 +7200,19 @@ def query( parser to retain strict Python semantics. engine : {"python", "numexpr", None}, default: None The engine used to evaluate the expression. Supported engines are: - - None: tries to use numexpr, falls back to python - - "numexpr": evaluates expressions using numexpr - - "python": performs operations as if you had eval’d in top level python + + - None: tries to use numexpr, falls back to python + - "numexpr": evaluates expressions using numexpr + - "python": performs operations as if you had eval’d in top level python + missing_dims : {"raise", "warn", "ignore"}, default: "raise" What to do if dimensions that should be selected from are not present in the Dataset: - - "raise": raise an exception - - "warning": raise a warning, and ignore the missing dimensions - - "ignore": ignore the missing dimensions + + - "raise": raise an exception + - "warning": raise a warning, and ignore the missing dimensions + - "ignore": ignore the missing dimensions + **queries_kwargs : {dim: query, ...}, optional The keyword arguments form of ``queries``. One of queries or queries_kwargs must be provided.