cellml / libcellml

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

Annotator behaviour #868

Open hsorby opened 3 years ago

hsorby commented 3 years ago

Right now the annotator will return specific items if the given id matches. For example given the following:

component1->setId("id1");
component1->setEncapsulationId("id2");
component2->setId("id3");
component2->setEncapsulationId("id4");

If I ask the annotator for a component encapsulation with id id3 I will get back component2 (annotator->componentEncapsulation("id3");. Likewise if I were to ask for a component with id id2 I will get back component1 (annotator->component("id2");).

Is this the behaviour that we expect from the Annotator class?

agarny commented 3 years ago

I would think so.

nickerso commented 3 years ago

No, I don't expect this behaviour and we should look to fix this. Either by removing componentEncapsulation (and similar methods) from the annotator API or by having those methods do more than just wrap the expected return type method - i.e., check the item with that id is of the encapsulation type rather than any component.