nixpy icon indicating copy to clipboard operation
nixpy copied to clipboard

Ability to store large strings (eg. log data etc.)

Open cgars opened this issue 11 years ago • 3 comments

Is there a way to properly do this ATM.

cgars avatar Oct 24 '14 09:10 cgars

Yes, it is possible to store text. If this text is for example the configuration file used for a run of a simulation or analysis and you store the results in a DataArray you may choose to link the data to a Source. This could have the name 'analysis configuration', the type 'nix.config' and put the text into the definition of the Source entity

data_array = block.create_data_array('histogram', 'nix.histogram', data=np.hist(X, 100))
                      ...
config = block.create_source('histogram configuration', 'nix.configuration')
config.definition = config_text
data_array.sources.append(config)

alternatively you could add metadata to the source entitiy:

section = file.create_section('histogram configuration', 'nix.configuration')
section.create_property('bin count', nix.Value(100))
          ....
config.metadata = config # the Source object from above

jgrewe avatar Oct 25 '14 10:10 jgrewe

@jgrewe this is all true but still, in C++ we support strings in datasets and in nixpy we don't. We should fix that!

gicmo avatar Oct 25 '14 11:10 gicmo

hey gicmo, i completely agree :-)

jgrewe avatar Oct 25 '14 11:10 jgrewe