Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def hasGlobalParameters(self):
return MapList(p.name for p in self.global_parameters)
def hasSubstrates(self):
return MapList([s.name for s in self.substrates])
def hasFunctions(self):
return MapList([f.name for f in self.functions])
def hasSpecies(self):
return MapList([s.name for s in self.species])
def findReactionsThatIncludeAllSpecifiedReagents(self, *args):
assert len(args) > 1, '\nNeed two or more species for this one!'
setlist = [self.__getattribute__(s).isReagentOf().asSet() for s in args]
isect = setlist[0]
for s in setlist:
isect.intersection_update(s)
return MapList(isect)
def hasReactions(self):
return MapList([r.name for r in self.reactions])
def isProductOf(self):
return MapList([r.name for r in self.prods])
def hasCompartments(self):
return MapList(c.name for c in self.compartments)
def hasAssignmentRules(self):
return MapList([ar.name for ar in self.global_parameters+self.species if hasattr(ar, 'type')=='rate'])