Skip to content

Commit

Permalink
Essential update to fix imports on pip installation. Also some import…
Browse files Browse the repository at this point in the history
… linting.
  • Loading branch information
gregmedlock committed Jul 28, 2020
1 parent 0c7078d commit 51cd01c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 44 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ dist/

# jupyter checkpoints
.ipynb_checkpoints

# solver-specific files that might be generated while running tests locally
gurobi.log
3 changes: 1 addition & 2 deletions medusa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from __future__ import absolute_import

from medusa.core import Ensemble


__version__ = "0.1"
2 changes: 2 additions & 0 deletions medusa/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from medusa.core.ensemble import Ensemble
from medusa.core.feature import Feature
from medusa.core.member import Member
42 changes: 3 additions & 39 deletions medusa/reconstruct/load_from_file.py
Original file line number Diff line number Diff line change
@@ -1,47 +1,11 @@
from __future__ import print_function
from __future__ import absolute_import

import medusa
import cobra
import cobra.test
import numpy as np
import csv
import glob
import pickle
import pandas as pd
import math
import copy
import time
import random
import time
import sys
import os
import itertools
import logging
LOGGER = logging.getLogger(__name__)

from sys import getsizeof
from copy import deepcopy
from collections import defaultdict
from warnings import warn
from itertools import chain
from optlang.symbolics import Zero
from optlang.interface import OPTIMAL
from itertools import chain

import cobra.core.model
from cobra.flux_analysis import sample
from cobra.core.solution import get_solution
from cobra.flux_analysis.sampling import OptGPSampler
from cobra.manipulation.delete import *
from cobra.medium import find_boundary_types
from cobra.flux_analysis import pfba
from cobra.util import solver as sutil
from cobra.core.solution import get_solution
from cobra.core import DictList

from medusa.core.ensemble import Ensemble
from medusa.flux_analysis.flux_balance import optimize_ensemble
from medusa.core.feature import Feature

def parent_attr_of_base_component(base_comp):
Expand Down Expand Up @@ -109,11 +73,11 @@ def batch_load_from_files(model_file_names, identifier='ensemble', batchsize=5,
raise AttributeError("Only cobra.core.Model objects supported")
model_list.append(model)
if range_list[0] == 0:
final_ensemble = medusa.Ensemble(model_list, identifier = identifier)
final_ensemble = medusa.core.Ensemble(model_list, identifier = identifier)
if verbose == True:
print("Ensemble 1 finished")
else:
new_ensemble = medusa.Ensemble(model_list)
new_ensemble = medusa.core.Ensemble(model_list)
final_ensemble = add_ensembles(final_ensemble,new_ensemble)
del new_ensemble
if verbose == True:
Expand All @@ -130,7 +94,7 @@ def add_ensembles(e1,e2,verbose=False):
Parameters
----------
e1 & e2 : Ensemble Objects
Generated using medusa.Ensemble()
Generated using medusa.core.Ensemble()
"""

# Deep copy ensembles
Expand Down
5 changes: 2 additions & 3 deletions medusa/test/test_load_from_file.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import cobra
from cobra.test import create_test_model
from medusa.core.ensemble import Ensemble
from medusa.reconstruct.load_from_file import *

from pickle import load
from medusa.reconstruct.load_from_file import batch_load_from_files

REACTION_ATTRIBUTES = ['lower_bound', 'upper_bound']
MISSING_ATTRIBUTE_DEFAULT = {'lower_bound':0,'upper_bound':0}
Expand Down
2 changes: 2 additions & 0 deletions medusa_cobra.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ medusa/quality/mass_balance.py
medusa/reconstruct/__init__.py
medusa/reconstruct/degrade.py
medusa/reconstruct/expand.py
medusa/reconstruct/load_from_file.py
medusa/test/__init__.py
medusa/test/test_ensemble.py
medusa/test/test_flux_balance.py
medusa/test/test_load_from_file.py
medusa/test/test_reconstruct.py
medusa/test/test_variability.py
medusa/test/data/Staphylococcus aureus.json
Expand Down

0 comments on commit 51cd01c

Please sign in to comment.