Skip to content

Commit

Permalink
Remove % operando
Browse files Browse the repository at this point in the history
  • Loading branch information
fealho committed Oct 3, 2024
1 parent c3ee0fb commit 30c749c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ test = [
'rundoc>=0.4.3,<0.5',
'pytest-subtests>=0.5,<1.0',
'pytest-runner >= 2.11.1',
'pyarrow',
'tomli>=2.0.0,<3',
]
dev = [
Expand Down
2 changes: 1 addition & 1 deletion rdt/transformers/numerical.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _raise_out_of_bounds_error(self, value, name, bound_type, min_bound, max_bou

def _validate_values_within_bounds(self, data):
if not self.computer_representation.startswith('Float'):
fractions = data[~data.isna() & data % 1 != 0]
fractions = data[~data.isna() & (data != (data // 1))]
if not fractions.empty:
raise ValueError(
f"The column '{data.name}' contains float values {fractions.tolist()}. "
Expand Down
2 changes: 1 addition & 1 deletion rdt/transformers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def learn_rounding_digits(data):
return None

# Doesn't contain decimal digits
if ((roundable_data % 1) == 0).all():
if (roundable_data == roundable_data.astype(int)).all():
return 0

# Try to round to fewer digits
Expand Down

0 comments on commit 30c749c

Please sign in to comment.