Skip to content

Commit

Permalink
Silence test warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart committed Aug 30, 2024
1 parent ea7dd01 commit c883ee1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,14 @@ filterwarnings = [
"ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning",
"ignore:pkg_resources is deprecated as an API.:DeprecationWarning:lightning_utilities.core.imports",
"ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated:DeprecationWarning:jsonargparse",
"ignore:`ModuleAvailableCache` is a special case of `RequirementCache`.:DeprecationWarning:lightning.fabric.plugins.environments.xla",
# https://github.com/pytorch/pytorch/issues/110549
"ignore:allow_ops_in_compiled_graph failed to import torch:ImportWarning:einops",
# https://github.com/rr-/docstring_parser/pull/82
"ignore:ast.* is deprecated and will be removed in Python 3.14:DeprecationWarning:docstring_parser.attrdoc",
# https://github.com/python/cpython/pull/102953
"ignore:Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata:DeprecationWarning:torchgeo.datasets.utils",
"ignore:Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata:DeprecationWarning:torchvision.datasets.utils",
# https://github.com/kornia/kornia/pull/2967
"ignore:`torch.cuda.amp.custom_fwd\\(args...\\)` is deprecated.:FutureWarning:kornia.feature.lightglue",
# https://github.com/kornia/kornia/pull/2981
Expand Down
14 changes: 8 additions & 6 deletions torchgeo/datasets/digital_typhoon.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

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

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

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


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

def plot(
self,
Expand Down

0 comments on commit c883ee1

Please sign in to comment.