Skip to content

Commit 7c61f6e

Browse files
author
Jeff Whitaker
authored
Merge pull request Unidata#1352 from ocefpaf/inspect_deprecation_warnings
Inspect deprecation warnings
2 parents 84e3dd5 + d6b4f03 commit 7c61f6e

6 files changed

Lines changed: 9 additions & 5 deletions

File tree

‎.github/workflows/miniconda.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
4646
- name: Tests
4747
run: |
48-
cd test && python run_all.py
48+
pytest -s -rxs -v test
4949
5050
run-mpi:
5151
runs-on: ${{ matrix.os }}

‎pyproject.toml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ where = ["src"]
7777

7878
[tool.pytest.ini_options]
7979
pythonpath = ["test"]
80+
filterwarnings = [
81+
"error",
82+
"ignore::UserWarning",
83+
]
8084

8185
[tool.mypy]
8286
files = ["src/netCDF4"]

‎src/netCDF4/_netCDF4.pyx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5315,7 +5315,7 @@ rename a `Variable` attribute named `oldname` to `newname`."""
53155315
# corresponds to missing values, don't fill masked array -
53165316
# just use underlying data instead
53175317
if hasattr(self, 'missing_value') and \
5318-
numpy.all(numpy.in1d(data.data[data.mask],self.missing_value)):
5318+
numpy.all(numpy.isin(data.data[data.mask],self.missing_value)):
53195319
data = data.data
53205320
else:
53215321
if hasattr(self, 'missing_value'):

‎test/test_dap.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# test accessing data over http with opendap.
99

10-
yesterday = datetime.utcnow() - timedelta(days=1)
10+
yesterday = datetime.now() - timedelta(days=1)
1111
URL = f'http://nomads.ncep.noaa.gov/dods/gfs_1p00/gfs{yesterday:%Y%m%d}/gfs_1p00_00z'
1212
URL_https = 'https://www.neracoos.org/erddap/griddap/WW3_EastCoast_latest'
1313
varname = 'hgtsfc'

‎test/test_stringarr.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def setUp(self):
4141
v2[:-1] = data[:-1]
4242
v2[-1] = data[-1]
4343
v2[-1,-1] = data[-1,-1] # write single element
44-
v2[-1,-1] = data[-1,-1].tostring() # write single python string
44+
v2[-1,-1] = data[-1,-1].tobytes() # write single python string
4545
# _Encoding should be ignored if an array of characters is specified
4646
v3[:] = stringtochar(data, encoding='ascii')
4747
nc.close()

‎test/test_types.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def runTest(self):
6868
#assert np.allclose(datarr, ranarr[1:n1dim].astype(data.dtype))
6969
assert_array_almost_equal(datarr,ranarr[1:n1dim].astype(data.dtype))
7070
else:
71-
assert datarr.tostring() == ranarr[1:n1dim].astype(data.dtype).tostring()
71+
assert datarr.tobytes() == ranarr[1:n1dim].astype(data.dtype).tobytes()
7272
# check that variable elements not yet written are filled
7373
# with the specified _FillValue.
7474
assert_array_equal(datfilled,np.asarray(data._FillValue,datfilled.dtype))

0 commit comments

Comments
 (0)