@@ -196,7 +196,7 @@ def create_group(self, name, type_):
196
196
197
197
def create_data_array (self , name = "" , array_type = "" , dtype = None , shape = None ,
198
198
data = None , compression = Compression .Auto ,
199
- copy_from = None , keep_copy_id = True ):
199
+ copy_from = None , keep_copy_id = True , label = None , unit = None ):
200
200
"""
201
201
Create/copy a new data array for this block. Either ``shape``
202
202
or ``data`` must be given. If both are given their shape must agree.
@@ -219,6 +219,10 @@ def create_data_array(self, name="", array_type="", dtype=None, shape=None,
219
219
:type copy_from: DataArray
220
220
:param keep_copy_id: Specify if the id should be copied in copy mode
221
221
:type keep_copy_id: bool
222
+ :param label: The label, defaults to None.
223
+ :type label: str
224
+ :param unit: The unit of the stored data. Defaults to None.
225
+ :type unit: str
222
226
223
227
:returns: The newly created data array.
224
228
:rtype: :class:`~nixio.DataArray`
@@ -254,6 +258,8 @@ def create_data_array(self, name="", array_type="", dtype=None, shape=None,
254
258
dtype , shape , compression )
255
259
if data is not None :
256
260
da .write_direct (data )
261
+ da .unit = unit
262
+ da .label = label
257
263
return da
258
264
259
265
def create_data_frame (self , name = "" , type_ = "" , col_dict = None ,
0 commit comments