Demonstrates how to use the element filter class to search the model for elements with specific attributes .
61 def filter(self, element):
63 if (element ==
None or element.isSetNotes() ==
False):
66 if (element.isSetId()):
67 print " found : {0}".format(element.getId())
69 print " found element without id"
73 """Usage: getAllElementsWithNotes filename
82 start = time.time() * 1000;
84 stop = time.time() * 1000;
88 print " filename: {0}".format( filename);
89 print " read time (ms): {0}".format( stop - start);
92 errors = document.getNumErrors(libsbml.LIBSBML_SEV_ERROR);
94 print " error(s): {0}".format(errors);
95 document.printErrors();
100 filter = NotesFilter()
103 start = time.time() * 1000;
104 print " searching ......:"
105 allElements = document.getListOfAllElements(filter);
106 stop = time.time() * 1000;
107 print " search time (ms): {0}".format(stop - start);
109 print " elements with notes: {0}".format(allElements.getSize())
113 if __name__ ==
'__main__':