diff --git a/.github/workflows/pysat_rc.yml b/.github/workflows/pysat_rc.yml index dd5744da..53cd960a 100644 --- a/.github/workflows/pysat_rc.yml +++ b/.github/workflows/pysat_rc.yml @@ -6,7 +6,7 @@ name: Test with pysat ecosystem RCs -on: [workflow_dispatch] +on: [push] jobs: build: diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d770638..29a733f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ Change Log All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). -[0.2.0] - 2022-XX-XX +[0.2.0] - 2023-XX-XX -------------------- * Added support for access to TIEGCM models from the ICON mission * Maintenance diff --git a/pysatModels/models/ucar_tiegcm.py b/pysatModels/models/ucar_tiegcm.py index ec53dce0..2538ceb8 100644 --- a/pysatModels/models/ucar_tiegcm.py +++ b/pysatModels/models/ucar_tiegcm.py @@ -26,9 +26,7 @@ import functools import os import pandas as pds -import tempfile import warnings -import zipfile import pysat @@ -211,10 +209,11 @@ def load(fnames, tag='', inst_id='', **kwargs): '': {'icon': {'remote_dir': '/pub/data/icon/l4/tiegcm/{year:04d}/', 'fname': ''.join(['icon_l4-3_tiegcm_{year:04d}-{month:02d}-', '{day:02d}_v{version:02d}r{revision:03d}', - '.zip'])}}} + '.zip']), + 'zip_method': 'zip'}}} -def download(date_array, tag, inst_id, data_path=None, **kwargs): +def download(date_array, tag, inst_id, data_path, **kwargs): """Download UCAR TIE-GCM from NASA CDAWeb. Parameters @@ -229,7 +228,7 @@ def download(date_array, tag, inst_id, data_path=None, **kwargs): Instrument ID string identifier used for particular dataset. This input is provided by pysat. data_path : str or NoneType - Path to directory to download data to. (default=None) + Path to directory to download data to. **kwargs : dict Additional keywords supplied by user when invoking the download routine attached to a pysat.Instrument object are passed to this @@ -246,29 +245,9 @@ def download(date_array, tag, inst_id, data_path=None, **kwargs): warnings.warn('Not implemented, currently no support for Globus.') # TODO(#132): Ensure new download routine is used after pysatNASA release. elif tag == 'icon': - warnings.warn('Not implemented, requires pysatNASA 0.0.6.') - elif tag == 'future_icon': - # Set up temporary directory for zip files - temp_dir = tempfile.TemporaryDirectory() - - # Download using NASA CDAWeb methods in pysatNASA - cdw.download(date_array, tag, inst_id, data_path=temp_dir.name, + cdw.download(date_array, tag=tag, inst_id=inst_id, data_path=data_path, supported_tags=download_tags) - # Get a list of files in `temp_dir` - dl_files = pysat.Files.from_os( - temp_dir.name, format_str=download_tags[inst_id][tag]['fname']) - - # Decompress files - for dl_fname in dl_files.values: - dl_fname = os.path.split(dl_fname)[1] - with zipfile.ZipFile(os.path.join(temp_dir.name, dl_fname), - 'r') as open_zip: - open_zip.extractall(data_path) - - # Cleanup temporary directory - temp_dir.cleanup() - return