Skip to content

Commit 9b7bd7a

Browse files
committed
CI and Black lint fixes
1 parent c392f2b commit 9b7bd7a

23 files changed

Lines changed: 190 additions & 150 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
uses: docker/build-push-action@v4.0.0
8787
with:
8888
context: .
89-
push: true
89+
push: ${{ github.event_name != 'pull_request' }}
9090
tags: ${{ steps.meta.outputs.tags }}
9191
labels: ${{ steps.meta.outputs.labels }}
9292

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import bionetgen
1+
import bionetgen
22

33
parameter = bionetgen.modelapi.structs.Parameter("A0", "10")
4-
print(parameter.gen_string())
4+
print(parameter.gen_string())

Issues/rule_keywords/run_pybng.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import bionetgen
22

3-
mname="test_deleteMolecules"
4-
model= bionetgen.bngmodel(mname+".bngl")
3+
mname = "test_deleteMolecules"
4+
model = bionetgen.bngmodel(mname + ".bngl")
55
print(model)

bionetgen/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
def __getattr__(name):
2020
if name in {"SympyOdes", "export_sympy_odes"}:
2121
from .modelapi.sympy_odes import SympyOdes, export_sympy_odes
22+
2223
return locals()[name]
2324
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

bionetgen/atomizer/atomizer/analyzeSBML.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -819,9 +819,9 @@ def loadConfigFiles(self, fileName):
819819
# deal with modifications
820820
if "modificationDefinition" in reactionDefinition_new:
821821
# TODO: Change file format to be nicer?
822-
reactionDefinition[
823-
"modificationDefinition"
824-
] = reactionDefinition_new["modificationDefinition"]
822+
reactionDefinition["modificationDefinition"] = (
823+
reactionDefinition_new["modificationDefinition"]
824+
)
825825
# convert new JSON format to old data format
826826
else:
827827
reactionDefinition["modificationDefinition"] = {}

bionetgen/atomizer/atomizer/atomizationAux.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44

