From edd94ef4e48e6b26615719239ebba8f89ac2293a Mon Sep 17 00:00:00 2001 From: Dave Tromp Date: Tue, 12 Sep 2023 09:12:27 +0200 Subject: [PATCH 1/4] add unzip == True as condition for unzipping files --- datahugger/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datahugger/base.py b/datahugger/base.py index 77de4f7..55a145b 100644 --- a/datahugger/base.py +++ b/datahugger/base.py @@ -319,7 +319,7 @@ def _get( output_folder: Union[Path, str], **kwargs, ): - if len(self.files) == 1 and self.files[0]["link"].endswith(".zip"): + if len(self.files) == 1 and self.files[0]["link"].endswith(".zip") and self.unzip==True: self._unpack_single_folder(self.files[0]["link"], output_folder) return From 6cb9b87065e6d0294e4d4fae006d21e6f7dffaff Mon Sep 17 00:00:00 2001 From: Dave Tromp Date: Tue, 12 Sep 2023 09:19:20 +0200 Subject: [PATCH 2/4] update the documentation --- docs/options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/options.md b/docs/options.md index 71302eb..64f4c7b 100644 --- a/docs/options.md +++ b/docs/options.md @@ -36,7 +36,7 @@ Disable auto unzip function ``` python - datahugger.get("10.5061/dryad.x3ffbg7m8", "data", auto_unzip=False) + datahugger.get("10.5061/dryad.x3ffbg7m8", "data", unzip=False) ``` From 52a466c2222fa54204fc2c762f1c358d7fd89d96 Mon Sep 17 00:00:00 2001 From: Jonathan de Bruin Date: Thu, 14 Sep 2023 13:38:23 +0200 Subject: [PATCH 3/4] Update datahugger/base.py --- datahugger/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datahugger/base.py b/datahugger/base.py index a0f0e4a..82792b6 100644 --- a/datahugger/base.py +++ b/datahugger/base.py @@ -339,7 +339,7 @@ def _get( output_folder: Union[Path, str], **kwargs, ): - if len(self.files) == 1 and self.files[0]["link"].endswith(".zip") and self.unzip==True: + if len(self.files) == 1 and self.files[0]["link"].endswith(".zip") and self.unzip: self._unpack_single_folder(self.files[0]["link"], output_folder) return From bf26b3d618bb8a019ad880dc87e0ee4250b71ff2 Mon Sep 17 00:00:00 2001 From: Jonathan de Bruin Date: Thu, 14 Sep 2023 13:41:13 +0200 Subject: [PATCH 4/4] Fix lint error --- datahugger/base.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/datahugger/base.py b/datahugger/base.py index 82792b6..8c2c469 100644 --- a/datahugger/base.py +++ b/datahugger/base.py @@ -339,7 +339,11 @@ def _get( output_folder: Union[Path, str], **kwargs, ): - if len(self.files) == 1 and self.files[0]["link"].endswith(".zip") and self.unzip: + if ( + len(self.files) == 1 + and self.files[0]["link"].endswith(".zip") + and self.unzip + ): self._unpack_single_folder(self.files[0]["link"], output_folder) return