Skip to content

Commit

Permalink
OWDiscretize: Tidying up
Browse files Browse the repository at this point in the history
  • Loading branch information
janezd committed Mar 31, 2022
1 parent eb76560 commit 2a7bad7
Show file tree
Hide file tree
Showing 3 changed files with 390 additions and 234 deletions.
9 changes: 5 additions & 4 deletions Orange/preprocess/tests/test_discretize.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# File contains some long lines; breaking them would decrease readability
# pylint: disable=line-too-long
# pylint: disable=line-too-long,too-many-lines,protected-access
import calendar
import unittest
from unittest.mock import patch, Mock
from unittest.mock import patch
from time import struct_time, mktime

import numpy as np
Expand Down Expand Up @@ -251,7 +251,7 @@ def test_discretization(self):
dvar.compute_value.points,
[int(t.to_val(y)) for y in ("1914-06-29 23:48:10",
"1914-06-29 23:48:20",
"1914-06-29 23:48:30")]),
"1914-06-29 23:48:30")])
self.assertEqual(dvar.values, ('< 23:48:10', "23:48:10 - 23:48:20",
"23:48:20 - 23:48:30", '≥ 23:48:30'))

Expand All @@ -264,7 +264,7 @@ def test_discretization(self):
dvar.compute_value.points,
[int(t.to_val(y)) for y in ("1914-12-31 23:59:59",
"1915-01-01 00:00:00",
"1915-01-01 00:00:01")]),
"1915-01-01 00:00:01")])
self.assertEqual(dvar.values, ('< 23:59:59', "23:59:59 - 00:00:00",
"00:00:00 - 00:00:01", '≥ 00:00:01'))

Expand Down Expand Up @@ -294,6 +294,7 @@ def test_call(self, _, decbin, timebin):
def test_binning_selection(self):
var = ContinuousVariable("y")
discretize = Binning(2)
# pylint: disable=redefined-outer-name
create = discretize._create_binned_var

binnings = []
Expand Down
Loading

0 comments on commit 2a7bad7

Please sign in to comment.