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

feat: deprecate use_thread #949

Open
wants to merge 1 commit into
base: 12-23-chore_explicitly_re-export_components
Choose a base branch
from

Conversation

iisakkirotko
Copy link
Collaborator

All Submissions:

Changes to / New Features:

  • I included docs for (the changes to) my feature.

Description of changes

Deprecate use_thread in favour of use_task and Task.

Closes #784

Copy link
Collaborator Author

iisakkirotko commented Dec 23, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

@maartenbreddels maartenbreddels left a comment

Choose a reason for hiding this comment

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

Cool, I think in this PR we should also export use_task/task from the solara namespace, and maybe also have wrapper functions in solara.lab.use_task to warn that it's not in lab anymore?

Also, I think the default argument for dependencies for use_task should be None, so that it does not execute by default (this make the default use_task and task more similar)

solara/util.py Outdated
def decorator(func):
@functools.wraps(func)
def wrapped(*args, **kwargs):
warnings.simplefilter("always", DeprecationWarning)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should call this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The reason this was originally included is that Python doesn't show DeprecationWarnings by default. However, it seems that it is recommended to use FutureWarning for warnings that you want users to see (as per scikit learn), so I made the warning category configurable by default instead.

@iisakkirotko iisakkirotko force-pushed the 12-23-feat_deprecate_use_thread branch from 5e49cc6 to 1c1a375 Compare December 23, 2024 12:58
@iisakkirotko iisakkirotko force-pushed the 12-23-feat_change_mutation_detection_and_allow_reactive_boolean_defaults branch from 3a90256 to 3cdb9d4 Compare December 23, 2024 15:52
@iisakkirotko iisakkirotko force-pushed the 12-23-feat_change_mutation_detection_and_allow_reactive_boolean_defaults branch from 3cdb9d4 to 03b2dcd Compare December 27, 2024 12:56
@iisakkirotko iisakkirotko force-pushed the 12-23-feat_deprecate_use_thread branch from 1c1a375 to f16af91 Compare December 27, 2024 12:56
@iisakkirotko iisakkirotko changed the base branch from 12-23-feat_change_mutation_detection_and_allow_reactive_boolean_defaults to 12-23-chore_explicitly_re-export_components December 27, 2024 12:56
@iisakkirotko iisakkirotko added this to the Solara 2.0 milestone Dec 27, 2024
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.

2 participants