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

[ENH] Distances: Offload work to a separate thread #4046

Merged
merged 7 commits into from
Dec 13, 2019

Conversation

VesnaT
Copy link
Contributor

@VesnaT VesnaT commented Sep 23, 2019

Issue

Partially fixes #3810.

Description of changes

Distance calculation now runs in a separate thread.
It is only possible to interrupt the Euclidean distance by now. Other distances will be adopted once the changes are approved.

Includes
  • Code changes
  • Tests
  • Documentation

@codecov
Copy link

codecov bot commented Sep 23, 2019

Codecov Report

Merging #4046 into master will increase coverage by 0.02%.
The diff coverage is 96.94%.

@@            Coverage Diff             @@
##           master    #4046      +/-   ##
==========================================
+ Coverage    86.2%   86.22%   +0.02%     
==========================================
  Files         396      396              
  Lines       70437    70609     +172     
==========================================
+ Hits        60718    60885     +167     
- Misses       9719     9724       +5

@janezd janezd self-assigned this Oct 11, 2019
Copy link
Contributor

@janezd janezd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This slows down the widget significantly. Iteration over rows must remain in Cython code, with callback every now and then.

Callbacks shouldn't happen in every row (because it involves calling Python code). Perhaps call it 100 times, that is, every n_rows / 100 rows.

Orange/widgets/unsupervised/owdistances.py Show resolved Hide resolved
@janezd janezd removed their assignment Oct 11, 2019
@VesnaT VesnaT changed the title [ENH] Distances: Offload work to a separate thread [WIP][ENH] Distances: Offload work to a separate thread Oct 14, 2019
@VesnaT VesnaT force-pushed the concurrent_distances branch from 6da8b7e to 5fd4e26 Compare November 28, 2019 13:24
@VesnaT VesnaT changed the title [WIP][ENH] Distances: Offload work to a separate thread [ENH] Distances: Offload work to a separate thread Nov 28, 2019
@VesnaT VesnaT force-pushed the concurrent_distances branch 2 times, most recently from 160d5da to e7bd4cb Compare November 29, 2019 07:08
@janezd janezd self-assigned this Nov 29, 2019
Orange/distance/_distance.pyx Outdated Show resolved Hide resolved
Orange/distance/_distance.pyx Outdated Show resolved Hide resolved
Orange/distance/_distance.pyx Outdated Show resolved Hide resolved
Orange/distance/distance.py Outdated Show resolved Hide resolved
Orange/distance/distance.py Outdated Show resolved Hide resolved
Orange/distance/distance.py Outdated Show resolved Hide resolved
@VesnaT VesnaT force-pushed the concurrent_distances branch 2 times, most recently from 369fb40 to 702ada0 Compare November 29, 2019 13:07
@VesnaT VesnaT changed the title [ENH] Distances: Offload work to a separate thread [WIP][ENH] Distances: Offload work to a separate thread Nov 29, 2019
@VesnaT VesnaT force-pushed the concurrent_distances branch from 702ada0 to cb0431a Compare December 5, 2019 08:29
@VesnaT VesnaT changed the title [WIP][ENH] Distances: Offload work to a separate thread [ENH] Distances: Offload work to a separate thread Dec 5, 2019
@janezd
Copy link
Contributor

janezd commented Dec 5, 2019

Please rebase to current master, which fixes the failed tests caused by changes in sklearn 0.22.

@VesnaT VesnaT force-pushed the concurrent_distances branch from cb0431a to f2071ec Compare December 6, 2019 10:05
@VesnaT VesnaT changed the title [ENH] Distances: Offload work to a separate thread [WIP][ENH] Distances: Offload work to a separate thread Dec 9, 2019
@VesnaT VesnaT force-pushed the concurrent_distances branch from f2071ec to 93e8266 Compare December 9, 2019 10:15
@VesnaT VesnaT changed the title [WIP][ENH] Distances: Offload work to a separate thread [ENH] Distances: Offload work to a separate thread Dec 9, 2019
@VesnaT VesnaT force-pushed the concurrent_distances branch from c910e48 to c10ce62 Compare December 11, 2019 07:03
@janezd janezd merged commit 3eb28ee into biolab:master Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Distance widget should compute in a new thread
2 participants