cellml / libcellml

Repository for libCellML development.
https://libcellml.org
Apache License 2.0
17 stars 21 forks source link

Intention behind Parser::parseModel, updateModel, loadModel functions? #670

Open kerimoyle opened 4 years ago

kerimoyle commented 4 years ago

I'm struggling to understand the need for three different functions here:

I don't get it ... why do we have an updateModel method, is private, used exactly once (in parseModel), and doesn't do what its name suggests (it naively appends, rather than updating) ... what am I missing? Why do we have it?

I'd like to change the updateModel function to one which:

This is related to #669 as it would be cleanest to make use of the serialisation functions in the Printer so that even automatically-generated ids are the same, whether they are constructed in Annotator or the Printer.

Thoughts? @nickerso @agarny @hsorby

nickerso commented 4 years ago

Not sure I see the connection between #669 and parsing? Or quite what it means for automatically generated ids to be the same?

kerimoyle commented 4 years ago

One option in 669 is to set the automatic ids in the Annotator using the Printer and then reparsing into a model. If that were the case then I'd want the parser to "update" rather than "append to" the model. We don't currently have that functionality (except it sounds like we do when you read the function names in the parser).