1- from .utils import convert_time , convert_pressure , convert_temperature , convert_concentration
1+ from .utils import convert_pressure , convert_temperature , convert_concentration
22from .species_concentration import SpeciesConcentration
33from .species import Species
44from .reaction_rate import ReactionRate
99from .reaction_rate import ReactionRate
1010from .species import Species
1111from .species_concentration import SpeciesConcentration
12- from .utils import convert_time , convert_pressure , convert_temperature , convert_concentration
1312
1413import logging
1514logger = logging .getLogger (__name__ )
@@ -54,7 +53,7 @@ def __str__(self):
5453 return f"Pressure: { self .pressure } , Temperature: { self .temperature } , Species Concentrations: { self .species_concentrations } , Reaction Rates: { self .reaction_rates } "
5554
5655 @classmethod
57- def from_UI_JSON (cls , UI_JSON , species_list , reaction_list ):
56+ def from_UI_JSON (self , UI_JSON , species_list , reaction_list ):
5857 """
5958 Creates an instance of the class from a UI JSON object.
6059
@@ -108,15 +107,15 @@ def from_UI_JSON(cls, UI_JSON, species_list, reaction_list):
108107
109108 reaction_rates .append (ReactionRate (reaction_from_list , rate ))
110109
111- return cls (
110+ return self (
112111 pressure ,
113112 temperature ,
114113 species_concentrations ,
115114 reaction_rates )
116115
117116 @classmethod
118117 def from_config_JSON (
119- cls ,
118+ self ,
120119 path_to_json ,
121120 config_JSON ,
122121 species_list ,
@@ -164,7 +163,7 @@ def from_config_JSON(
164163 for chem_spec in config_JSON ['chemical species' ]:
165164 species = Species (name = chem_spec )
166165 concentration = convert_concentration (
167- config_JSON ['chemical species' ][chem_spec ], 'initial value' )
166+ config_JSON ['chemical species' ][chem_spec ], 'initial value' , temperature , pressure )
168167
169168 species_concentrations .append (
170169 SpeciesConcentration (
@@ -190,14 +189,14 @@ def from_config_JSON(
190189 if not reaction_exists :
191190 reaction_rates .append (ReactionRate (reaction , 0 ))
192191
193- return cls (
192+ return self (
194193 pressure ,
195194 temperature ,
196195 species_concentrations ,
197196 reaction_rates )
198197
199198 @classmethod
200- def read_initial_rates_from_file (cls , file_path , reaction_list ):
199+ def read_initial_rates_from_file (self , file_path , reaction_list ):
201200 """
202201 Reads initial reaction rates from a file.
203202
0 commit comments