-
Notifications
You must be signed in to change notification settings - Fork 16
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
use numpy >=1.20 #70
use numpy >=1.20 #70
Conversation
with: | ||
python-version: 3.x | ||
python-version: "3.10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we cannot use latest Python until we resolve the netcdf4<1.6.1
pin.
@@ -133,7 +133,7 @@ def from_dataframe(cls, df, output, **kwargs): | |||
profile[j] = pname | |||
row_size[j] = len(pfg) | |||
if s_ind is not None: | |||
s_ind[j] = np.asscalar(np.argwhere(station[:] == pfg[axes.station].dropna().iloc[0])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Numpy depreaction fix.
@@ -72,6 +72,9 @@ def get_geographic_attributes(df, axes=None): | |||
|
|||
if len(set(coords)) == 1: | |||
geoclass = Point | |||
# The set is to workaround the fact tht pocean | |||
# relied in a shapely<2 bug to pass a vector here instead of a point. | |||
coords = set(coords) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if you want to leave this as-is or to re-write it but it was relying on a bad behavior before. One cannot pass 4 coords to a Point class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the Shapely 2.0 release notes:
The Point(..) constructor no longer accepts a sequence of coordinates consisting of more than one coordinate pair (previously, subsequent coordinates were ignored) (#1600).
@@ -274,7 +274,7 @@ def create_ncvar_from_series(ncd, var_name, dimensions, series, **kwargs): | |||
elif series.dtype.kind in ['U', 'S'] or series.dtype in [str]: | |||
# AttributeError: cannot set _FillValue attribute for VLEN or compound variable | |||
v = ncd.createVariable(var_name, get_dtype(series), dimensions, **kwargs) | |||
elif series.dtype == np.object: | |||
elif series.dtype == object: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Numpy deprecation.
@@ -29,12 +29,12 @@ classifiers = | |||
packages = find: | |||
install_requires = | |||
cftime>=1.2.1 | |||
netcdf4 | |||
numpy>=1.15 | |||
netcdf4<1.6.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pin will hurt us when trying to install pocean in modern envs.
I was unable to fix the failing tests without it. Iris wrote a whole new class to solve that. I was hoping for an easier solution here :-/
@kwilcox with the I could not see a clear path ahead to easily fix this in Unidata/netcdf4-python#1192 For now I'm OK with this solution and it kind of helps us already. It would be nice to get someone more familiar with pocean-core to tackle the netcdf4 pin though. |
Thanks @ocefpaf! I agree, solving the |
I can look into that now. If I manage to fix this today maybe we can even issue a new release in the afternoon. |
The
np.object
, and many other aliases, as deprecated and removed in numpy 1.24. This updates the code and set a new min numpy version.@kwilcox I'd appreciate if we can merge this quick and issue a new release. I can take care of the latter.