Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions src/ydata_profiling/model/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,10 @@

from ydata_profiling.config import Settings
from ydata_profiling.model.correlations import perform_check_correlation
from ydata_profiling.utils.formatters import fmt_percent
from ydata_profiling.utils.styles import get_alert_styles


def fmt_percent(value: float, edge_cases: bool = True) -> str:
"""Format a ratio as a percentage.

Args:
edge_cases: Check for edge cases?
value: The ratio.

Returns:
The percentage with 1 point precision.
"""
if edge_cases and round(value, 3) == 0 and value > 0:
return "< 0.1%"
if edge_cases and round(value, 3) == 1 and value < 1:
return "> 99.9%"

return f"{value*100:2.1f}%"


@unique
class AlertType(Enum):
"""Alert types"""
Expand Down
21 changes: 0 additions & 21 deletions src/ydata_profiling/model/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,3 @@ def handle(self, dtype: str, *args, **kwargs) -> dict:
op = compose(funcs)
summary = op(*args)[-1]
return summary


def get_render_map() -> Dict[str, Callable]:
import ydata_profiling.report.structure.variables as render_algorithms

render_map = {
"Boolean": render_algorithms.render_boolean,
"Numeric": render_algorithms.render_real,
"Complex": render_algorithms.render_complex,
"Text": render_algorithms.render_text,
"DateTime": render_algorithms.render_date,
"Categorical": render_algorithms.render_categorical,
"URL": render_algorithms.render_url,
"Path": render_algorithms.render_path,
"File": render_algorithms.render_file,
"Image": render_algorithms.render_image,
"Unsupported": render_algorithms.render_generic,
"TimeSeries": render_algorithms.render_timeseries,
}

return render_map
Loading