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] Outliers: Offload work onto separate thread #4412

Merged
merged 6 commits into from
Feb 21, 2020

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

@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
@@ -101,7 +102,7 @@ def fit_storage(self, data):
X, Y, W = data.X, data.Y, data.W if data.has_weights() else None
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
@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