Unifying behaviour

4 views
Skip to first unread message

Sarah Keating

unread,
Jan 4, 2018, 6:26:39 AM1/4/18
to LibSBML Development List, jsbml developers' mailing list
Hi Users of libSBML/JSBML - particularly users of both

We need to resolve an issue and would like your input.

Classes in our libraries include a 'getDerivedUnitDefinition' function
that will return a UnitDefinition structure representing the units of a
variable (Compartment/Species/Parameter) or the units returned by the
math element of an object.

libSBML also includes a 'containsUndeclaredUnits' which will return
true/false depending on whether the unitDefinition returned is
completely accurate or has 'left out' units that were not there.

So, for example, if we have parameters

a = 5 metres

b = 2 seconds

and we have an assignmentRule for c that has the formula

c = 2 * a/b

Currently in libSBML

getDerivedUnitDefinition will return a unitDefinition representing
'metres per second'

and containsUndeclaredUnits will return false - since the units of '2'
are unknown.

This was done so that potentially plausible units were returned (if 2
were dimensionless the UnitDefinition would be correct) and a user could
check whether they were definitively accurate by calling the second
function.

It has been suggested that this is a bit arbitrary and that unless all
necessary units are available getDerivedUnitDefinition should return
either NULL or a UnitDefinition with no units (so invalid).

Returning NULL would be a major change in behaviour for libSBML - since
this function has never returned NULL - so could cause issues for
existing code.

We would be grateful for any input from anyone who uses these functions
as to what they consider the most sensible option. JSBML has recently
added much more intensive unit checking and it would make sense to unify
the approaches taken by both libraries.

Thanks

Sarah

Reply all
Reply to author
Forward
0 new messages