Skip to content

Commit 861f565

Browse files
committed
More formatting wtih black
1 parent fd68c3f commit 861f565

12 files changed

+17
-11
lines changed

modelseedpy/biochem/modelseed_biochem.py

+2
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def load_metabolites_from_df(
179179
logger.error("failed to read compound at Index: %s. %s", t[0], e)
180180
return compounds
181181

182+
182183
def _load_aliases_df(df_aliases, seed_index=1, source_index=3, alias_id_index=2):
183184
aliases = {}
184185
for i in df_aliases.itertuples():
@@ -319,6 +320,7 @@ def _load_reactions(
319320

320321
return reactions, metabolites_indexed
321322

323+
322324
def load_reactions_from_df(
323325
df: pd.DataFrame,
324326
database_metabolites: dict,

modelseedpy/biochem/modelseed_compound.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,4 @@ def is_obsolete(self):
149149
return False
150150
else:
151151
return True
152-
return False
152+
return False

modelseedpy/community/mscommunity.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(
3333
biomass_cpd, # metabolite in the biomass reaction
3434
names=[], # names of the community species #TODO - look into whether there should be a names field
3535
name=None, # the name of a species
36-
index=None # the index of the species
36+
index=None, # the index of the species
3737
):
3838
self.community, self.biomass_cpd = community, biomass_cpd
3939
print(self.biomass_cpd.compartment)

modelseedpy/core/biolog.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,4 @@ def run_plates(self, model, biomass=None, cmp="e"): # !!! biomass is never used
171171
plate.wells[well_id]["growth"] = ovalue
172172
# print(well_id, solution)
173173
# print(well_id, media)
174-
return prev_medium
174+
return prev_medium

modelseedpy/core/fbahelper.py

-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ def validate_dictionary(dictionary, required_keys, optional_keys={}):
287287
return dictionary
288288

289289
@staticmethod
290-
291290
def parse_media(media):
292291
return [cpd.id for cpd in media.data["mediacompounds"]]
293292

modelseedpy/core/msatpcorrection.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(
6060
atp_hydrolysis_id=None,
6161
load_default_medias=True,
6262
forced_media=[],
63-
default_media_path=None
63+
default_media_path=None,
6464
):
6565
"""
6666
:param model:
@@ -285,7 +285,7 @@ def evaluate_growth_media(self):
285285
)
286286
self.media_gapfill_stats[media] = None
287287
output[media.id] = solution.objective_value
288-
288+
289289
if (
290290
solution.objective_value < minimum_obj
291291
or solution.status != "optimal"
@@ -345,6 +345,7 @@ def determine_growth_media2(self, max_gapfilling=None):
345345
Decides which of the test media to use as growth conditions for this model
346346
:return:
347347
"""
348+
348349
def scoring_function(media):
349350
return len(self.media_gapfill_stats[media]["new"].keys()) + 0.5 * len(
350351
self.media_gapfill_stats[media]["reversed"].keys()

modelseedpy/core/msbuilder.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
"cpd15352_c0": -0.00719527989638797,
180180
"cpd11463_c0": -0.5,
181181
"cpd11461_c0": -0.1,
182-
"cpd11462_c0": -0.2
182+
"cpd11462_c0": -0.2,
183183
}
184184

185185

@@ -778,6 +778,7 @@ def gapfill_model(original_mdl, target_reaction, template, media):
778778
rxn.lower_bound = -100
779779
return original_mdl
780780

781+
781782
def build_metabolic_model(
782783
genome,
783784
media=None,

modelseedpy/core/msgapfill.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(
4848
"cpd02701",
4949
"cpd11416",
5050
"cpd15302",
51-
"cpd03091"
51+
"cpd03091",
5252
] # the cpd11416 compound is filtered during model extension with templates
5353
self.gfmodel = self.lp_filename = self.last_solution = None
5454
self.model_penalty = 1

modelseedpy/core/msgenome.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def read_fasta(f, split=DEFAULT_SPLIT, h_func=None):
1818
with open(f, "r") as fh:
1919
return parse_fasta_str(fh.read(), split, h_func)
2020

21+
2122
def parse_fasta_str(faa_str, split=DEFAULT_SPLIT, h_func=None):
2223
features = []
2324
seq = None
@@ -36,7 +37,7 @@ def parse_fasta_str(faa_str, split=DEFAULT_SPLIT, h_func=None):
3637
desc = header_data[
3738
1
3839
] # The unit test throws an error when this is commented
39-
40+
4041
seq = MSFeature(seq_id, "", desc)
4142
else:
4243
if seq:

modelseedpy/fbapkg/basefbapkg.py

+2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121
# Adding a few exception classes to handle different types of errors
2222
class FeasibilityError(Exception):
2323
"""Error in FBA formulation"""
24+
2425
pass
2526

27+
2628
class BaseFBAPkg:
2729
"""
2830
Base class for FBA packages

modelseedpy/fbapkg/flexiblebiomasspkg.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def build_constraint(self, cobra_obj, obj_type):
313313
else:
314314
const = BaseFBAPkg.build_constraint(
315315
self,
316-
"f" + obj_type,
316+
"f" + obj_type,
317317
0,
318318
None,
319319
{biovar: second_entry, object.forward_variable: -1},

modelseedpy/fbapkg/reactionusepkg.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(self, model):
2424
},
2525
)
2626

27-
def build_package(self, rxn_filter=None, reversibility=False):
27+
def build_package(self, rxn_filter=None, reversibility=False):
2828
for rxn in self.model.reactions:
2929
# Checking that reaction passes input filter if one is provided
3030
if rxn_filter == None:

0 commit comments

Comments
 (0)