Skip to content

Commit

Permalink
Updated numpy import to fix pip install
Browse files Browse the repository at this point in the history
  • Loading branch information
agstephens committed Feb 6, 2024
1 parent 7b16a32 commit 2278928
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nappy/utils/common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
from io import StringIO
import logging

import numpy as np

# Imports from local package
from nappy import __version__
from nappy.utils import parse_config
Expand Down Expand Up @@ -263,6 +261,9 @@ def get_rank_zero_array_value(arr):
It returns a float (for a number) or a string (from a string
or bytes string).
"""
# Import numpy here so that pip install works without error
import numpy as np

if arr.dtype.type is np.str_:
return str(arr)
elif arr.dtype.type is np.bytes_:
Expand Down
Binary file modified tests/test_outputs/1010.nc
Binary file not shown.

0 comments on commit 2278928

Please sign in to comment.