ModelSEED / ModelSEEDDatabase

This repository contains the definitive copy of the biochemistry and metadata used to construct models using the ModelSEED/ProbAnno approach
Other
52 stars 38 forks source link

Adding first draft of python libraries for compounds and reactions #74

Closed samseaver closed 6 years ago

JamesJeffryes commented 6 years ago

@samseaver I added in inchis.py for which I implemented all the key functions but "charge" I also refactored a the compounds and reactions classes. One thing was to use the "DictReader" class in csv that makes parsing the tsv much easier. Another was to annotate static functions as such so they can be called w/o initializing a Compounds object. Finally I did some refactor to make the code more compliant with python conventions (a major difference is python never uses capital letters except for class names). Take a look and make sure I didn't break anything

samseaver commented 6 years ago

Two things here:

The use of DictReader doesn't explicitly state how an empty record will be used. In the old code, I defaulted all instances to "null" string before effectively retrieving them. What does DictReader do for empty records?

What's the difference between doing self.function() and Compounds.function() in a static method?