@@ -27,7 +27,7 @@ def __init__(
27
27
key : Hashable ,
28
28
computation : Any ,
29
29
location : Union [str , fs .base .FS ],
30
- write_to_cache : Union [bool , str ]= 'auto' ) -> None :
30
+ write_to_cache : Union [bool , str ] = 'auto' ) -> None :
31
31
"""Cache a dask graph computation.
32
32
33
33
Parameters
@@ -154,7 +154,7 @@ def write_log(self, log_type: str) -> None:
154
154
with self .cache_fs .open (log_filename , 'w' ) as fid : # type: ignore
155
155
fid .write (self .hash )
156
156
157
- def time_to_result (self , memoize : bool = True ) -> float :
157
+ def time_to_result (self , memoize : bool = True ) -> float :
158
158
"""Estimate the time to load or compute this computation."""
159
159
if hasattr (self , '_time_to_result' ):
160
160
return self ._time_to_result # type: ignore
@@ -287,9 +287,9 @@ def __call__(self, *args: Any, **kwargs: Any) -> Any:
287
287
288
288
def optimize (
289
289
dsk : dict ,
290
- keys : Optional [Union [Hashable , Iterable [Hashable ]]]= None ,
291
- skip_keys : Optional [Container [Hashable ]]= None ,
292
- location : Union [str , fs .base .FS ]= "./__graphchain_cache__" ) -> dict :
290
+ keys : Optional [Union [Hashable , Iterable [Hashable ]]] = None ,
291
+ skip_keys : Optional [Container [Hashable ]] = None ,
292
+ location : Union [str , fs .base .FS ] = "./__graphchain_cache__" ) -> dict :
293
293
"""Optimize a dask graph with cached computations.
294
294
295
295
According to the dask graph specification [1]_, a dask graph is a
@@ -363,9 +363,9 @@ def optimize(
363
363
def get (
364
364
dsk : dict ,
365
365
keys : Union [Hashable , Iterable [Hashable ]],
366
- skip_keys : Optional [Container [Hashable ]]= None ,
367
- location : Union [str , fs .base .FS ]= "./__graphchain_cache__" ,
368
- scheduler : Optional [Callable ]= None ) -> Any :
366
+ skip_keys : Optional [Container [Hashable ]] = None ,
367
+ location : Union [str , fs .base .FS ] = "./__graphchain_cache__" ,
368
+ scheduler : Optional [Callable ] = None ) -> Any :
369
369
"""Get one or more keys from a dask graph with caching.
370
370
371
371
Optimizes a dask graph with ``graphchain.optimize`` and then computes the
0 commit comments