[NeXus-tech] Proposed revision of handling of arrays of strings

Tobias.Richter at diamond.ac.uk Tobias.Richter at diamond.ac.uk
Mon Jun 16 23:31:21 BST 2014


I second that. Reading strings in HDF5 isn't as pretty as it could be, but having string parsing code everywhere isn't better.

NAPI doesn't currently allow writing attribute arrays. However on reading they are currently presented as a backward compatible comma delimited string. So 1. is a NO-OP for NAPI users.

Tobias

________________________________________
From: NeXus-tech [nexus-tech-bounces at nexusformat.org] on behalf of Herbert J. Bernstein [yayahjb at gmail.com]
Sent: 16 June 2014 18:16
To: NeXus Technical sub-committee list
Subject: [NeXus-tech] Proposed revision of handling of arrays of strings

In at least 2 places in the NeXus format, various arrays of strings
as used.  In the @axes attribute of data arrays in NXdata base
class, the axes are listed as a "colon-delimited array".  In the
group_names field of the NXdetector_group base class, the
names are part of a "comma separated list of name [sic]".  I
don't know if there are other simulated arrays of strings in the
format, but I propose that we start a move from simulated
arrays of strings to actual arrays of strings.

HDF5 supports arrays of strings both for data fields and for attributes.
We are already using that capability in the NXmx examples.  While
there are limitations, overall it make for cleaner, simpler code
than working with colon-separated or comma-separated simulated
arrays.

I suggest that the NeXus dcumentation be amended to

1.  Permit immediate optional use of actual arrays of strings in all cases
where colon-delimited or comma-delimited simulations of arrays have been
specified; and
2.  That a discussion be started on the possibility of deprecating the
use of colon-delimited or comma-delimited simulations of arrays in favor
of actual arrays of strings.

Regards,
  Herbert
_______________________________________________
NeXus-tech mailing list
NeXus-tech at nexusformat.org
http://lists.nexusformat.org/mailman/listinfo/nexus-tech

-- 
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
 






More information about the NeXus-tech mailing list