From 5b23bf7a0e023b0eb6f437820afb7f0204313679 Mon Sep 17 00:00:00 2001 From: stephanbreimann Date: Fri, 5 Apr 2024 16:56:51 +0200 Subject: [PATCH] Start Python CI7 --- aaanalysis/_utils/check_data.py | 1 - aaanalysis/_utils/check_models.py | 2 -- aaanalysis/_utils/check_plots.py | 3 ++- aaanalysis/_utils/check_type.py | 3 ++- aaanalysis/_utils/decorators.py | 4 +++- aaanalysis/_utils/utils_output.py | 1 - aaanalysis/feature_engineering/__init__.py | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/aaanalysis/_utils/check_data.py b/aaanalysis/_utils/check_data.py index 0fa7c42e..db21d0e1 100644 --- a/aaanalysis/_utils/check_data.py +++ b/aaanalysis/_utils/check_data.py @@ -220,7 +220,6 @@ def check_match_list_labels_names_datasets(list_labels=None, names_datasets=None raise ValueError(str_error) - # Check sets def check_superset_subset(subset=None, superset=None, name_subset=None, name_superset=None, str_add=None): """Check if all elements of the subset are contained in the superset.""" diff --git a/aaanalysis/_utils/check_models.py b/aaanalysis/_utils/check_models.py index 9eb2be5d..da45d808 100644 --- a/aaanalysis/_utils/check_models.py +++ b/aaanalysis/_utils/check_models.py @@ -72,5 +72,3 @@ def check_model_kwargs(model_class=None, model_kwargs=None, name_model_class="mo if "random_state" not in model_kwargs and "random_state" in valid_args: model_kwargs.update(dict(random_state=random_state)) return model_kwargs - - diff --git a/aaanalysis/_utils/check_plots.py b/aaanalysis/_utils/check_plots.py index 1ca801f6..e8544a59 100644 --- a/aaanalysis/_utils/check_plots.py +++ b/aaanalysis/_utils/check_plots.py @@ -103,7 +103,8 @@ def check_vmin_vmax(vmin=None, vmax=None, str_add=None): def check_lim(name="xlim", val=None, accept_none=True, str_add=None): - """Validate that lim parameter ('xlim' or 'ylim') is tuple with two numbers, where the first is less than the second.""" + """Validate that lim parameter ('xlim' or 'ylim') is tuple with two numbers, where the first + is less than the second.""" if val is None: if accept_none: return None # Skip check diff --git a/aaanalysis/_utils/check_type.py b/aaanalysis/_utils/check_type.py index 5903f2b7..c8197a08 100644 --- a/aaanalysis/_utils/check_type.py +++ b/aaanalysis/_utils/check_type.py @@ -146,7 +146,8 @@ def check_list_like(name=None, val=None, accept_none=False, convert=True, accept str_add=str_add) raise ValueError(str_error) if isinstance(val, np.ndarray) and val.ndim != 1: - str_error = add_str(str_error=f"'{name}' is a multi-dimensional numpy array and cannot be considered as a list.", + str_error = add_str(str_error=f"'{name}' is a multi-dimensional numpy array and cannot" + f" be considered as a list.", str_add=str_add) raise ValueError(str_error) val = list(val) if isinstance(val, (np.ndarray, pd.Series)) else val diff --git a/aaanalysis/_utils/decorators.py b/aaanalysis/_utils/decorators.py index 78aa1a02..059a9b53 100644 --- a/aaanalysis/_utils/decorators.py +++ b/aaanalysis/_utils/decorators.py @@ -119,6 +119,7 @@ def wrapper(*args, **kwargs): return wrapper return decorator + # Catch UndefinedMetricWarnings class CatchUndefinedMetricWarning: """Context manager to catch and aggregate UndefinedMetricWarnings.""" @@ -143,6 +144,7 @@ def _catch_warning(self, message, category, filename, lineno, file=None, line=No def get_warnings(self): return list(self._warn_set) + def catch_undefined_metric_warning(): """Decorator to catch and report UndefinedMetricWarnings once per unique message.""" def decorator(func): @@ -157,4 +159,4 @@ def wrapper(*args, **kwargs): warnings.warn(summary_msg, UndefinedMetricWarning) return result return wrapper - return decorator \ No newline at end of file + return decorator diff --git a/aaanalysis/_utils/utils_output.py b/aaanalysis/_utils/utils_output.py index 0ea36d40..0eaf2a57 100644 --- a/aaanalysis/_utils/utils_output.py +++ b/aaanalysis/_utils/utils_output.py @@ -60,4 +60,3 @@ def print_end_progress(end_message=None): if end_message is not None: print_out(end_message) sys.stdout.flush() - diff --git a/aaanalysis/feature_engineering/__init__.py b/aaanalysis/feature_engineering/__init__.py index e12f9144..c36de093 100644 --- a/aaanalysis/feature_engineering/__init__.py +++ b/aaanalysis/feature_engineering/__init__.py @@ -12,4 +12,4 @@ "NumericalFeature", "CPP", "CPPPlot", -] \ No newline at end of file +]