Skip to content

Commit a176ab6

Browse files
committed
More pep8 changes.
1 parent 351cd41 commit a176ab6

File tree

3 files changed

+121
-124
lines changed

3 files changed

+121
-124
lines changed

mdlr2mdl.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ def process_mdlr(self, mdlrPath):
5858

5959
# append extended bng-xml to the bng-xml definition (the one that
6060
# doesn't include seed information)
61-
bngxmlestr = writeBXe.mergeBXBXe(
61+
bngxmlestr = writeBXe.merge_bxbxe(
6262
namespace.input + '_total.xml', namespace.input + '_extended.xml')
6363
with open(mdlrPath + '_total.xml', 'w') as f:
6464
f.write(bngxmlestr)
6565

6666
xmlspec = read_bngxml.parseFullXML(namespace.input + '.xml')
6767
# write out the equivalent plain mdl stuffs
68-
mdlDict = write_mdl.construct_mcell(
68+
mdl_dict = write_mdl.construct_mcell(
6969
xmlspec, namespace.input, finalName.split(os.sep)[-1], nauty_dict)
70-
write_mdl.write_mdl(mdlDict, finalName)
70+
write_mdl.write_mdl(mdl_dict, finalName)
7171

7272
def tokenize_seed_elements(self, seed):
7373
# extract species names
@@ -83,10 +83,10 @@ def tokenize_seed_elements(self, seed):
8383

8484
seedList = ['<Model><ListOfSpecies>{0}</ListOfSpecies></Model>'.format(x) for x in seedList]
8585

86-
# seedDict = {x:y for x, y in zip(seedKeys, seedList)}
87-
seedDict = {x.split(';')[0]: y for x, y in zip(seedKeys, seedList) if x.split(';')[1] != '0'}
88-
# print '---', seedDict.keys()
89-
return seedDict
86+
# seed_dict = {x:y for x, y in zip(seedKeys, seedList)}
87+
seed_dict = {x.split(';')[0]: y for x, y in zip(seedKeys, seedList) if x.split(';')[1] != '0'}
88+
# print '---', seed_dict.keys()
89+
return seed_dict
9090

9191
def get_names_from_definition_string(self, defStr):
9292
speciesNames = re.findall('[0-9a-zA-Z_]+\(', defStr)
@@ -122,15 +122,15 @@ def xml2hnauty_species_definitions(self, inputMDLRFile):
122122
# remove encapsulating tags
123123
seed = seed[30:-30]
124124
# get the seed species definitions as a list
125-
seedDict = self.tokenize_seed_elements(seed)
125+
seed_dict = self.tokenize_seed_elements(seed)
126126

127127
nauty_dict = {}
128-
for seed in seedDict:
128+
for seed in seed_dict:
129129
# initialize nfsim with each species definition and get back a
130130
# dirty list where one of the entries is the one we want
131131
#
132132
# XXX: i think i've solved it on the nfsim side, double check
133-
tmpList = self.get_nauty_string(seedDict[seed])
133+
tmpList = self.get_nauty_string(seed_dict[seed])
134134
# and now filter it out...
135135
# get species names from species definition string
136136
speciesNames = self.get_names_from_definition_string(seed)
@@ -152,10 +152,10 @@ def get_nauty_string(self, xmlSpeciesDefinition):
152152
finalName = namespace.output if namespace.output else namespace.input
153153

154154
# mdl to bngl
155-
resultDict = read_mdl.constructBNGFromMDLR(namespace.input, namespace.nfsim)
155+
resultDict = read_mdl.construct_bng_from_mdlr(namespace.input, namespace.nfsim)
156156
outputDir = os.sep.join(namespace.output.split(os.sep)[:-1])
157157
# create bngl file
158-
read_mdl.outputBNGL(resultDict['bnglstr'], bnglPath)
158+
read_mdl.output_bngl(resultDict['bnglstr'], bnglPath)
159159

160160
# temporaryly store bng-xml information in a separate file for display
161161
# purposes
@@ -169,10 +169,10 @@ def get_nauty_string(self, xmlSpeciesDefinition):
169169

170170
read_mdl.bngl2json(namespace.input + '.bngl')
171171
# json 2 plain mdl
172-
mdlDict = write_mdl.constructMDL(
172+
mdl_dict = write_mdl.constructMDL(
173173
namespace.input + '_sbml.xml.json', namespace.input, finalName)
174174
# create an mdl with nfsim-species and nfsim-reactions
175-
write_mdl.write_mdl(mdlDict, finalName)
175+
write_mdl.write_mdl(mdl_dict, finalName)
176176
else:
177177
try:
178178
mdlr2mdl = MDLR2MDL(os.path.join(get_script_path(), 'mcellr.yaml'))

0 commit comments

Comments
 (0)