From 6189e208f9a88833f99dc031502ceaeb41fb4c71 Mon Sep 17 00:00:00 2001 From: Peter Luenenschloss <peter.luenenschloss@ufz.de> Date: Tue, 27 Apr 2021 08:08:36 +0200 Subject: [PATCH] black applied --- dios/dios/base.py | 10 +++++----- dios/dios/dios.py | 30 +++++++++++++++--------------- dios/dios/lib.py | 6 +++--- saqc/funcs/residues.py | 2 +- saqc/lib/plotting.py | 2 +- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/dios/dios/base.py b/dios/dios/base.py index 975d83260..11392b486 100644 --- a/dios/dios/base.py +++ b/dios/dios/base.py @@ -93,7 +93,7 @@ class _DiosBase: _throw_MixedItype_err_or_warn(self.itype) def _init_insert_data(self, data, columns, index): - """ Insert items of a iterable in self""" + """Insert items of a iterable in self""" if pdextra.is_iterator(data): data = list(data) @@ -174,7 +174,7 @@ class _DiosBase: self._data.at[col] = val.copy(deep=True) def __getitem__(self, key): - """ dios[key] -> dios/series """ + """dios[key] -> dios/series""" # scalar -> select a column # slice -> select rows (on all columns) # bool dios -> select columns, select rows @@ -217,7 +217,7 @@ class _DiosBase: return new def _getitem_bool_dios(self, key): - """ Select items by a boolean dios-like drop un-selected indices. """ + """Select items by a boolean dios-like drop un-selected indices.""" if not _is_bool_dios_like(key): raise ValueError("Must pass DictOfSeries with boolean values only") @@ -236,7 +236,7 @@ class _DiosBase: return new def __setitem__(self, key, value): - """ dios[key] = value """ + """dios[key] = value""" key = list(key) if pdextra.is_iterator(key) else key if isinstance(key, tuple): raise KeyError(f"{key}. tuples are not allowed") @@ -333,7 +333,7 @@ class _DiosBase: @property def columns(self): - """ The column labels of the DictOfSeries """ + """The column labels of the DictOfSeries""" return self._data.index @columns.setter diff --git a/dios/dios/dios.py b/dios/dios/dios.py index 7cb2e090b..2f908e8f2 100644 --- a/dios/dios/dios.py +++ b/dios/dios/dios.py @@ -73,7 +73,7 @@ class DictOfSeries(_DiosBase): @property def indexes(self): - """ Return pandas.Series with the indexes of all columns. """ + """Return pandas.Series with the indexes of all columns.""" return self.for_each("index") @property @@ -87,12 +87,12 @@ class DictOfSeries(_DiosBase): @property def dtypes(self): - """ Return pandas.Series with the dtypes of all columns. """ + """Return pandas.Series with the dtypes of all columns.""" return self.for_each("dtype") @property def lengths(self): - """ Return pandas.Series with the lenght of all columns. """ + """Return pandas.Series with the lenght of all columns.""" return self._data.apply(len) @property @@ -626,7 +626,7 @@ class DictOfSeries(_DiosBase): return res if res.is_unique else res.unique() def squeeze(self, axis=None): - """ Squeeze a 1-dimensional axis objects into scalars. """ + """Squeeze a 1-dimensional axis objects into scalars.""" if axis in [0, "index"]: if (self.lengths == 1).all(): return self._data.apply(pd.Series.squeeze) @@ -644,23 +644,23 @@ class DictOfSeries(_DiosBase): raise ValueError(axis) def dropna(self, inplace=False): - """ Return a bolean array that is `True` if the value is a Nan-value """ + """Return a bolean array that is `True` if the value is a Nan-value""" data = self.for_each("dropna", inplace=inplace) if inplace: return return self._construct_like_self(data=data, fastpath=True) def dropempty(self): - """ Drop empty columns. Return copy. """ + """Drop empty columns. Return copy.""" return self.loc[:, self.notempty()] def astype(self, dtype, copy=True, errors="raise"): - """ Cast the data to the given data type. """ + """Cast the data to the given data type.""" data = self.for_each("astype", dtype=dtype, copy=copy, errors=errors) return self._construct_like_self(data=data, fastpath=True) def _mask_or_where(self, cond, other=np.nan, inplace=False, mask=True): - """ helper to mask/where """ + """helper to mask/where""" data = self if inplace else self.copy() if callable(other): @@ -826,7 +826,7 @@ class DictOfSeries(_DiosBase): @property def debugDf(self): - """ Alias for ``to_df()`` as property, for debugging purpose.""" + """Alias for ``to_df()`` as property, for debugging purpose.""" return self.to_df() def min(self, axis=0, skipna=True): @@ -882,7 +882,7 @@ class DictOfSeries(_DiosBase): return False def isin(self, values): - """ Return a boolean dios, that indicates if the corresponding value is in the given array-like. """ + """Return a boolean dios, that indicates if the corresponding value is in the given array-like.""" data = self.for_each("isin", values=values) return self._construct_like_self(data=data, fastpath=True) @@ -1006,23 +1006,23 @@ class DictOfSeries(_DiosBase): raise ValueError(axis) def isempty(self): - """ Returns a boolean Series, which indicates if an column is empty """ + """Returns a boolean Series, which indicates if an column is empty""" return self.for_each("empty").astype(bool) def notempty(self): - """ Returns a boolean Series, which indicates if an column is not empty """ + """Returns a boolean Series, which indicates if an column is not empty""" return ~self.isempty() def isdata(self): - """ Alias for ``notna(drop_empty=True)``. """ + """Alias for ``notna(drop_empty=True)``.""" return self.notna(drop_empty=True) def isnull(self, drop_empty=False): - """ Alias for ``isna()`` """ + """Alias for ``isna()``""" return self.isna(drop_empty=drop_empty) def notnull(self, drop_empty=False): - """ Alias, see ``notna()``. """ + """Alias, see ``notna()``.""" return self.notna(drop_empty=drop_empty) def to_dios(self): diff --git a/dios/dios/lib.py b/dios/dios/lib.py index f5eebe378..fc5e41305 100644 --- a/dios/dios/lib.py +++ b/dios/dios/lib.py @@ -70,7 +70,7 @@ class ObjItype(__Itype): def is_itype(obj, itype): - """ Check if obj is a instance of the given itype or its str-alias was given""" + """Check if obj is a instance of the given itype or its str-alias was given""" # todo: iter through itype as it could be a tuple, if called like ``is_itype(o, (t1,t2))`` @@ -86,7 +86,7 @@ def is_itype(obj, itype): def is_itype_subtype(obj, itype): - """ Check if obj is a subclass or a instance of a subclass of the given itype""" + """Check if obj is a subclass or a instance of a subclass of the given itype""" # user gave a subtype, like ``pd.DatetimeIndex`` if type(obj) == type and issubclass(obj, itype.subtypes): @@ -100,7 +100,7 @@ def is_itype_subtype(obj, itype): def is_itype_like(obj, itype): - """ Check if obj is a subclass or a instance of the given itype or any of its subtypes""" + """Check if obj is a subclass or a instance of the given itype or any of its subtypes""" return is_itype(obj, itype) or is_itype_subtype(obj, itype) diff --git a/saqc/funcs/residues.py b/saqc/funcs/residues.py index 4222416f5..79a5cf80c 100644 --- a/saqc/funcs/residues.py +++ b/saqc/funcs/residues.py @@ -128,7 +128,7 @@ def calculateRollingResidues( flag: float = BAD, **kwargs ) -> Tuple[DictOfSeries, Flags]: - """ TODO: docstring needed""" + """TODO: docstring needed""" return roll( data, field, diff --git a/saqc/lib/plotting.py b/saqc/lib/plotting.py index 1ef675620..8d817ba74 100644 --- a/saqc/lib/plotting.py +++ b/saqc/lib/plotting.py @@ -578,7 +578,7 @@ def _splitByFlag(flags: pd.Series, flagger, var: str): def _projectFlagsOntoData(idxlist: List[pd.Series], data: pd.Series): - """ Project flags to a xy-location, based on data. """ + """Project flags to a xy-location, based on data.""" res = [] for item in idxlist: res.append(data.loc[item.index]) -- GitLab