From e2ad89f90ffcaa4949bbcc15428d690ae206fb7f Mon Sep 17 00:00:00 2001 From: Jeff Klenzing Date: Mon, 30 Oct 2023 16:27:02 -0400 Subject: [PATCH] STY: remove gzip --- pysatNASA/instruments/methods/cdaweb.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pysatNASA/instruments/methods/cdaweb.py b/pysatNASA/instruments/methods/cdaweb.py index 47321cdb..2564fa24 100644 --- a/pysatNASA/instruments/methods/cdaweb.py +++ b/pysatNASA/instruments/methods/cdaweb.py @@ -8,7 +8,6 @@ """ import datetime as dt -import gzip import numpy as np import os import pandas as pds @@ -600,7 +599,7 @@ def get_file(remote_file, data_path, fname, temp_path=None, zip_method=None): temp_path : str Path to temporary directory. (Default=None) zip_method : str - The method used to zip the file. Supports 'gzip', 'zip', and None. + The method used to zip the file. Supports 'zip' and None. If None, downloads files directly. (default=None) """ @@ -617,13 +616,7 @@ def get_file(remote_file, data_path, fname, temp_path=None, zip_method=None): open_f.write(remote_file) # Unzip and move the files from the temporary directory. - if zip_method == 'gzip': - local_fname = os.path.join(data_path, fname).replace('.gz', '') - with gzip.open(dl_fname) as open_zip: - with open(local_fname, 'wb') as open_f: - open_f.write(open_zip.read()) - - elif zip_method == 'zip': + if zip_method == 'zip': with zipfile.ZipFile(dl_fname, 'r') as open_zip: open_zip.extractall(data_path)