Skip to content

Commit

Permalink
Merge pull request #387 from NannyML/feat/value-limit-defaults-summar…
Browse files Browse the repository at this point in the history
…y-stats

Replace `np.NaN` values for value limits in summary statistics
  • Loading branch information
nnansters authored May 15, 2024
2 parents a213cd3 + aa60aeb commit 9f046be
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions nannyml/stats/avg/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def __init__(
self._upper_alert_thresholds: Dict[str, Optional[float]] = {column_name: 0 for column_name in self.column_names}
self._lower_alert_thresholds: Dict[str, Optional[float]] = {column_name: 0 for column_name in self.column_names}

self.lower_threshold_value_limit: float = np.nan
self.upper_threshold_value_limit: float = np.nan
self.lower_threshold_value_limit: Optional[float] = None
self.upper_threshold_value_limit: Optional[float] = None
self.simple_stats_metric = 'values_avg'

@log_usage(UsageEvent.STATS_AVG_FIT)
Expand Down
4 changes: 2 additions & 2 deletions nannyml/stats/count/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def __init__(
self._upper_alert_threshold: Optional[float] = 0
self._lower_alert_threshold: Optional[float] = 0

self.lower_threshold_value_limit: float = 0
self.upper_threshold_value_limit: float = np.nan
self.lower_threshold_value_limit: Optional[float] = 0
self.upper_threshold_value_limit: Optional[float] = None
self.simple_stats_metric = 'rows_count'

def _calculate_count_value_stats(self, data: pd.DataFrame):
Expand Down
4 changes: 2 additions & 2 deletions nannyml/stats/median/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def __init__(
self._upper_alert_thresholds: Dict[str, Optional[float]] = {column_name: 0 for column_name in self.column_names}
self._lower_alert_thresholds: Dict[str, Optional[float]] = {column_name: 0 for column_name in self.column_names}

self.lower_threshold_value_limit: float = np.nan
self.upper_threshold_value_limit: float = np.nan
self.lower_threshold_value_limit: Optional[float] = None
self.upper_threshold_value_limit: Optional[float] = None
self.simple_stats_metric = 'values_median'

@log_usage(UsageEvent.STATS_MEDIAN_FIT)
Expand Down
2 changes: 1 addition & 1 deletion nannyml/stats/std/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(
self._upper_alert_thresholds: Dict[str, Optional[float]] = {column_name: 0 for column_name in self.column_names}
self._lower_alert_thresholds: Dict[str, Optional[float]] = {column_name: 0 for column_name in self.column_names}

self.lower_threshold_value_limit: float = 0
self.lower_threshold_value_limit: Optional[float] = 0
self.upper_threshold_value_limit: Optional[float] = None
self.simple_stats_metric = 'values_std'

Expand Down
4 changes: 2 additions & 2 deletions nannyml/stats/sum/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def __init__(
self._upper_alert_thresholds: Dict[str, Optional[float]] = {column_name: 0 for column_name in self.column_names}
self._lower_alert_thresholds: Dict[str, Optional[float]] = {column_name: 0 for column_name in self.column_names}

self.lower_threshold_value_limit: float = np.nan
self.upper_threshold_value_limit: float = np.nan
self.lower_threshold_value_limit: Optional[float] = None
self.upper_threshold_value_limit: Optional[float] = None
self.simple_stats_metric = 'values_sum'

@log_usage(UsageEvent.STATS_SUM_FIT)
Expand Down

0 comments on commit 9f046be

Please sign in to comment.