Skip to content

Commit

Permalink
Remove unnecessary space after docstring bullet points
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvothecoder committed Feb 16, 2024
1 parent b7ccbaa commit 10d70f0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 45 deletions.
10 changes: 4 additions & 6 deletions xcdat/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,11 @@ def swap_lon_axis(
dataset : xr.Dataset
The Dataset containing a longitude axis.
to : Tuple[float, float]
The orientation to swap the Dataset's longitude axis to.
Supported orientations:
* (-180, 180): represents [-180, 180) in math notation
* (0, 360): represents [0, 360) in math notation
The orientation to swap the Dataset's longitude axis to. Supported
orientations include:
* (-180, 180): represents [-180, 180) in math notation
* (0, 360): represents [0, 360) in math notation
sort_ascending : bool
After swapping, sort in ascending order (True), or keep existing order
(False).
Expand Down
61 changes: 27 additions & 34 deletions xcdat/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def open_dataset(
of the coordinates. If desired, refer to
:py:func:`xarray.Dataset.bounds.add_time_bounds` if you require more
granular configuration for how "T" bounds are generated.
decode_times: bool, optional
If True, attempt to decode times encoded in the standard NetCDF
datetime format into cftime.datetime objects. Otherwise, leave them
Expand All @@ -95,11 +94,10 @@ def open_dataset(
Either `(-180, 180)` or `(0, 360)`, by default None. Supported options
include:
* None: use the current orientation (if the longitude axis exists)
* (-180, 180): represents [-180, 180) in math notation
* (0, 360): represents [0, 360) in math notation
kwargs : Dict[str, Any]
* None: use the current orientation (if the longitude axis exists)
* (-180, 180): represents [-180, 180) in math notation
* (0, 360): represents [0, 360) in math notation
**kwargs : Dict[str, Any]
Additional arguments passed on to ``xarray.open_dataset``. Refer to the
[1]_ xarray docs for accepted keyword arguments.
Expand Down Expand Up @@ -155,25 +153,24 @@ def open_mfdataset(
Paths to dataset files. Paths can be given as strings or as pathlib.Path
objects. Supported options include:
* Directory path (e.g., ``"path/to/files"``), which is converted
to a string glob of `*.nc` files
* String glob (e.g., ``"path/to/files/*.nc"``), which is expanded
to a 1-dimensional list of file paths
* File path to dataset (e.g., ``"path/to/files/file1.nc"``)
* List of file paths (e.g., ``["path/to/files/file1.nc", ...]``).
If concatenation along more than one dimension is desired, then
``paths`` must be a nested list-of-lists (see [2]_
``xarray.combine_nested`` for details).
* File path to an XML file with a ``directory`` attribute (e.g.,
``"path/to/files"``). If ``directory`` is set to a blank string
(""), then the current directory is substituted ("."). This option
is intended to support the CDAT CDML dialect of XML files, but it
can work with any XML file that has the ``directory`` attribute.
Refer to [4]_ for more information on CDML. NOTE: This feature is
deprecated in v0.6.0 and will be removed in the subsequent release.
CDAT (including cdms2/CDML) is in maintenance only mode and marked
for end-of-life by the end of 2023.
* Directory path (e.g., ``"path/to/files"``), which is converted
to a string glob of `*.nc` files
* String glob (e.g., ``"path/to/files/*.nc"``), which is expanded
to a 1-dimensional list of file paths
* File path to dataset (e.g., ``"path/to/files/file1.nc"``)
* List of file paths (e.g., ``["path/to/files/file1.nc", ...]``).
If concatenation along more than one dimension is desired, then
``paths`` must be a nested list-of-lists (see [2]_
``xarray.combine_nested`` for details).
* File path to an XML file with a ``directory`` attribute (e.g.,
``"path/to/files"``). If ``directory`` is set to a blank string
(""), then the current directory is substituted ("."). This option
is intended to support the CDAT CDML dialect of XML files, but it
can work with any XML file that has the ``directory`` attribute.
Refer to [4]_ for more information on CDML. NOTE: This feature is
deprecated in v0.6.0 and will be removed in the subsequent release.
CDAT (including cdms2/CDML) is in maintenance only mode and marked
for end-of-life by the end of 2023.
add_bounds: List[CFAxisKey] | None | bool
List of CF axes to try to add bounds for (if missing), by default
["X", "Y"]. Set to None to not add any missing bounds. Please note that
Expand All @@ -185,7 +182,6 @@ def open_mfdataset(
of the coordinates. If desired, refer to
:py:func:`xarray.Dataset.bounds.add_time_bounds` if you require more
granular configuration for how "T" bounds are generated.
data_var: Optional[str], optional
The key of the data variable to keep in the Dataset, by default None.
decode_times: bool, optional
Expand All @@ -201,10 +197,9 @@ def open_mfdataset(
The orientation to use for the Dataset's longitude axis (if it exists),
by default None. Supported options include:
* None: use the current orientation (if the longitude axis exists)
* (-180, 180): represents [-180, 180) in math notation
* (0, 360): represents [0, 360) in math notation
* None: use the current orientation (if the longitude axis exists)
* (-180, 180): represents [-180, 180) in math notation
* (0, 360): represents [0, 360) in math notation
data_vars: {"minimal", "different", "all" or list of str}, optional
These data variables will be concatenated together:
* "minimal": Only data variables in which the dimension already
Expand All @@ -222,15 +217,14 @@ def open_mfdataset(
data variables in a manner where only data variables in which the
dimension already appears are included. For example, the time dimension
will not be concatenated to the dimensions of non-time data variables
such as "lat_bnds" or "lon_bnds". `data_vars="minimal"` is required for
such as "lat_bnds" or "lon_bnds". ``data_vars="minimal"`` is required for
some xCDAT functions, including spatial averaging where a reduction is
performed using the lat/lon bounds.
preprocess : Optional[Callable], optional
If provided, call this function on each dataset prior to concatenation.
You can find the file-name from which each dataset was loaded in
``ds.encoding["source"]``.
kwargs : Dict[str, Any]
**kwargs : Dict[str, Any]
Additional arguments passed on to ``xarray.open_mfdataset``. Refer to
the [3]_ xarray docs for accepted keyword arguments.
Expand Down Expand Up @@ -587,7 +581,6 @@ def _postprocess_dataset(
* If desired, use :py:func:`xarray.Dataset.bounds.add_time_bounds`
if you require more granular configuration for how "T" bounds
are generated
lon_orient: Optional[Tuple[float, float]], optional
The orientation to use for the Dataset's longitude axis (if it exists),
by default None.
Expand Down
7 changes: 2 additions & 5 deletions xcdat/temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ def average(self, data_var: str, weighted: bool = True, keep_weights: bool = Fal
----------
data_var: str
The key of the data variable for calculating averages
weighted : bool, optional
Calculate averages using weights, by default True.
Expand All @@ -193,6 +192,7 @@ def average(self, data_var: str, weighted: bool = True, keep_weights: bool = Fal
(e.g., a timepoint on 2020-06-01 with bounds that begin in May 2020
and end in June 2020), the weights will not be assigned properly.
See explanation in the Notes section below.
keep_weights : bool, optional
If calculating averages using weights, keep the weights in the
final dataset output, by default False.
Expand Down Expand Up @@ -260,7 +260,6 @@ def group_average(
* "month": groups by (year, month) for monthly averages.
* "day": groups by (year, month, day) for daily averages.
* "hour": groups by (year, month, day, hour) for hourly averages.
weighted : bool, optional
Calculate averages using weights, by default True.
Expand All @@ -278,6 +277,7 @@ def group_average(
(e.g., a timepoint on 2020-06-01 with bounds that begin in May 2020
and end in June 2020), the weights will not be assigned properly.
See explanation in the Notes section below.
keep_weights : bool, optional
If calculating averages using weights, keep the weights in the
final dataset output, by default False.
Expand Down Expand Up @@ -430,7 +430,6 @@ def climatology(
present) are dropped to avoid inconsistencies when calculating
climatologies. Refer to [1]_ for more details on this
implementation decision.
weighted : bool, optional
Calculate averages using weights, by default True.
Expand Down Expand Up @@ -606,7 +605,6 @@ def departures(
----------
data_var: str
The key of the data variable for calculating departures.
freq : Frequency
The frequency of time to group by.
Expand All @@ -618,7 +616,6 @@ def departures(
present) are dropped to avoid inconsistencies when calculating
climatologies. Refer to [2]_ for more details on this
implementation decision.
weighted : bool, optional
Calculate averages using weights, by default True.
Expand Down

0 comments on commit 10d70f0

Please sign in to comment.