Skip to content

Commit

Permalink
Merge pull request #135 from diffix/paul-divide-by-zero
Browse files Browse the repository at this point in the history
Update solver.py
  • Loading branch information
yoid2000 authored Mar 29, 2024
2 parents 76f6255 + bc9fb52 commit 2fe148a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ profile = "black"

[tool.poetry]
name = "syndiffix"
version = "1.0.0"
version = "1.0.01"
description = "Python implementation of the SynDiffix synthetic data generation mechanism."
authors = ["Open Diffix <[email protected]>"]
readme = "README.md"
Expand Down
7 changes: 2 additions & 5 deletions syndiffix/clustering/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ def _col_weight(entropy: float) -> float:
return 1.0 + math.sqrt(max(entropy, 1.0))


def _floor_by(n: float, x: float) -> float:
if n == 0.0:
return 0.0
else:
return math.floor(x / n) * n
def _floor_by(value: float, bin_size: float) -> float:
return math.floor(value / bin_size) * bin_size


def _build_clusters(
Expand Down

0 comments on commit 2fe148a

Please sign in to comment.