Skip to content

Commit 57b9a80

Browse files
authored
Merge pull request Unidata#1416 from Unidata/py314-test
fix failing tests for python 3.14
2 parents d414eaa + 00d71fd commit 57b9a80

4 files changed

Lines changed: 6 additions & 23 deletions

File tree

.github/workflows/build_latest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
#NO_NET: 1
1515
strategy:
1616
matrix:
17-
python-version: ["3.13"]
17+
python-version: ["3.13", "3.14-dev"]
1818
steps:
1919

2020
- uses: actions/checkout@v4

src/netCDF4/_netCDF4.pyx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,17 +1492,6 @@ _needsworkaround_issue485 = __netcdf4libversion__ < "4.4.0" or \
14921492
(__netcdf4libversion__.startswith("4.4.0") and \
14931493
"-development" in __netcdf4libversion__)
14941494

1495-
# issue warning for hdf5 1.10 (issue #549)
1496-
if __netcdf4libversion__[0:5] < "4.4.1" and\
1497-
__hdf5libversion__.startswith("1.10"):
1498-
msg = """
1499-
WARNING: Backwards incompatible files will be created with HDF5 1.10.x
1500-
and netCDF < 4.4.1. Upgrading to netCDF4 >= 4.4.1 or downgrading to
1501-
to HDF5 version 1.8.x is highly recommended
1502-
(see https://github.com/Unidata/netcdf-c/issues/250)."""
1503-
warnings.warn(msg)
1504-
1505-
15061495
class NetCDF4MissingFeatureException(Exception):
15071496
"""Custom exception when trying to use features missing from the linked netCDF library"""
15081497
def __init__(self, feature: str, version: str):

src/netCDF4/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,11 @@ def _StartCountStride(elem, shape, dimensions=None, grp=None, datashape=None,\
426426

427427
# ITERABLE #
428428
elif np.iterable(e) and np.array(e).dtype.kind in 'i': # Sequence of integers
429-
start[...,i] = np.apply_along_axis(lambda x: e*x, i, np.ones(sdim[:-1]))
430-
indices[...,i] = np.apply_along_axis(lambda x: np.arange(sdim[i])*x, i, np.ones(sdim[:-1], int))
431-
432-
count[...,i] = 1
433-
stride[...,i] = 1
429+
if start[...,i].size:
430+
start[...,i] = np.apply_along_axis(lambda x: e*x, i, np.ones(sdim[:-1]))
431+
indices[...,i] = np.apply_along_axis(lambda x: np.arange(sdim[i])*x, i, np.ones(sdim[:-1], int))
432+
count[...,i] = 1
433+
stride[...,i] = 1
434434

435435
# all that's left is SCALAR INTEGER #
436436
else:

test/test_open_mem.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ def test_mem_open(self):
1717
netCDF4.Dataset('foo_bar', memory=nc_bytes)
1818
return
1919

20-
# Needs: https://github.com/Unidata/netcdf-c/pull/400
21-
if netCDF4.__netcdf4libversion__ < '4.4.1.2':
22-
with self.assertRaises(OSError):
23-
netCDF4.Dataset('foo_bar', memory=nc_bytes)
24-
return
25-
2620
with netCDF4.Dataset('foo_bar', memory=nc_bytes) as nc:
2721
assert nc.filepath() == 'foo_bar'
2822
assert nc.project_summary == 'Dummy netCDF file'

0 commit comments

Comments
 (0)