- From: d.nickerson at auckland.ac.nz (David Nickerson)
- Subject: [cellml-discussion] Finding the units associated with a variable
- Date: Fri, 26 May 2006 16:03:05 +1200
Andrew Miller wrote:
>
David Nickerson wrote:
>
>
> Looks ok to me. would something like variableUnits be more appropriate?
>
>
>
>
>
It is already on the variable interface, so that is implied. That name
>
might also suggest that the units themselves are variable, and confuse
>
people.
yeah, but I'm similarly confused with unitsElement - obviously units
would be the best attribute but as you say, that would be invalid
IDL...is there anything else we could call it?
>
I think that the other attribute will be useful too (although the code
>
generation doesn't use it, as it needs to support the builtin units).
>
Everything you can do with the API can be done directly using the DOM,
>
but the point of the API is to make it easier to use CellML, not to
>
provide any functionality which is not already available through the
>
DOM. We already have other similar attribute pairs, e.g. for finding
>
variables or components in connections. BTW note that this attribute is
>
read-write, so it is not just about getting the name, but also setting
>
that attribute. Being able to do v.unitsElement = someUnit; rather than
>
v.unitsName = someUnit.name; is slightly more convenient, and more
>
importantly, it checks that someUnit is in the right component/model in
>
order to allow the assignment, and raises an exception otherwise.
OK - I'm happy with both attributes now.
Archive powered by MHonArc 2.6.18.