55
class CycleError(Exception):
6-
76
"""Exception raised for errors in the input.
87
98
Attributes:

bionetgen/atomizer/atomizer/resolveSCT.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ def createSpeciesCompositionGraph(
113113
# lexicalDependencyGraph[element], oldDependency))
114114
"""
115115
if self.database.dependencyGraph[element] != []:
116-
self.database.alternativeDependencyGraph[
117-
element
118-
] = lexicalDependencyGraph[element]
116+
self.database.alternativeDependencyGraph[element] = (
117+
lexicalDependencyGraph[element]
118+
)
119119
else:
120120
logMess(
121121
"INFO:LAE009",
@@ -1464,9 +1464,9 @@ def selectBestCandidate(
14641464

14651465
tmpCandidates = namingTmpCandidates
14661466
if loginformation:
1467-
self.database.alternativeDependencyGraph[
1468-
reactant
1469-
] = tmpCandidates
1467+
self.database.alternativeDependencyGraph[reactant] = (
1468+
tmpCandidates
1469+
)
14701470
elif all(
14711471
sorted(x) == sorted(originalTmpCandidates[0])
14721472
for x in originalTmpCandidates
@@ -1568,9 +1568,9 @@ def selectBestCandidate(
15681568
namingTmpCandidates = tmpCandidates
15691569

15701570
else:
1571-
self.database.alternativeDependencyGraph[
1572-
reactant
1573-
] = namingtmpCandidates
1571+
self.database.alternativeDependencyGraph[reactant] = (
1572+
namingtmpCandidates
1573+
)
15741574
logMess(
15751575
"WARNING:SCT111",
15761576
"{0}:stoichiometry analysis:{1}:conflicts with and naming conventions:{2}:Selecting lexical analysis".format(

bionetgen/atomizer/libsbml2bngl.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,9 @@ def extractCompartmentStatistics(
437437
for element in compartmentPairs:
438438
if element[0][0] not in finalCompartmentPairs:
439439
finalCompartmentPairs[element[0][0]] = {}
440-
finalCompartmentPairs[element[0][0]][
441-
tuple([element[0][1], element[1][1]])
442-
] = compartmentPairs[element]
440+
finalCompartmentPairs[element[0][0]][tuple([element[0][1], element[1][1]])] = (
441+
compartmentPairs[element]
442+
)
443443
return finalCompartmentPairs
444444

445445

@@ -1456,16 +1456,16 @@ def analyzeHelper(
14561456
param = ["__epsilon__ 1e-100"] + param
14571457

14581458
if atomize:
1459-
commentDictionary[
1460-
"notes"
1461-
] = "'This is an atomized translation of an SBML model created on {0}.".format(
1462-
time.strftime("%d/%m/%Y")
1459+
commentDictionary["notes"] = (
1460+
"'This is an atomized translation of an SBML model created on {0}.".format(
1461+
time.strftime("%d/%m/%Y")
1462+
)
14631463
)
14641464
else:
1465-
commentDictionary[
1466-
"notes"
1467-
] = "'This is a plain translation of an SBML model created on {0}.".format(
1468-
time.strftime("%d/%m/%Y")
1465+
commentDictionary["notes"] = (
1466+
"'This is a plain translation of an SBML model created on {0}.".format(
1467+
time.strftime("%d/%m/%Y")
1468+
)
14691469
)
14701470
commentDictionary[
14711471
"notes"

bionetgen/atomizer/rulifier/componentGroups.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -681,9 +681,9 @@ def getContextRequirements(
681681
requirementDependencies[molecule][
682682
"doubleActivation"
683683
].append(relationship)
684-
processNodes[molecule]["doubleActivation"][
685-
relationship
686-
] = "{0}_{1}".format(molecule, "_".join(label))
684+
processNodes[molecule]["doubleActivation"][relationship] = (
685+
"{0}_{1}".format(molecule, "_".join(label))
686+
)
687687
elif not combination[0] and combination[1]:
688688
if motif in ["ordering"]:
689689
requirementDependencies[molecule][motif].remove(
@@ -700,14 +700,14 @@ def getContextRequirements(
700700
requirementDependencies[molecule]["reprordering"].append(
701701
relationship
702702
)
703-
processNodes[molecule]["reprordering"][
704-
relationship
705-
] = "{0}_{1}".format(molecule, "_".join(label))
703+
processNodes[molecule]["reprordering"][relationship] = (
704+
"{0}_{1}".format(molecule, "_".join(label))
705+
)
706706

707707
elif not combination[0] and not combination[1]:
708-
processNodes[molecule]["doubleRepression"][
709-
relationship
710-
] = "{0}_{1}".format(molecule, "_".join(label))
708+
processNodes[molecule]["doubleRepression"][relationship] = (
709+
"{0}_{1}".format(molecule, "_".join(label))
710+
)
711711
if motif == "repression":
712712
requirementDependencies[molecule][motif].remove(
713713
relationship

bionetgen/atomizer/rulifier/postAnalysis.py

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ def getParticipatingReactions(self, molecule, componentPair, reactionDictionary)
128128
for x in reactionDictionary[moleculeName][component]
129129
if x in componentPair
130130
]:
131-
correlationList[
132-
(component[0], componentComplement)
133-
] = reactionDictionary[moleculeName][component][
134-
componentComplement
135-
]
131+
correlationList[(component[0], componentComplement)] = (
132+
reactionDictionary[moleculeName][component][
133+
componentComplement
134+
]
135+
)
136136
return correlationList
137137

138138
def getPairsFromMotif(self, motif1, motif2, excludedComponents):
@@ -146,10 +146,10 @@ def getPairsFromMotif(self, motif1, motif2, excludedComponents):
146146
if len(self.motifMoleculeDict[element][molecule]) > 0:
147147
for componentPair in self.motifMoleculeDict[element][molecule]:
148148
if not any(x in excludedComponents for x in componentPair):
149-
correlationList[
150-
componentPair
151-
] = self.getParticipatingReactions(
152-
molecule, componentPair, self.patternXreactions
149+
correlationList[componentPair] = (
150+
self.getParticipatingReactions(
151+
molecule, componentPair, self.patternXreactions
152+
)
153153
)
154154
moleculeCorrelationList[molecule].update(correlationList)
155155
return dict(moleculeCorrelationList)
@@ -283,10 +283,13 @@ def getClassification(keys, translator):
283283
localAnalysisFlag = True
284284
if not any(
285285
[
286-
molecule
287-
in database.prunnedDependencyGraph[x][0]
288-
if len(database.prunnedDependencyGraph[x]) > 0
289-
else molecule in x
286+
(
287+
molecule
288+
in database.prunnedDependencyGraph[x][0]
289+
if len(database.prunnedDependencyGraph[x])
290+
> 0
291+
else molecule in x
292+
)
290293
for x in difference
291294
]
292295
):
@@ -372,9 +375,9 @@ def getContextMotifInformation(self):
372375
"nullrequirement",
373376
"exclusion",
374377
]:
375-
motifDictionary[
376-
frozenset([requirementClass, requirementClass])
377-
] = self.getPairsFromMotif(requirementClass, requirementClass, [])
378+
motifDictionary[frozenset([requirementClass, requirementClass])] = (
379+
self.getPairsFromMotif(requirementClass, requirementClass, [])
380+
)
378381
return motifDictionary
379382

380383
def getComplexReactions(self, threshold=2):
@@ -548,10 +551,10 @@ def runTests():
548551
"nullrequirement",
549552
"exclusion",
550553
]:
551-
motifDictionary[
552-
(requirementClass, requirementClass)
553-
] = modelLearning.getPairsFromMotif(
554-
requirementClass, requirementClass, ["imod"]
554+
motifDictionary[(requirementClass, requirementClass)] = (
555+
modelLearning.getPairsFromMotif(
556+
requirementClass, requirementClass, ["imod"]
557+
)
555558
)
556559
if len(motifDictionary[(requirementClass, requirementClass)]) > 0:
557560
print(

0 commit comments

Comments
 (0)