Skip to content

Commit

Permalink
make jedi method extract_tar static, clean up comments, correct typo (N…
Browse files Browse the repository at this point in the history
  • Loading branch information
RussTreadon-NOAA committed Sep 18, 2024
1 parent 80305b6 commit 821ee76
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ush/python/pygfs/jedi/jedi.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,10 @@ def get_bias_dict(self, task_config: AttrDict, bias_file) -> Dict[str, Any]:

return bias_dict

@staticmethod
@logit(logger)
def extract_tar(self, tar_file: str) -> None:
"""Extract bias correction files from a tarball
def extract_tar(tar_file: str) -> None:
"""Extract files from a tarball
This method extract files from a tarball
Expand All @@ -254,14 +255,14 @@ def extract_tar(self, tar_file: str) -> None:
tarball.extractall(path=tar_path)
logger.info(f"Extract {tarball.getnames()}")
except tarfile.ReadError as err:
if tarfile.is_tarfile(tarfile[1]):
logger.error(f"FATAL ERROR: {tarfile[1]} could not be read")
raise tarfile.ReadError(f"FATAL ERROR: unable to read {tarfile[1]}")
if tarfile.is_tarfile(tar_file):
logger.error(f"FATAL ERROR: {tar_file} could not be read")
raise tarfile.ReadError(f"FATAL ERROR: unable to read {tar_file}")
else:
logger.info()
except tarfile.ExtractError as err:
logger.exception(f"FATAL ERROR: unable to extract from {tarfile[1]}")
raise tarfile.ExtractError("FATAL ERROR: unable to extract from {tarfile[1]}")
logger.exception(f"FATAL ERROR: unable to extract from {tar_file}")
raise tarfile.ExtractError("FATAL ERROR: unable to extract from {tar_file}")


@logit(logger)
Expand Down

0 comments on commit 821ee76

Please sign in to comment.