Skip to content

Commit

Permalink
Code review: minor typing etc recommendations
Browse files Browse the repository at this point in the history
Co-authored-by: John T. Wodder II <jwodder@users.noreply.github.com>
  • Loading branch information
yarikoptic and jwodder authored May 20, 2024
1 parent b17aa63 commit 08a4050
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dandi/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def agg_done(self, done_sizes: Iterator[int]) -> list[str]:


def _skip_file(msg: Any, **kwargs: Any) -> dict:
return dict(**kwargs, status="skipped", message=str(msg))
return {"status": "skipped", "message": str(msg), **kwargs}


def _populate_dandiset_yaml(
Expand Down Expand Up @@ -995,7 +995,7 @@ class DownloadProgress:
@dataclass
class ProgressCombiner:
zarr_size: int
file_qty: int = -1 # set to specific known value whenever full sweep is complete
file_qty: int | None = None # set to specific known value whenever full sweep is complete
files: dict[str, DownloadProgress] = field(default_factory=dict)
#: Total size of all files that were not skipped and did not error out
#: during download
Expand Down Expand Up @@ -1045,7 +1045,7 @@ def set_status(self, statusdict: dict) -> None:
state_qtys = Counter(s.state for s in self.files.values())
total = len(self.files)
if (
self.file_qty >= 0 # if already known
self.file_qty is not None # if already known
and total == self.file_qty
and state_qtys[DLState.STARTING] == state_qtys[DLState.DOWNLOADING] == 0
):
Expand Down

0 comments on commit 08a4050

Please sign in to comment.