@@ -36,9 +36,6 @@ def __init__(self, mf6, models, solutions, exchanges, tdis, ats):
3636
3737 self .tdis = tdis
3838 self .ats = ats
39- self ._ats_active = True
40- if ats is None :
41- self ._ats_active = False
4239
4340 def __getattr__ (self , item ):
4441 """
@@ -72,7 +69,7 @@ def ats_active(self):
7269 Returns a boolean to indicate if the ATS package is used in this
7370 simulation.
7471 """
75- return self ._ats_active
72+ return self .ats is not None
7673
7774 @property
7875 def ats_period (self ):
@@ -134,9 +131,7 @@ def sln(self):
134131 """
135132 if len (self ._solutions ) > 1 :
136133 return list (self ._solutions .values ())
137- else :
138- for sln in self ._solutions .values ():
139- return sln
134+ return next (iter (self ._solutions .values ()))
140135
141136 @property
142137 def model_names (self ):
@@ -158,7 +153,7 @@ def models(self):
158153 """
159154 Returns a list of ApiModel objects associated with the simulation
160155 """
161- return [ v for _ , v in self ._models .items ()]
156+ return list ( self ._models .values ())
162157
163158 @property
164159 def iteration (self ):
@@ -283,25 +278,7 @@ def load(mf6):
283278 id_var_addr = mf6 .get_var_address ("ID" , name )
284279 if name .startswith ("SLN" ):
285280 continue
286- elif (
287- name .startswith ("GWFIM" )
288- or name .startswith ("GWTIM" )
289- or name .startswith ("GWEIM" )
290- or name .startswith ("PRTIM" )
291- or name .startswith ("CHFIM" )
292- or name .startswith ("OLFIM" )
293- or name .startswith ("SWFIM" )
294- ):
295- continue
296- elif (
297- name .startswith ("GWFCON" )
298- or name .startswith ("GWTCON" )
299- or name .startswith ("GWECON" )
300- or name .startswith ("PRTCON" )
301- or name .startswith ("CHFCON" )
302- or name .startswith ("OLFCON" )
303- or name .startswith ("SWFCON" )
304- ):
281+ elif name [3 :5 ] in ("IM" , "CO" ):
305282 continue
306283 if id_var_addr not in variables :
307284 continue
@@ -321,22 +298,14 @@ def load(mf6):
321298 id_var_addr = mf6 .get_var_address ("ID" , name )
322299 if name .lower () in models or name == "TDIS" :
323300 continue
324- if (
325- name .startswith ("GWFIM" )
326- or name .startswith ("GWTIM" )
327- or name .startswith ("GWEIM" )
328- or name .startswith ("PRTIM" )
329- or name .startswith ("CHFIM" )
330- or name .startswith ("OLFIM" )
331- or name .startswith ("SWFIM" )
332- ):
301+ if name [3 :5 ] == "IM" :
333302 continue
334303 if id_var_addr not in variables :
335304 continue
336305
337306 solution_names .append (t [0 ])
338307
339- idp_names = [ i for i in mf6 .get_value ("__INPUT__/SIM/NAM/SLNMNAMES" )]
308+ idp_names = list ( mf6 .get_value ("__INPUT__/SIM/NAM/SLNMNAMES" ))
340309 solution_types = [
341310 i [:- 1 ].lower () for ix , i in enumerate (mf6 .get_value ("__INPUT__/SIM/NAM/SLNTYPE" )) if idp_names [ix ]
342311 ]
@@ -373,10 +342,8 @@ def load(mf6):
373342 if is_exg (name ) and exchange_name not in exchange_names :
374343 exchange_names .append (exchange_name )
375344
376- # sim_packages: tdis, gwf-gwf, sln
377345 exchanges = {}
378346 for exchange_name in exchange_names :
379- exchange = ApiExchange (mf6 , exchange_name )
380- exchanges [exchange_name .lower ()] = exchange
347+ exchanges [exchange_name .lower ()] = ApiExchange (mf6 , exchange_name )
381348
382349 return ApiSimulation (mf6 , models , solutions , exchanges , tdis , ats )
0 commit comments