[SAGA-RG] Semantics of 'existing' Attributes?

Andre Merzky andre at merzky.net
Tue Nov 3 10:44:23 CST 2009


Hi Matthijs, 


Quoting [Mathijs den Burger] (Oct 28 2009):
> 
> Hi all,
> 
> What does the word 'existing' mean in the description of the Attributes
> interface in GFD.90?

Thats a good catch I think - it is unspecified.  Further, the
attribute interface description says that SAGA distingishes between
mandatory and optional attributes, but in fact no such flag is set
in the attribute descriptions (it is sometimes mentioned in the
notes though).  Also, per your question, it is unspecified if
optional attributes are actually set to their defaults and are
query-able, or if they are hidden and silently assumed to have their
default value.

My proposal would be:

  - add a mandatory/optional flag to all predefined attributes
  - mandatory attribs must have default values listed
  - exists/list must show mandatory attributes
  - exist/list should only show optional attributes if those have
    been set by the application or backend, but the implementation
    may hide them if they have their default values.  exist/list
    must show optional attributes if they have non-default values.
  - for attributes which have no default value specified, any
    non-empty value is assumed to be non-default.

I guess that would make both implementations compliant (*)

Does that make sense?  Do you (or others) have any other proposal?

Thanks, Andre.


(*) well, almost: C++ needs to list 'Executable', as that is the
only required job description attribute.

> For example, the spec says that list_attributes() returns 'existing
> attribute keys'. Say we do:
> 
>   jd = new job_description()
>   print jd.list_attributes()
>   
> The C++ Python wrapper will print an empty list.
> The Java implementation will print all defined job description
> attributes.
> 
> So, the C++ impl interprets 'existing' as 'having a value'. Since it
> does not set any default values (a bug?) it prints an empty list. The
> Java impl interprets 'existing' as 'being defined', and prints all
> defined attributes.
> 
> What would be the correct behavior? 
> 
> regards,
> Mathijs
-- 
Nothing is ever easy.


More information about the saga-rg mailing list