diff --git a/src/acom_music_box/music_box.py b/src/acom_music_box/music_box.py index 01f29daf..1ea95711 100644 --- a/src/acom_music_box/music_box.py +++ b/src/acom_music_box/music_box.py @@ -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 diff --git a/src/acom_music_box/music_box_reaction.py b/src/acom_music_box/music_box_reaction.py index 7aa02cb6..be260763 100644 --- a/src/acom_music_box/music_box_reaction.py +++ b/src/acom_music_box/music_box_reaction.py @@ -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. @@ -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): """ diff --git a/src/acom_music_box/music_box_reaction_list.py b/src/acom_music_box/music_box_reaction_list.py index bd2c31d7..414eb407 100644 --- a/src/acom_music_box/music_box_reaction_list.py +++ b/src/acom_music_box/music_box_reaction_list.py @@ -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) @@ -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)