Skip to content

Commit

Permalink
adding method to organize cleaning and validation of KbGenerator options
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Jun 13, 2018
1 parent c839abf commit bd1c50f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion wc_kb_gen/core.py
Expand Up @@ -12,12 +12,18 @@
class KbGenerator(object):
""" Generator for knowledge bases of experimental data for whole-cell models
Options:
* id
* name
* component
Attributes:
component_generators (:obj:`list` of :obj:`KbComponentGenerator`): component
generators of the knowledge base
options (:obj:`dict`, optional): dictionary of options whose keys are the names
of component generator classes and whose values are dictionaries of options
for the component generator classes
for the component generator classes
"""

DEFAULT_COMPONENT_GENERATORS = ()
Expand All @@ -43,6 +49,8 @@ def run(self):
:obj:`wc_kb.KnowledgeBase`: knowledge base
"""

self.clean_and_validate_options()

kb = wc_kb.KnowledgeBase()
kb.id = self.options.get('id', None)
kb.version = self.options.get('version', None)
Expand All @@ -56,6 +64,10 @@ def run(self):

return kb

def clean_and_validate_options(self):
""" Apply default options and validate options """
pass # pragma: no cover


class KbComponentGenerator(object):
""" Base class for knowledge base component generators
Expand Down

0 comments on commit bd1c50f

Please sign in to comment.