Skip to content

Commit

Permalink
setup and __init__ are pep8 compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
aebrahim committed Jan 6, 2015
1 parent 9802511 commit 29a335e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
5 changes: 4 additions & 1 deletion cobra/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@
_warning_base = "%s:%s \x1b[1;31m%s\x1b[0m: %s\n" # colors
else:
_warning_base = "%s:%s %s: %s\n"


def _warn_format(message, category, filename, lineno, file=None, line=None):
shortname = filename.replace(_cobra_path, "cobra", 1)
return _warning_base % (shortname, lineno, category.__name__, message)
_warnings.formatwarning = _warn_format

from .version import get_version
__version__ = get_version()
from .core import Object, Formula, Metabolite, Gene, Reaction, Model, DictList, Species
from .core import Object, Formula, Metabolite, Gene, Reaction, Model, \
DictList, Species
from . import io, flux_analysis

try:
Expand Down
11 changes: 6 additions & 5 deletions cobra/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
salmonella_sbml = join(data_directory, "salmonella.xml")
salmonella_fbc_sbml = join(data_directory, "salmonella_fbc.xml")
salmonella_pickle = join(data_directory, "salmonella.pickle")
salmonella_reaction_p_values_pickle = join(data_directory, "salmonella_reaction_p_values.pickle")
ecoli_sbml = join(data_directory, "iJO1366.xml")
ecoli_pickle = join(data_directory, "iJO1366.pickle")
ecoli_mat = join(data_directory, "iJO1366.mat")
Expand All @@ -35,10 +34,10 @@ def create_test_model(test_pickle=salmonella_pickle):
version of the Salmonella enterica Typhimurium LT2 model published in
Thiele et al. 2011 BMC Sys Bio 5:8
test_pickle: The complete file name of a pickled cobra.Model or SBML XML
file to be read. We currently provide Salmonella enterica Typhimurium
and Escherichia coli models whose paths are stored in cobra.test.salmonella_pickle
and cobra.test.ecoli_pickle, respectively. The ecoli model is a variant of the
test_pickle: The filename of a pickled cobra.Model
We currently provide Salmonella enterica Typhimurium and Escherichia coli
models whose paths are stored in cobra.test.salmonella_pickle and
cobra.test.ecoli_pickle, respectively. The ecoli model is a variant of the
model published in Orth et al. 2011 Mol Syst Biol 7:535
"""
Expand All @@ -54,6 +53,7 @@ def create_test_model(test_pickle=salmonella_pickle):
with open(test_pickle, "rb") as infile:
return load(infile)


def create_test_suite():
"""create a unittest.TestSuite with available tests"""
from unittest import TestLoader, TestSuite
Expand All @@ -66,6 +66,7 @@ def create_test_suite():

suite = create_test_suite()


def test_all():
"""###running unit tests on cobra py###"""
from unittest import TextTestRunner
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def get_tag(self):
# https://gist.github.com/aebrahim/94a2b231d86821f7f225
include_dirs = []
library_dirs = []
if isfile("libglpk.a") or isfile ("libgmp.a"):
if isfile("libglpk.a") or isfile("libgmp.a"):
library_dirs.append(abspath("."))
if isfile("glpk.h"):
include_dirs.append(dirname(abspath("glpk.h")))
Expand Down

0 comments on commit 29a335e

Please sign in to comment.