Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions skore/src/skore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"PredictionErrorDisplay",
"Project",
"RocCurveDisplay",
"THREADABLE",
"TableReportDisplay",
"TrainTestSplit",
"compare",
Expand All @@ -98,3 +99,15 @@
# Waiting for the merge of https://github.com/Textualize/rich/pull/4104.
force_jupyter=(is_environment_notebook_like() or None),
)


try:
from threading import Thread

thread = Thread()
thread.start()
thread.join()
except Exception:
THREADABLE = False
else:
THREADABLE = True
Comment thread
glemaitre marked this conversation as resolved.
3 changes: 2 additions & 1 deletion skore/src/skore/_utils/_progress_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ProgressBar:
"""Simplified progress bar based on ``rich.Progress``."""

def __init__(self, description: str, total: float | None):
from skore import console
from skore import THREADABLE, console
from skore._config import configuration

progress = Progress(
Expand All @@ -26,6 +26,7 @@ def __init__(self, description: str, total: float | None):
console=console,
expand=False,
transient=True,
auto_refresh=THREADABLE,
disable=(not configuration.show_progress),
)

Expand Down
Loading