Re: suggestion concerning names of attributes in dimension scale API

NOTE: The netcdf-hdf mailing list is no longer active. The list archives are made available for historical reasons.

Sure, you can make the reserved names anything you want, but I 
don't know any major use case where it will matter. 

It's not clear to me that users should ever be putting their own attributes
on a dimension scale dataset.  This is why I never worried about
namespace issues.

I would note that the DS is consistent with the image and table
specs.  If you change one, you might want to change them all--with
a corresponding higher effort.

If it were up to me, I'd put htis in as a feature request and think
about it before doing it.

If you decide to change it, be sure to change the specification,
bump the version number, and fix all the software that may 
use it, including the tools.  Be sure that Peter knows this
change is coming!

On Monday 08 August 2005 13:01, Quincey Koziol wrote:

>
> > I have been using dimension scales to store dimension data. The
> > dimension scale code puts several attributes on the datasets to store
> > dimensional metadata. This fragment from h5dump illustrates:
> >
> >       DATASET "Distance" {
> >          DATATYPE  H5T_IEEE_F32LE
> >          DATASPACE  SIMPLE { ( 3 ) / ( 3 ) }
> >          DATA {
> >          (0): 0, 0, 0
> >          }
> >          ATTRIBUTE "CLASS" {
> >             DATATYPE  H5T_STRING {
> >                   STRSIZE 16;
> >                   STRPAD H5T_STR_NULLTERM;
> >                   CSET H5T_CSET_ASCII;
> >                   CTYPE H5T_C_S1;
> >                }
> >             DATASPACE  SCALAR
> >             DATA {
> >             (0): "DIMENSION_SCALE"
> >             }
> >          }
> >          ATTRIBUTE "NAME" {
> >             DATATYPE  H5T_STRING {
> >                   STRSIZE 9;
> >                   STRPAD H5T_STR_NULLTERM;
> >                   CSET H5T_CSET_ASCII;
> >                   CTYPE H5T_C_S1;
> >                }
> >             DATASPACE  SCALAR
> >             DATA {
> >             (0): "Distance"
> >             }
> >          }
> >          ATTRIBUTE "REFERENCE_LIST" {
> >             DATATYPE  H5T_COMPOUND {
> >                H5T_REFERENCE "dataset";
> >                H5T_STD_I32LE "dimension";
> >             }
> >             DATASPACE  SIMPLE { ( 2 ) / ( 2 ) }
> >             DATA {
> >             (0): {
> >                   DATASET 4392 /Adam/Able/Billy_goat_gruff ,
> >                   2
> >                },
> >             (1): {
> >                   DATASET 9088 /Adam/Cain/Grumpy_the_camel ,
> >                   2
> >                }
> >             }
> >          }
> >       }
> >
> >
> > This shows a dimension scale with attributes named CLASS, NAME, and
> > REFERENCE_LIST.
> >
> > Might I suggest that the names of the attributes be preceded with an
> > underscore? (For example _NAME instead of NAME.)
> >
> > The reason is that these attribute names will not be available to
> > users. If the user tries to create an attribute named NAME, he will
> > get an error because one already exists. (This is true in both netCDF
> > and HDF5).
> >
> > It's certain that some users somewhere have used attributes called
> > "NAME." That's why an underscore would be a good idea.
> >
> > Thanks!
> >
> > Ed
> > --
> > Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx

-- 
Robert E. McGrath
National Center for Supercomputing Applications
University of Illinois, Urbana-Champaign
Champaign, Illinois 61820
(217)-333-6549

mcgrath@xxxxxxxxxxxxx


  • 2005 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-hdf archives: