Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated numpy import to fix pip install #65

Merged
merged 6 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading