CellML Discussion List

Text archives Help


[cellml-discussion] Questions about the CCGS, and 3 possible bugs


Chronological Thread 
  • From: ak.miller at auckland.ac.nz (Andrew Miller)
  • Subject: [cellml-discussion] Questions about the CCGS, and 3 possible bugs
  • Date: Thu, 26 Oct 2006 09:34:40 +1300

Jonathan Cooper wrote:
> * Andrew Miller <ak.miller at auckland.ac.nz> [2006-10-24 22:51]:
>
>> Jonathan Cooper wrote:
>>
>>> The third is the handling of division. As I understand it, all
>>> numbers in CellML models are implicitly double valued. However, for
>>> the XML fragment
>>> <apply><eq/>
>>> <ci>V</ci>
>>> <apply><divide/>
>>> <cn cellml:units="volt">1</cn>
>>> <cn cellml:units="dimensionless">2</cn>
>>> </apply>
>>> </apply>
>>> the CCGS generates
>>> VARIABLES[0] = (1/2);
>>>
>> I have now fixed the CCGS to always put decimal points on values taken
>> from cn attributes, and likewise for unit conversion factors / offsets.
>>
>
> Does the CCGS perform unit conversion then? It doesn't appear to for my
> quick testcase:
> <variable name="time" units="millisecond"/>
> <apply><eq/>
> <ci>time</ci>
> <apply><divide/>
> <cn cellml:units="second">1</cn>
> <cn cellml:units="dimensionless">2</cn>
> </apply>
> </apply>
>
It performs unit conversion at the connections, but not within equations
(this is what is required by the CellML specification, although it says
that software is allowed to also do conversions at the connections). It
would be very bad practice, of course, for a modeller to rely on
simulators performing conversions in the equations, because it wouldn't
be guaranteed to work in CellML conformant processing software.
>
> Another thing you might want to look at in the Plone interface. I had an
> error in an input model (<bvar>t</bvar> instead of
> <bvar><ci>t</ci></bvar>) and the error message I got back was an
> AttributeError with value rawCode, which isn't particularly helpful!
>
I agree that displaying Python exceptions is bad practice, and we should
catch them and display something cleaner. However, CCGS isn't supposed
to be a validator, and so it doesn't go to a lot of effort to explain
what went wrong if its assumptions are violated (this could be worked
on, except there are technical issues with attaching information to
exceptions in our infrastructure). The best we can really hope for at
the moment is a page suggesting that the user validate their CellML
(once we get a proper validation service in the CellML API package, we
could do this for them, and show the error).

Best regards,
Andrew





Archive powered by MHonArc 2.6.18.

Top of page