ahuang11 / streamjoy

🌈😊 Enjoy animating images into GIFs and MP4s in parallel!
https://ahuang11.github.io/streamjoy/
MIT License
51 stars 2 forks source link

import stream __init__() unexpected argument 'check_exists' #44

Closed apurba-biswas closed 5 months ago

apurba-biswas commented 6 months ago

Wanted to start using streamjoy after looking at your NMME forecast example to produce something similar. Started of with your minimum working project:

Initial hurdle after pip installing steamjoy

# Traceback / Example
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[2], line 1
----> 1 from streamjoy import stream

File ~/miniconda3/envs/cda/lib/python3.11/site-packages/streamjoy/__init__.py:4
      1 import logging
      3 from ._utils import update_logger
----> 4 from .core import connect, stream
      5 from .models import ImageText, Paused
      6 from .renderers import (
      7     default_holoviews_renderer,
      8     default_pandas_renderer,
      9     default_xarray_renderer,
     10 )

File ~/miniconda3/envs/cda/lib/python3.11/site-packages/streamjoy/core.py:7
      4 from pathlib import Path
      5 from typing import Any, Callable, Literal
----> 7 from . import streams
      8 from .serializers import serialize_appropriately
      9 from .settings import extension_handlers

File ~/miniconda3/envs/cda/lib/python3.11/site-packages/streamjoy/streams.py:64
     60     except ImportError:
     61         pn = None
---> 64 class MediaStream(param.Parameterized):
     65     """
     66     An abstract class for creating media streams from various resources.
     67     Do not use this class directly; use either GifStream or Mp4Stream.
     68 
     69     Expand Source code to see all the parameters and descriptions.
     70     """
     72     resources = param.List(
     73         default=None,
     74         doc="The resources to render.",
     75     )

File ~/miniconda3/envs/cda/lib/python3.11/site-packages/streamjoy/streams.py:177, in MediaStream()
    166 threads_per_worker = param.Integer(
    167     default=None,
    168     bounds=(1, None),
    169     doc="The number of threads to use per worker.",
    170 )
    172 show_progress = param.Boolean(
    173     default=True,
    174     doc="Whether to show the progress bar when rendering.",
    175 )
--> 177 scratch_dir = param.Path(
    178     doc="The directory to use for temporary files.", check_exists=False
    179 )
    181 in_memory = param.Boolean(
    182     doc="Whether to store intermediate results in memory.",
    183 )
    185 fsspec_fs = param.Parameter(
    186     doc="The fsspec filesystem to use for reading and writing.",
    187 )

File ~/miniconda3/envs/cda/lib/python3.11/site-packages/param/__init__.py:1779, in Path.__init__(self, default, search_paths, **params)
   1776     search_paths = []
   1778 self.search_paths = search_paths
-> 1779 super(Path,self).__init__(default,**params)

TypeError: Parameter.__init__() got an unexpected keyword argument 'check_exists'
ahuang11 commented 5 months ago

I just saw this so I apologize for the late reply.

I think you might need to upgrade param pip install -U param and I can also pin param. https://github.com/ahuang11/streamjoy/commit/ed2fd22cfed198ed9770fe48933bf28b5c06674c

Thanks for the report!