Skip to content

Commit ea976c0

Browse files
committed
Removed some code duplication in Metabolome.
1 parent b0d85bf commit ea976c0

1 file changed

Lines changed: 2 additions & 27 deletions

File tree

cutlass/Metabolome.py

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -512,35 +512,10 @@ def load(node_id):
512512
module_logger.info("Got iHMP session.")
513513
node_data = session.get_osdf().get_node(node_id)
514514

515-
module_logger.info("Creating a template Metabolome.")
516-
node = Metabolome()
517-
518-
module_logger.debug("Filling in Metabolome details.")
519-
520-
# Node required fields
521-
node._set_id(node_data['id'])
522-
node._links = node_data['linkage']
523-
node._version = node_data['ver']
515+
node = Metabolome.load_metabolome(node_data);
524516

525-
# Required fields
526-
node._checksums = node_data['meta']['checksums']
527-
node._format = node_data['meta']['format']
528-
node._format_doc = node_data['meta']['format_doc']
529-
node._study = node_data['meta']['study']
530-
node._tags = node_data['meta']['tags']
531-
node._urls = node_data['meta']['urls']
517+
module_logger.debug("Returning loaded " + __name__)
532518

533-
# Handle Metabolome optional properties
534-
if 'comment' in node_data['meta']:
535-
node._comment = node_data['meta']['comment']
536-
537-
if 'format' in node_data['meta']:
538-
node._format = node_data['meta']['format']
539-
540-
if 'format_doc' in node_data['meta']:
541-
node._format_doc = node_data['meta']['format_doc']
542-
543-
module_logger.debug("Returning loaded Metabolome.")
544519
return node
545520

546521
def save(self):

0 commit comments

Comments
 (0)