Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Build a GillesPy2 reaction.
Attributes
----------
args : dict
A json representation of a reaction.
parameters : list
List of GillesPy2 parameters.
'''
if args['reactionType'] not in 'custom-propensity':
rate = list(filter(lambda p: p.name == args['rate']['name'], parameters))[0]
propensity = None
else:
rate = None
propensity = args['propensity']
R = Reaction(
name=args['name'],
reactants=self.build_stoich_species_dict(args['reactants']),
products=self.build_stoich_species_dict(args['products']),
rate=rate,
propensity_function=propensity
)
return R