Skip to content

Commit

Permalink
added scaling factors to config
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjamesgarza committed Apr 16, 2024
1 parent a9bbd04 commit 0a12bc4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/acom_music_box/music_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ def generateReactionConfig(self):
if(reaction.name != None):
reac["MUSICA name"] = reaction.name

if(reaction.scaling_factor != None):
reac["scaling factor"] = reaction.scaling_factor

reactionsArray.append(reac)

reacList["reactions"] = reactionsArray
Expand Down
3 changes: 2 additions & 1 deletion src/acom_music_box/music_box_reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Reaction:
products (List[Product]): A list of Product instances representing the products. Default is an empty list.
"""

def __init__(self, name=None, reaction_type=None, reactants=None, products=None):
def __init__(self, name=None, reaction_type=None, reactants=None, products=None, scaling_factor=None):
"""
Initializes a new instance of the Reaction class.
Expand All @@ -25,6 +25,7 @@ def __init__(self, name=None, reaction_type=None, reactants=None, products=None)
self.reaction_type = reaction_type
self.reactants = reactants if reactants is not None else []
self.products = products if products is not None else []
self.scaling_factor = scaling_factor

def add_reactant(self, reactant):
"""
Expand Down
3 changes: 2 additions & 1 deletion src/acom_music_box/music_box_reaction_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def get_products_from_JSON(self, reaction, species_list):
def get_reactions_from_JSON(self, reaction, species_list):

name = reaction['MUSICA name'] if 'MUSICA name' in reaction else None
scaling_factor = reaction['scaling factor'] if 'scaling factor' in reaction else None
reaction_type = reaction['type']

reactants = ReactionList.get_reactants_from_JSON(reaction, species_list)
Expand Down Expand Up @@ -163,4 +164,4 @@ def get_reactions_from_JSON(self, reaction, species_list):
N = reaction.get('N')
return Troe_Ternary(name, reaction_type, reactants, products, k0_A, k0_B, k0_C, kinf_A, kinf_B, kinf_C, Fc, N)
else:
return Reaction(name, reaction_type, reactants, products)
return Reaction(name, reaction_type, reactants, products, scaling_factor)

0 comments on commit 0a12bc4

Please sign in to comment.