Closed hyoklee closed 9 years ago
It is possible to create datasets with dimension size of 0 so dims_array should allow zero as a value.
Joe, I have to think re: 0. Obviously, it's not meaningful in HDF5. It's just another way of saying that a dataset can't have a value. How many different ways of saying, "This dataset can't have a value.", do we want to support? H5S_UNLIMITED is not a valid dimension under ANY circumstances, so this is a definite NO. (It is a valid extent for a maximum dimension.)
What's the use case?
Use case is for aggregation. User can specify a design like:
time[0] lat[180] lon[360] temperature[0][180][360]
when the user is not sure how many records he will put under time at the time of design and wants to indicate that time dimension is unlimited. They can aggregate data along time dimension later.
This will be very common use case.
I see. Why not
time[] lat[180] lon[360] temperature[][180][360]
or
time[?] lat[180] lon[360] temperature[?][180][360]
Maybe we are mixing things here a bit. In my mind, HDF5/JSON is a language to describe "what there is" and NOT to describe "what there might be" or "what users don't know." I think the knock-on effect of introducing strange conventions for expressing what people don't know on tools and their complexity could be disastrous. I'm hesitant to shoehorn things into HDF5/JSON whose ramifications we don't understand.
HDF5/JSON is a language to describe "what there is"
Since it is possible to create a dataset with dim size of zero why not allow that value in dims_array
? Such a dataset would be described with: dims = [0]
and maxdims = ['H5S_UNLIMITED']
.
Jeff Lee in his original Product Designer was creating all datasets like that in template files and then later would add data to them.
Fine w/ me.
0 values are supported in jsontoh5.py. See sample json file: data/json/resizable.json. I added two additional test datasets "unlimited_1d_zero" and "unlimited_2d_zero" with 0 dimension values.
dims_array can't specify unlimited while maxdims_array can.
dims_array ::= positive_integer_array maxdims_array ::= "[" maxdims_list "]" maxdims_list ::= maxdim ("," maxdim)* maxdim ::= positive_integer | "H5S_UNLIMITED"
Why not allowing H5S_UNLIMITED in dims_array? How can I handle a case like below in h5json:
time is defined but doesn't contain any data (i.e., 0 dimension).