Skip to content

Commit a2fab26

Browse files
committed
Autopep8 formatting
1 parent 343abdc commit a2fab26

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

graphchain/core.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(
2727
key: Hashable,
2828
computation: Any,
2929
location: Union[str, fs.base.FS],
30-
write_to_cache: Union[bool, str]='auto') -> None:
30+
write_to_cache: Union[bool, str] = 'auto') -> None:
3131
"""Cache a dask graph computation.
3232
3333
Parameters
@@ -154,7 +154,7 @@ def write_log(self, log_type: str) -> None:
154154
with self.cache_fs.open(log_filename, 'w') as fid: # type: ignore
155155
fid.write(self.hash)
156156

157-
def time_to_result(self, memoize: bool=True) -> float:
157+
def time_to_result(self, memoize: bool = True) -> float:
158158
"""Estimate the time to load or compute this computation."""
159159
if hasattr(self, '_time_to_result'):
160160
return self._time_to_result # type: ignore
@@ -287,9 +287,9 @@ def __call__(self, *args: Any, **kwargs: Any) -> Any:
287287

288288
def optimize(
289289
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:
293293
"""Optimize a dask graph with cached computations.
294294
295295
According to the dask graph specification [1]_, a dask graph is a
@@ -363,9 +363,9 @@ def optimize(
363363
def get(
364364
dsk: dict,
365365
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:
369369
"""Get one or more keys from a dask graph with caching.
370370
371371
Optimizes a dask graph with ``graphchain.optimize`` and then computes the

graphchain/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def _fast_get_size(obj: Any) -> int:
2323
raise TypeError('Could not determine size of the given object.')
2424

2525

26-
def _slow_get_size(obj: Any, seen: Optional[set]=None) -> int:
26+
def _slow_get_size(obj: Any, seen: Optional[set] = None) -> int:
2727
size = sys.getsizeof(obj)
2828
seen = seen or set()
2929
obj_id = id(obj)
@@ -41,7 +41,7 @@ def _slow_get_size(obj: Any, seen: Optional[set]=None) -> int:
4141
return size
4242

4343

44-
def get_size(obj: Any, seen: Optional[set]=None) -> int:
44+
def get_size(obj: Any, seen: Optional[set] = None) -> int:
4545
"""Recursively compute the size of an object.
4646
4747
Parameters

0 commit comments

Comments
 (0)