@@ -176,8 +176,7 @@ def simulate(
176176
177177 """
178178
179- simu_property = self .property_dict .copy ()
180- simu_property .update (dict (property_dict or {}))
179+ simu_property = {** self .property_dict , ** (property_dict or {})}
181180
182181 simulation_options = {
183182 ** DEFAULT_SIMULATION_OPTIONS ,
@@ -247,10 +246,19 @@ def _strip_tz(x):
247246
248247 write_combitt_from_df (boundary_df , self .simulation_dir / "boundaries.txt" )
249248 full_path = (self .simulation_dir / "boundaries.txt" ).resolve ().as_posix ()
250- self . set_property_dict ({ f"{ self .boundary_table_name } .fileName" : full_path })
249+ simu_property [ f"{ self .boundary_table_name } .fileName" ] = full_path
251250
252- if property_dict is not None :
253- self .set_property_dict (property_dict )
251+ override_property = {
252+ k : v for k , v in (property_dict or {}).items () if v is not None
253+ }
254+
255+ if boundary_df is not None :
256+ override_property [f"{ self .boundary_table_name } .fileName" ] = full_path
257+
258+ if override_property :
259+ self .model .setParameters (
260+ [f"{ k } ={ v } \n " for k , v in override_property .items ()]
261+ )
254262
255263 self .model .setSimulationOptions (om_simu_opt )
256264
@@ -328,6 +336,7 @@ def get_property_dict(self):
328336 return {k : (v .strip () if isinstance (v , str ) else v ) for k , v in raw .items ()}
329337
330338 def set_property_dict (self , property_dict ):
339+ self .property_dict .update (property_dict )
331340 self .model .setParameters (
332341 [f"{ item } ={ val } \n " for item , val in property_dict .items ()]
333342 )
0 commit comments