Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] SOM: Fix crash when color is constant #5860

Merged
merged 3 commits into from
Mar 14, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
time_binnings: store thresholds as np.array
janezd committed Mar 9, 2022
commit c00df78de94e82b609bb2a07037bde80a0f62d49
2 changes: 1 addition & 1 deletion Orange/preprocess/discretize.py
Original file line number Diff line number Diff line change
@@ -386,7 +386,7 @@ def _time_binnings(mn, mx, min_pts, max_pts):
if not times:
continue
times = [time.struct_time(t + (0, 0, 0)) for t in times]
thresholds = [calendar.timegm(t) for t in times]
thresholds = np.array([calendar.timegm(t) for t in times])
labels = [time.strftime(fmt, t) for t in times]
short_labels = _simplified_labels(labels)
if place == 2 and step >= 7:
3 changes: 2 additions & 1 deletion Orange/preprocess/tests/test_discretize.py
Original file line number Diff line number Diff line change
@@ -39,7 +39,8 @@ def tr(ss):

def testbin(start, end):
bins = _time_binnings(create(*start), create(*end), 3, 51)
return [(bin.width_label, tr(bin.short_labels), bin.thresholds)
return [(bin.width_label, tr(bin.short_labels),
list(bin.thresholds))
for bin in reversed(bins)]

self.assertEqual(