Skip to content

Commit 1e5d931

Browse files
committed
Merge branch 'release/v0.3.5'
2 parents c6ff066 + 602daf4 commit 1e5d931

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v0.3.5 (2020-10-16)
4+
5+
Don't use library depricated functions (#3)
6+
37
## v0.3.4 (2019-02-14)
48

59
Apply sign when reading time series from Dymola result files (.mat)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2017, Dassault Systemes.
3+
Copyright (c) 2020, Dassault Systemes.
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Get the scale for the first dimension:
7272

7373
-----------------------------
7474

75-
|copyright| 2019 |Dassault Systemes|
75+
|copyright| 2020 |Dassault Systemes|
7676

7777
.. _SDF specification: https://github.com/ScientificDataFormat/SDF
7878
.. _HDF5: https://www.hdfgroup.org/hdf5/

sdf/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from . import hdf5
99

10-
__version__ = '0.3.4'
10+
__version__ = '0.3.5'
1111

1212
_object_name_pattern = re.compile('[a-zA-Z][a-zA-Z0-9_]*')
1313

@@ -157,10 +157,11 @@ def _validate_group(group, is_root=False):
157157

158158

159159
def _validate_dataset(ds):
160+
160161
if not type(ds.data) is np.ndarray:
161162
return ['Dataset.data must be a numpy.ndarray']
162163

163-
elif np.alen(ds.data) < 1:
164+
elif ds.data.size < 1:
164165
return ['Dataset.data must not be empty']
165166

166167
elif not np.issubdtype(ds.data.dtype, np.float64):

sdf/hdf5.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def save(filename, group):
6262
dimname = s._display_name
6363
if dimname is None:
6464
dimname = ''
65-
h5ds.dims.create_scale(h5s, _str(dimname))
65+
h5s.make_scale(_str(dimname))
6666
h5ds.dims[i].attach_scale(h5s)
6767
else:
6868
print("Cannot attach scale for '" + h5ds.name +
@@ -101,7 +101,7 @@ def _create_dataset(dsobj, datasets):
101101
""" Create a dataset from an h5py dataset """
102102

103103
_, name = os.path.split(dsobj.name)
104-
ds = sdf.Dataset(name, data=dsobj.value)
104+
ds = sdf.Dataset(name, data=dsobj[()])
105105

106106
for attr in dsobj.attrs:
107107
if attr == 'COMMENT':

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def readme():
1111

1212

1313
setup(name='SDF',
14-
version='0.3.4',
14+
version='0.3.5',
1515
description="Work with Scientific Data Format files in Python",
1616
long_description=readme(),
1717
url="https://github.com/ScientificDataFormat/SDF-Python",

0 commit comments

Comments
 (0)