Skip to content

Commit

Permalink
Start Python CI7
Browse files Browse the repository at this point in the history
  • Loading branch information
breimanntools committed Apr 5, 2024
1 parent 3348e62 commit 5b23bf7
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
1 change: 0 additions & 1 deletion aaanalysis/_utils/check_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
2 changes: 0 additions & 2 deletions aaanalysis/_utils/check_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


3 changes: 2 additions & 1 deletion aaanalysis/_utils/check_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion aaanalysis/_utils/check_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion aaanalysis/_utils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def wrapper(*args, **kwargs):
return wrapper
return decorator


# Catch UndefinedMetricWarnings
class CatchUndefinedMetricWarning:
"""Context manager to catch and aggregate UndefinedMetricWarnings."""
Expand All @@ -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):
Expand All @@ -157,4 +159,4 @@ def wrapper(*args, **kwargs):
warnings.warn(summary_msg, UndefinedMetricWarning)
return result
return wrapper
return decorator
return decorator
1 change: 0 additions & 1 deletion aaanalysis/_utils/utils_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,3 @@ def print_end_progress(end_message=None):
if end_message is not None:
print_out(end_message)
sys.stdout.flush()

2 changes: 1 addition & 1 deletion aaanalysis/feature_engineering/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
"NumericalFeature",
"CPP",
"CPPPlot",
]
]

0 comments on commit 5b23bf7

Please sign in to comment.