Opening this as a stub issue for adding a mid/high level interface to the Dimension Scale functions. I meant to do this a while back when the low level library calls were added, but I never got around to it. See also #720. I will also add a short blurb on what HDF5 dimension scales are useful for in a reply to this issue for anyone who is unfamiliar.
Here are some current ideas for things to implement. This is currently closer to a train of thought rather than anything set in stone, so I'd welcome feedback on how this could/should be changed:
High-level interface:
Mid-level implementations of low level library calls:
Opening this as a stub issue for adding a mid/high level interface to the Dimension Scale functions. I meant to do this a while back when the low level library calls were added, but I never got around to it. See also #720. I will also add a short blurb on what HDF5 dimension scales are useful for in a reply to this issue for anyone who is unfamiliar.
Here are some current ideas for things to implement. This is currently closer to a train of thought rather than anything set in stone, so I'd welcome feedback on how this could/should be changed:
High-level interface:
HDF5.Datasettype calledHDF5.Scalefor cases where a Dataset is a dimension scale. This seems like the easiest way to add this functionality to the existing interface without breaking changes, but I'm open to suggestions.HDF5.Datasetand returning them alongside the dataset. Alternatively, add a function to check if a dataset has scales (HDF5.has_scalesorHDF5.dimensions_with_scales?) and read the scale given a dataset, a laHDF5.read_dimension_scale( ds::HDF5.Dataset, dim::Integer)write_datasetcalls.Mid-level implementations of low level library calls:
HDF5.is_scale(), which should return true if a suppliedHDF5.Dataset(orHDF5.Scale) is a dimension scaleHDF5.attach_scale()andHDF5.detach_scale()to attach/detach a dimension scale from a suppliedHDF5.DatasetHDF5.set_label()andHDF5.get_label()to assign a label to a dimension scale. This might be ambiguous without theHDF5.Scaledatatype though, so it might be best to exclude this ifHDF5.Scalealso isn't a good idea.HDF5.set_scale()to convert an existingHDF5.Datasetto a dimension scale. Interestingly, there does not appear to be a correspondingunset_scalelibrary call, though it seems like the only thing that makes a dataset a scale is the attributes, soHDF5.unset_scale()might just need to delete those attributes.HDF5.get_num_scales()to return the number of scales attached to a givenHDF5.DatasetHDF5.dimensions_with_scales()to return aVector{Integer}of dimensions with attached scalesHDF5.get_scale_name()to return the name (label) attached to a scale, if there is oneHDF5.is_attached()to return true if a suppliedHDF5.Dataset(orHDF5.Scale) is attached to a dataset as a scale.