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

add py310 tests #67

Merged
merged 4 commits into from
Mar 3, 2022
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
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 3 additions & 2 deletions pocean/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import os
import collections
from copy import deepcopy
from collections import OrderedDict, Mapping
from collections import OrderedDict
from collections.abc import Mapping, Iterable

import numpy as np
import simplejson as json
Expand Down Expand Up @@ -124,7 +125,7 @@ def ncpyattributes(obj, verbose=True):
if hasattr(v, 'dtype'):
newt = v.dtype.name
else:
if isinstance(v, collections.Iterable) and v:
if isinstance(v, Iterable) and v:
# Use the type of the first one
v = v[0]
else:
Expand Down
2 changes: 1 addition & 1 deletion pocean/tests/dsg/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def test_wrap_dateline(self):
"geospatial_lon_min": -179.966,
"geospatial_lon_max": 179.858,
"geospatial_bbox": "POLYGON ((198.669 61.777, 198.669 67.068, 174.792 67.068, 174.792 61.777, 198.669 61.777))",
'geospatial_bounds': "POLYGON ((174.792 61.777, 174.926 62.206, 178.838667737 64.055605136, 178.916 64.084, 179.858 64.31100000000001, 192.86 67.029, 196.86 67.068, 198.669 66.861, 187.753767857 64.33420419300001, 179.195 62.395, 176.169 61.862, 174.792 61.777))",
'geospatial_bounds': "POLYGON ((174.792 61.777, 174.926 62.206, 178.838667737 64.055605136, 178.916 64.084, 179.858 64.311, 192.86 67.029, 196.86 67.068, 198.669 66.861, 187.753767857 64.334204193, 179.195 62.395, 176.169 61.862, 174.792 61.777))",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit flaky but it is passing :-)

"geospatial_bounds_crs": "EPSG:4326"
}
}
Expand Down
8 changes: 4 additions & 4 deletions pocean/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import itertools
import simplejson as json
from datetime import datetime, date, time
from collections import namedtuple, Mapping, Counter
from collections import namedtuple, Counter
from collections.abc import Mapping

try:
# PY2 support
Expand Down Expand Up @@ -442,10 +443,9 @@ def get_dtype(obj):

def dict_update(d, u):
# http://stackoverflow.com/a/3233356
import collections
for k, v in u.items():
if isinstance(d, collections.Mapping):
if isinstance(v, collections.Mapping):
if isinstance(d, Mapping):
if isinstance(v, Mapping):
r = dict_update(d.get(k, {}), v)
d[k] = r
else:
Expand Down