Skip to content

Commit

Permalink
FIX: Fixes call of pyart to supress warning. (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
zssherman authored Dec 5, 2022
1 parent 47e47bc commit 0f4f956
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 4 additions & 3 deletions act/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
""" Unit tests for ACT utils module. """

import importlib
import tempfile
from datetime import datetime
from pathlib import Path
Expand All @@ -15,10 +16,10 @@

import act

try:
import pyart
spec = importlib.util.find_spec('pyart')
if spec is not None:
PYART_AVAILABLE = True
except ImportError:
else:
PYART_AVAILABLE = False


Expand Down
9 changes: 6 additions & 3 deletions act/utils/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

import importlib
import warnings

import metpy
Expand All @@ -11,10 +12,10 @@
import scipy.stats as stats
import xarray as xr

try:
import pyart
spec = importlib.util.find_spec('pyart')
if spec is not None:
PYART_AVAILABLE = True
except ImportError:
else:
PYART_AVAILABLE = False


Expand Down Expand Up @@ -585,6 +586,8 @@ def create_pyart_obj(
raise ImportError(
'Py-ART needs to be installed on your system to convert to ' 'Py-ART Object.'
)
else:
import pyart
# Get list of variables if none provided
if variables is None:
variables = list(obj.keys())
Expand Down

0 comments on commit 0f4f956

Please sign in to comment.