Skip to content

Commit

Permalink
Merge pull request #6656 from markotoplak/edit-tests
Browse files Browse the repository at this point in the history
Edit beta tests slightly, fix a failing test
  • Loading branch information
janezd authored Dec 8, 2023
2 parents b932914 + 8351d7f commit ce4ad61
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Orange/widgets/data/owcorrelations.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def get_clusters_of_attributes(self):
:return: generator of attributes grouped by cluster
"""
data = Normalize()(self.data).X.T
kmeans = KMeans(n_clusters=self.n_clusters, random_state=0).fit(data)
kmeans = KMeans(n_clusters=self.n_clusters, random_state=0, n_init=1).fit(data)
labels_attrs = sorted([(l, i) for i, l in enumerate(kmeans.labels_)])
return [Cluster(instances=list(pair[1] for pair in group),
centroid=kmeans.cluster_centers_[l])
Expand Down
2 changes: 1 addition & 1 deletion Orange/widgets/data/tests/test_owcorrelations.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def test_get_clusters_of_attributes(self):
clusters = self.heuristic.get_clusters_of_attributes()
# results depend on scikit-learn k-means implementation
result = sorted([c.instances for c in clusters])
self.assertListEqual([[0], [1, 2, 3, 4, 5, 6, 7], [8]],
self.assertListEqual([[0, 3, 5], [1, 2, 6, 7], [4, 8]],
result)

def test_get_states(self):
Expand Down
7 changes: 3 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ deps =
coverage
psycopg2-binary
pymssql<3.0
latest: https://github.com/pyqtgraph/pyqtgraph/archive/refs/heads/master.zip#egg=pyqtgraph
latest: https://github.com/biolab/orange-canvas-core/archive/refs/heads/master.zip#egg=orange-canvas-core
latest: https://github.com/biolab/orange-widget-base/archive/refs/heads/master.zip#egg=orange-widget-base
# GUI requirements
Expand Down Expand Up @@ -91,9 +90,9 @@ setenv =
PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
PIP_PRE=1
deps =
latest: https://github.com/pyqtgraph/pyqtgraph/archive/refs/heads/master.zip#egg=pyqtgraph
latest: https://github.com/biolab/orange-canvas-core/archive/refs/heads/master.zip#egg=orange-canvas-core
latest: https://github.com/biolab/orange-widget-base/archive/refs/heads/master.zip#egg=orange-widget-base
https://github.com/pyqtgraph/pyqtgraph/archive/refs/heads/master.zip#egg=pyqtgraph
https://github.com/biolab/orange-canvas-core/archive/refs/heads/master.zip#egg=orange-canvas-core
https://github.com/biolab/orange-widget-base/archive/refs/heads/master.zip#egg=orange-widget-base
PyQt6==6.5.*
PyQt6-Qt6==6.5.*
PyQt6-WebEngine==6.5.*
Expand Down

0 comments on commit ce4ad61

Please sign in to comment.