Tuesday, June 7, 2016

Week 7

This week was very interesting, but also a challenging one.

First, the summary of what was done during this weekend.
  1. Added JSBML license writer
  2. Added write_jsbml_types_doc
  3. Opening and closing brackets were modified,so now it looks like Java code.
  4. Code for writing import statements and class header was written.
  5. In SetGetFunctions.py, unset was fixed, now throws "firePropertyChange".
But the biggest challenge was how is deviser supposed to decide which modules to import based on the attributes.

At first, the idea was to create a method similar to expand_attributes and expands_class, but soon found out it wouldn't suffice and there would a lot of problems on how to import.

Fig.1 JSBML Full Type Hierarchy
Thus I decided to use a tree structure to store the Full type Hierarchy of JSBML. Next step was to decide, whether to create my own tree structure or to use template. In the end I decided to use a template, but how without importing modules that are not available in Python and I found a gist summary that uses pythons' collections module, which includes High-performance container datatypes.

As for the keys, decided to use this ones:
['name'] = name of the Class or Interface
['hasParent']  = True or False
['parentNode'] = key name of the parent node
['hasChildren'] =True or False
['childrenNodes'] =List or None
['isInterface'] =True or False
['parentInterfaces'] = List or None
['childrenInterfaces'] = List or None
['isUniqueJSBML'] =True or False (if True, that means only available in JSBML)
['level'] =integer (to describle on what level)
['libSBML_analogue']  if there's analogue in libSBML

Here's the full implementation of the tree.
Next step is to figure out how to import only necessary modules.

No comments:

Post a Comment