Skip to content

[ENH] Outliers: Offload work onto separate thread#4412

Merged
markotoplak merged 6 commits intobiolab:masterfrom
VesnaT:outliers_concurrent
Feb 21, 2020
Merged

[ENH] Outliers: Offload work onto separate thread#4412
markotoplak merged 6 commits intobiolab:masterfrom
VesnaT:outliers_concurrent

Conversation

@VesnaT
Copy link
Contributor

@VesnaT VesnaT commented Feb 12, 2020

Issue

Responsive Outliers widget: the widget could make calculations in a separate thread to make Orange responsive.

Description of changes
  • Create a progress_callback function that serves as a wrapper function for callbacks. It allocates the corresponding proportion of the progress to the callback.
  • Add callback to Learner to enable preprocessing interruption.
  • Add callback to _OutlierModel.
  • Do work in a separate thread.
  • Still impossible to terminate the fit/predict operations.
Includes
  • Code changes
  • Tests
  • Documentation

@VesnaT VesnaT force-pushed the outliers_concurrent branch 2 times, most recently from e019f32 to 390108f Compare February 12, 2020 11:32
@codecov
Copy link

codecov bot commented Feb 12, 2020

Codecov Report

Merging #4412 into master will decrease coverage by <.01%.
The diff coverage is 91.52%.

@@            Coverage Diff             @@
##           master    #4412      +/-   ##
==========================================
- Coverage   87.46%   87.45%   -0.01%     
==========================================
  Files         405      405              
  Lines       73968    74118     +150     
==========================================
+ Hits        64693    64817     +124     
- Misses       9275     9301      +26

@VesnaT VesnaT force-pushed the outliers_concurrent branch from 390108f to 32b48e8 Compare February 12, 2020 12:48
@markotoplak
Copy link
Member

Thank you @VesnaT, I like it a lot!

@markotoplak markotoplak added the needs discussion Core developers need to discuss the issue label Feb 12, 2020
@janezd janezd self-assigned this Feb 14, 2020
Orange/base.py Outdated
return self.fit(X, Y, W)

def __call__(self, data):
def __call__(self, data, callback=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

I glanced over this PR. The only thing I don't like is the name of the argument. callback can be anything. Perhaps progress_callback? Longer, but more informative.

@janezd janezd removed their assignment Feb 14, 2020
@janezd janezd removed the needs discussion Core developers need to discuss the issue label Feb 14, 2020
@VesnaT VesnaT force-pushed the outliers_concurrent branch from 32b48e8 to 752abbd Compare February 21, 2020 12:48
@markotoplak markotoplak merged commit 23bcffc into biolab:master Feb 21, 2020
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.

3 participants