-
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
Changes from 7 commits
da9a57e
9e3ac0a
0ece5f8
fef7006
f8c6f6e
4867274
a2f0807
4bc0045
a286f2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# See https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot | ||
|
||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
labels: | ||
- "Bot" |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
run: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Micromamba | ||
uses: mamba-org/provision-with-micromamba@v15 | ||
with: | ||
environment-file: false | ||
|
||
- name: Python ${{ matrix.python-version }} | ||
shell: bash -l {0} | ||
run: > | ||
micromamba create --name TEST python=${{ matrix.python-version }} --file requirements.txt --file requirements-dev.txt --channel conda-forge | ||
&& micromamba activate TEST | ||
&& python -m pip install -e . --no-deps --force-reinstall | ||
|
||
- name: Tests | ||
shell: bash -l {0} | ||
run: > | ||
micromamba activate TEST | ||
&& python -m pytest --disable-warnings |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Numpy depreaction fix. |
||
s_ind[j] = np.argwhere(station[:] == pfg[axes.station].dropna().iloc[0]).item() | ||
|
||
# Add back in the z axes that was removed when calculating data_columns | ||
# and ignore variables that were stored in the profile index | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. From the Shapely 2.0 release notes:
|
||
elif len(coords) > 2: | ||
geoclass = Polygon | ||
else: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Numpy deprecation. |
||
# Try to downcast to an int and then just take the type of the result | ||
# If we can't convert to a numeric use a string | ||
try: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
cftime>=1.2.1 | ||
netcdf4 | ||
numpy>=1.15 | ||
netcdf4<1.6.1 | ||
numpy>=1.20 | ||
pandas>=1.0.5 | ||
python-dateutil | ||
pytz | ||
shapely | ||
shapely>=2 | ||
simplejson |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. |
||
numpy>=1.20 | ||
pandas>=1.0.5 | ||
python-dateutil | ||
pytz | ||
shapely | ||
shapely>=2 | ||
simplejson | ||
tests_require = | ||
pytest | ||
|
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.