Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c83dfd1

Browse files
authored
vélin (#4872)
1 parent a5f53e2 commit c83dfd1

30 files changed

+161
-236
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ repos:
2424
rev: 3.8.4
2525
hooks:
2626
- id: flake8
27+
# - repo: https://github.com/Carreau/velin
28+
# rev: 0.0.8
29+
# hooks:
30+
# - id: velin
31+
# args: ["--write", "--compact"]
2732
- repo: https://github.com/pre-commit/mirrors-mypy
2833
rev: v0.790 # Must match ci/requirements/*.yml
2934
hooks:

xarray/backends/locks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def _get_scheduler(get=None, collection=None) -> Optional[str]:
6767
6868
None is returned if no dask scheduler is active.
6969
70-
See also
70+
See Also
7171
--------
7272
dask.base.get_scheduler
7373
"""

xarray/backends/lru_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, maxsize: int, on_evict: Callable[[K, V], Any] = None):
3434
----------
3535
maxsize : int
3636
Integer maximum number of items to hold in the cache.
37-
on_evict: callable, optional
37+
on_evict : callable, optional
3838
Function to call like ``on_evict(key, value)`` when items are
3939
evicted.
4040
"""

xarray/backends/rasterio_.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ def shape(self):
5252
def _get_indexer(self, key):
5353
"""Get indexer for rasterio array.
5454
55-
Parameter
56-
---------
57-
key: tuple of int
55+
Parameters
56+
----------
57+
key : tuple of int
5858
5959
Returns
6060
-------
@@ -63,7 +63,7 @@ def _get_indexer(self, key):
6363
squeeze_axis: axes to be squeezed
6464
np_ind: indexer for loaded numpy array
6565
66-
See also
66+
See Also
6767
--------
6868
indexing.decompose_indexer
6969
"""
@@ -180,7 +180,6 @@ def open_rasterio(filename, parse_coordinates=None, chunks=None, cache=None, loc
180180
nx, ny = da.sizes['x'], da.sizes['y']
181181
x, y = np.meshgrid(np.arange(nx)+0.5, np.arange(ny)+0.5) * transform
182182
183-
184183
Parameters
185184
----------
186185
filename : str, rasterio.DatasetReader, or rasterio.WarpedVRT

xarray/backends/zarr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ def set_variables(self, variables, check_encoding_set, writer, unlimited_dims=No
462462
check_encoding_set : list-like
463463
List of variables that should be checked for invalid encoding
464464
values
465-
writer :
465+
writer
466466
unlimited_dims : list-like
467467
List of dimension names that should be treated as unlimited
468468
dimensions.
@@ -566,7 +566,7 @@ def open_zarr(
566566
based on the variable's zarr chunks. If `chunks=None`, zarr array
567567
data will lazily convert to numpy arrays upon access. This accepts
568568
all the chunk specifications as Dask does.
569-
overwrite_encoded_chunks: bool, optional
569+
overwrite_encoded_chunks : bool, optional
570570
Whether to drop the zarr chunks encoded for each variable when a
571571
dataset is loaded with specified chunk sizes (default: False)
572572
decode_cf : bool, optional
@@ -605,7 +605,7 @@ def open_zarr(
605605
{'days', 'hours', 'minutes', 'seconds', 'milliseconds', 'microseconds'}
606606
into timedelta objects. If False, leave them encoded as numbers.
607607
If None (default), assume the same value of decode_time.
608-
use_cftime: bool, optional
608+
use_cftime : bool, optional
609609
Only relevant if encoded dates come from a standard calendar
610610
(e.g. "gregorian", "proleptic_gregorian", "standard", or not
611611
specified). If None (default), attempt to decode times to

xarray/coding/cftime_offsets.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ def cftime_range(
796796
periods : int, optional
797797
Number of periods to generate.
798798
freq : str or None, default: "D"
799-
Frequency strings can have multiples, e.g. "5H".
799+
Frequency strings can have multiples, e.g. "5H".
800800
normalize : bool, default: False
801801
Normalize start/end dates to midnight before generating date range.
802802
name : str, default: None
@@ -813,7 +813,6 @@ def cftime_range(
813813
814814
Notes
815815
-----
816-
817816
This function is an analog of ``pandas.date_range`` for use in generating
818817
sequences of ``cftime.datetime`` objects. It supports most of the
819818
features of ``pandas.date_range`` (e.g. specifying how the index is
@@ -911,7 +910,6 @@ def cftime_range(
911910
| Q(S)-DEC | Quarter frequency, anchored at the end (or beginning) of December |
912911
+----------+--------------------------------------------------------------------+
913912
914-
915913
Finally, the following calendar aliases are supported.
916914
917915
+--------------------------------+---------------------------------------+
@@ -932,7 +930,6 @@ def cftime_range(
932930
933931
Examples
934932
--------
935-
936933
This function returns a ``CFTimeIndex``, populated with ``cftime.datetime``
937934
objects associated with the specified calendar type, e.g.
938935

xarray/coding/cftimeindex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ def shift(self, n, freq):
516516
-------
517517
CFTimeIndex
518518
519-
See also
519+
See Also
520520
--------
521521
pandas.DatetimeIndex.shift
522522

xarray/coding/frequencies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def infer_freq(index):
6262
Parameters
6363
----------
6464
index : CFTimeIndex, DataArray, DatetimeIndex, TimedeltaIndex, Series
65-
If not passed a CFTimeIndex, this simply calls `pandas.infer_freq`.
66-
If passed a Series or a DataArray will use the values of the series (NOT THE INDEX).
65+
If not passed a CFTimeIndex, this simply calls `pandas.infer_freq`.
66+
If passed a Series or a DataArray will use the values of the series (NOT THE INDEX).
6767
6868
Returns
6969
-------

xarray/coding/times.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def decode_cf_datetime(num_dates, units, calendar=None, use_cftime=None):
191191
Note that time unit in `units` must not be smaller than microseconds and
192192
not larger than days.
193193
194-
See also
194+
See Also
195195
--------
196196
cftime.num2date
197197
"""
@@ -407,7 +407,7 @@ def encode_cf_datetime(dates, units=None, calendar=None):
407407
408408
Unlike `date2num`, this function can handle datetime64 arrays.
409409
410-
See also
410+
See Also
411411
--------
412412
cftime.date2num
413413
"""

xarray/conventions.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ def cf_decoder(
624624
concat_characters : bool
625625
Should character arrays be concatenated to strings, for
626626
example: ["h", "e", "l", "l", "o"] -> "hello"
627-
mask_and_scale: bool
627+
mask_and_scale : bool
628628
Lazily scale (using scale_factor and add_offset) and mask
629629
(using _FillValue).
630630
decode_times : bool
@@ -637,7 +637,7 @@ def cf_decoder(
637637
decoded_attributes : dict
638638
A dictionary mapping from attribute name to values.
639639
640-
See also
640+
See Also
641641
--------
642642
decode_cf_variable
643643
"""
@@ -747,7 +747,6 @@ def cf_encoder(variables, attributes):
747747
This includes masking, scaling, character array handling,
748748
and CF-time encoding.
749749
750-
751750
Parameters
752751
----------
753752
variables : dict
@@ -762,7 +761,7 @@ def cf_encoder(variables, attributes):
762761
encoded_attributes : dict
763762
A dictionary mapping from attribute name to value
764763
765-
See also
764+
See Also
766765
--------
767766
decode_cf_variable, encode_cf_variable
768767
"""

xarray/core/accessor_dt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ def strftime(self, date_format):
322322
def isocalendar(self):
323323
"""Dataset containing ISO year, week number, and weekday.
324324
325-
Note
326-
----
325+
Notes
326+
-----
327327
The iso year and weekday differ from the nominal year and weekday.
328328
"""
329329

xarray/core/alignment.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ def align(
135135
136136
Examples
137137
--------
138-
139138
>>> import xarray as xr
140139
>>> x = xr.DataArray(
141140
... [[25, 35], [10, 24]],
@@ -532,7 +531,7 @@ def reindex_variables(
532531
the input. In either case, new xarray objects are always returned.
533532
fill_value : scalar, optional
534533
Value to use for newly missing values
535-
sparse: bool, optional
534+
sparse : bool, optional
536535
Use an sparse-array
537536
538537
Returns
@@ -704,7 +703,6 @@ def broadcast(*args, exclude=None):
704703
705704
Examples
706705
--------
707-
708706
Broadcast two data arrays against one another to fill out their dimensions:
709707
710708
>>> a = xr.DataArray([1, 2, 3], dims="x")

0 commit comments

Comments
 (0)