Skip to content

Commit

Permalink
Undo digital typhoon changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart committed Aug 30, 2024
1 parent c883ee1 commit 73320c6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions torchgeo/datasets/digital_typhoon.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import glob
import os
import tarfile
from collections.abc import Callable, Sequence
from typing import Any, ClassVar, TypedDict

Expand All @@ -16,13 +17,7 @@

from .errors import DatasetNotFoundError
from .geo import NonGeoDataset
from .utils import (
Path,
download_url,
extract_archive,
lazy_import,
percentile_normalization,
)
from .utils import Path, download_url, lazy_import, percentile_normalization


class _SampleSequenceDict(TypedDict):
Expand Down Expand Up @@ -409,7 +404,10 @@ def _extract(self) -> None:
"""Extract the dataset."""
# Extract tarball
for suffix in self.md5sums.keys():
extract_archive(os.path.join(self.root, f'{self.data_root}.tar.gz{suffix}'))
with tarfile.open(
os.path.join(self.root, f'{self.data_root}.tar.gz{suffix}')
) as tar:
tar.extractall(path=self.root)

def plot(
self,
Expand Down

0 comments on commit 73320c6

Please sign in to comment.