Skip to content

Commit 1c87e78

Browse files
committed
Fix non-required imports
1 parent edc25e1 commit 1c87e78

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

streamjoy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .streams import GifStream, Mp4Stream
1313
from .wrappers import wrap_holoviews, wrap_matplotlib
1414

15-
__version__ = "0.0.3"
15+
__version__ = "0.0.4"
1616

1717
__all__ = [
1818
"GifStream",

streamjoy/serializers.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
from pathlib import Path
66
from typing import TYPE_CHECKING, Any, Callable
77

8-
import holoviews as hv
98
import numpy as np
10-
import pandas as pd
11-
import polars as pl
12-
import xarray as xr
139

1410
from . import _utils
1511
from .models import Serialized
@@ -23,6 +19,26 @@
2319
from .wrappers import wrap_holoviews, wrap_matplotlib
2420

2521
if TYPE_CHECKING:
22+
try:
23+
import pandas as pd
24+
except ImportError:
25+
pd = None
26+
27+
try:
28+
import polars as pl
29+
except ImportError:
30+
pl = None
31+
32+
try:
33+
import xarray as xr
34+
except ImportError:
35+
xr = None
36+
37+
try:
38+
import holoviews as hv
39+
except ImportError:
40+
hv = None
41+
2642
from .streams import MediaStream
2743

2844

0 commit comments

Comments
 (0)