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
is None or element.isSetNotes() ==
False:
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
87 print (
" filename: {0}".format( filename))
88 print (
" read time (ms): {0}".format( stop - start))
91 errors = document.getNumErrors(libsbml.LIBSBML_SEV_ERROR)
93 print (
" error(s): {0}".format(errors))
94 document.printErrors()
98 filter = NotesFilter()
101 start = time.time() * 1000
102 print (
" searching ......:")
103 allElements = document.getListOfAllElements(filter)
104 stop = time.time() * 1000
105 print (
" search time (ms): {0}".format(stop - start))
107 print (
" elements with notes: {0}".format(allElements.getSize()))
111 if __name__ ==
'__main__':