Skip to content

Commit

Permalink
Merge pull request #65 from cedadev/fix-pip-build-problem
Browse files Browse the repository at this point in the history
Updated numpy import to fix pip install
  • Loading branch information
agstephens authored Feb 6, 2024
2 parents 4465f99 + 4f11638 commit 1622041
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ netCDF4
scipy
numpy
xarray
cf_xarray
cf_xarray<=0.8.4
cftime
Binary file modified tests/test_outputs/1010.nc
Binary file not shown.

0 comments on commit 1622041

Please sign in to comment.