Skip to content

Commit

Permalink
Remove widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
anayden committed Dec 28, 2023
1 parent 4745626 commit 07d3bc2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ print(job.results['fasta'])
Using the widget via Jupyter Notebook:

```jupyter
!pip install r2dt_client[widget]
!pip install r2dt_client
from r2dt_client import setup, draw
Expand Down
8 changes: 2 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ dependencies = [
"diskcache<6.0.0,>=5.6.3",
"httpx<1.0.0,>=0.26.0",
"yarl<2.0.0,>=1.9.4",
"ipython",
"ipywidgets",
]
requires-python = ">=3.9,<4.0"
readme = "README.md"
Expand All @@ -24,12 +26,6 @@ Changelog = "https://github.com/anayden/r2dt-client/releases"
homepage = "https://github.com/anayden/r2dt-client"
repository = "https://github.com/anayden/r2dt-client"

[project.optional-dependencies]
widgets = [
"ipython",
"ipywidgets",
]

[tool.pdm]
package-type = "library"

Expand Down
21 changes: 3 additions & 18 deletions src/r2dt_client/widgets/widget.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import threading
import time


try:
from IPython.display import clear_output # type: ignore
from IPython.display import display # type: ignore
from ipywidgets import ValueWidget # type: ignore

_HAS_IPYWIDGETS = True
except ImportError:
_HAS_IPYWIDGETS = False
from IPython.display import clear_output # type: ignore
from IPython.display import display # type: ignore
from ipywidgets import ValueWidget # type: ignore

from r2dt_client import fetch_results_for
from r2dt_client import submit
Expand Down Expand Up @@ -37,15 +31,6 @@ def _display_svg(svg_content):


def draw(sequence: str) -> None:
if not _HAS_IPYWIDGETS:
print(
"This function is only available in Jupyter Notebook and "
"after installing the library with 'pip install "
"r2dt_client[widgets]'\nConsider using standard API - submit, "
"update_status_for, fetch_results_for - instead."
)
return

job = submit(sequence)

spinner = _display_spinner()
Expand Down

0 comments on commit 07d3bc2

Please sign in to comment.