Skip to content

Commit 59a8c63

Browse files
committed
1.0.7
1 parent 2d9b50a commit 59a8c63

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "klib"
3-
version = "1.0.6"
3+
version = "1.0.7"
44
description = "Customized data preprocessing functions for frequent tasks."
55
authors = ["Andreas Kanz <[email protected]>"]
66
license = "MIT"

src/klib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
Data Science Module for Python
3-
==================================
3+
===============================
44
klib is an easy to use Python library of customized functions for cleaning and \
55
analyzing data.
66
"""

src/klib/_version.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
"""Current version of klib"""
2-
__version__ = "1.0.6"
1+
"""Current version of klib."""
2+
3+
__version__ = "1.0.7"

src/klib/clean.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
Functions for data cleaning.
1+
"""Functions for data cleaning.
32
43
:author: Andreas Kanz
54
"""
@@ -279,7 +278,7 @@ def data_cleaning(
279278
changed to categorical, by default 0.03
280279
cat_exclude : Optional[list[str]], optional
281280
List of columns to exclude from categorical conversion, by default None
282-
clean_column_names: bool, optional
281+
clean_col_names: bool, optional
283282
Cleans the column names and provides hints on duplicate and long names, by \
284283
default True
285284
show : Optional[Literal["all", "changes"]], optional

src/klib/describe.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
Functions for descriptive analytics.
1+
"""Functions for descriptive analytics.
32
43
:author: Andreas Kanz
54
@@ -18,6 +17,7 @@
1817
from matplotlib import ticker
1918
from matplotlib.colors import LinearSegmentedColormap
2019
from matplotlib.colors import to_rgb
20+
from matplotlib.gridspec import GridSpec
2121

2222
from klib.utils import _corr_selector
2323
from klib.utils import _missing_vals
@@ -38,7 +38,7 @@ def cat_plot(
3838
bottom: int = 3,
3939
bar_color_top: str = "#5ab4ac",
4040
bar_color_bottom: str = "#d8b365",
41-
):
41+
) -> GridSpec:
4242
"""Two-dimensional visualization of the number and frequency of categorical \
4343
features.
4444
@@ -263,7 +263,7 @@ def corr_plot(
263263
annot: bool = True,
264264
dev: bool = False,
265265
**kwargs,
266-
):
266+
) -> plt.Axes:
267267
"""Two-dimensional visualization of the correlation between feature-columns \
268268
excluding NA values.
269269
@@ -311,7 +311,7 @@ def corr_plot(
311311
Display figure settings in the plot by setting dev = True. If False, the \
312312
settings are not displayed, by default False
313313
314-
Keyword Arguments : optional
314+
kwargs : optional
315315
Additional elements to control the visualization of the plot, e.g.:
316316
317317
* mask: bool, default True
@@ -615,7 +615,7 @@ def missingval_plot(
615615
figsize: tuple = (20, 20),
616616
sort: bool = False,
617617
spine_color: str = "#EEEEEE",
618-
):
618+
) -> GridSpec:
619619
"""Two-dimensional visualization of the missing values in a dataset.
620620
621621
Parameters

src/klib/utils.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def _diff_report(
141141
print(f"Reduced memory by at least: {round(mem_change,3)} MB (-{mem_perc}%)\n")
142142

143143

144-
def _print_cleaning_details(arg0, arg1, arg2, arg3):
144+
def _print_cleaning_details(arg0, arg1, arg2, arg3) -> None:
145145
print(arg0)
146146
print(f"dtypes:\n{arg1.dtypes.value_counts()}")
147147
print(f"\nNumber of rows: {str(arg1.shape[0]).rjust(8)}")
@@ -232,49 +232,49 @@ def _missing_vals(data: pd.DataFrame) -> MVResult:
232232
}
233233

234234

235-
def _validate_input_bool(value: bool, desc):
235+
def _validate_input_bool(value: bool, desc) -> None:
236236
if not isinstance(value, bool):
237237
raise TypeError(
238238
f"Input value for '{desc}' is {type(value)} but should be a boolean."
239239
)
240240

241241

242-
def _validate_input_int(value: int, desc):
242+
def _validate_input_int(value: int, desc) -> None:
243243
if not isinstance(value, int):
244244
raise TypeError(
245245
f"Input value for '{desc}' is {type(value)} but should be an integer."
246246
)
247247

248248

249-
def _validate_input_range(value, desc, lower, upper):
249+
def _validate_input_range(value, desc, lower, upper) -> None:
250250
if value < lower or value > upper:
251251
raise ValueError(
252252
f"'{desc}' = {value} but should be {lower} <= '{desc}' <= {upper}."
253253
)
254254

255255

256-
def _validate_input_smaller(value1, value2, desc):
256+
def _validate_input_smaller(value1, value2, desc) -> None:
257257
if value1 > value2:
258258
raise ValueError(
259259
f"The first input for '{desc}' should be smaller or equal to the second."
260260
)
261261

262262

263-
def _validate_input_sum_smaller(limit, desc, *args):
263+
def _validate_input_sum_smaller(limit, desc, *args) -> None:
264264
if sum(args) > limit:
265265
raise ValueError(
266266
f"The sum of input values for '{desc}' should be less or equal to {limit}."
267267
)
268268

269269

270-
def _validate_input_sum_larger(limit, desc, *args):
270+
def _validate_input_sum_larger(limit, desc, *args) -> None:
271271
if sum(args) < limit:
272272
raise ValueError(
273273
f"The sum of input values for '{desc}' should be larger/equal to {limit}."
274274
)
275275

276276

277-
def _validate_input_num_data(value: pd.DataFrame, desc):
277+
def _validate_input_num_data(value: pd.DataFrame, desc) -> None:
278278
if value.select_dtypes(include=["number"]).empty:
279279
raise TypeError(
280280
f"Input value for '{desc}' should contain at least one numerical column."

0 commit comments

Comments
 (0)