Hi all,
On Mar 30, 2011, at 7:33 AM, Ger van Diepen wrote:
> I have had the same problem and worked around it by writing an empty array as
> a special data type. It's really a nuisance.
> You could say it was a design error to use 0 to indicate an unlimited
> dimension. -1 (or maybe MAX_INT) would have been better.
We don't use 0 for indicating an unlimited dimension (and we do use -1
:-).
> An axis length 0 conveys information (especially for vectors).
Yes, it does and we already have an issue to correct this in our bug
tracker. I'll see if we can bump up the priority for the 1.8.7 release.
One possibility as a workaround in the meanwhile may be to use the
H5S_NULL dataspace class, to indicate that an attribute or dataset has no
elements.
Thanks for the feedback,
Quincey
> I doubt if the solution of using an unlimited dimension will work when
> writing an array as an attribute.
>
> AFAIK the same problem exists when having an empty string for a variable
> length string field.
>
> Cheers,
> Ger
>
> >>> "Binh-Minh Ribler" <[email protected]> 3/30/2011 2:04 PM >>>
> Hi Konrad,
>
> Do you think making the dimension unlimited would work for you?
>
> Binh-Minh
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> On Behalf Of Konrad Hinsen
> Sent: Wednesday, March 30, 2011 6:19 AM
> To: HDF Users Discussion List
> Subject: [Hdf-forum] Dimensions of length zero
>
> Hi everyone,
>
> I found out by experimenting that HDF5 does not seem to like empty arrays,
> i.e. arrays that have a zero in their dimension list. The associated error
> message is
>
> Zero sized dimension for non-unlimited dimension
>
> However, I cannot find anything about this in the documentation (though of
> course I haven't read all of it). Is this a bug or a feature?
>
> I find this restriction quite limiting because there is no obvious way to
> work around it. If I need to store a list of values and that list just
> happens to be empty, what can I do? I'd have to define my own representation
> of an empty list in terms of some non-empty value, perhaps with an attribute
> saying "this is really empty", but that complicates all application code and
> the whole file structure.
>
> Konrad.
> --
> ---------------------------------------------------------------------
> Konrad Hinsen
> Centre de Biophysique Moléculaire, CNRS Orléans
> Synchrotron Soleil - Division Expériences
> Saint Aubin - BP 48
> 91192 Gif sur Yvette Cedex, France
> Tel. +33-1 69 35 97 15
> E-Mail: research AT khinsen DOT fastmail DOT net
> ---------------------------------------------------------------------
>
>
>
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
>
>
> --
> Internal Virus Database is out-of-date.
> Checked by AVG.
> Version: 7.5.549 / Virus Database: 270.9.0/1778 - Release Date: 11/9/2008
> 2:14 PM
>
>
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org