@@ -317,9 +317,7 @@ def _write_simulation_settings(self, directory: Path) -> None:
317317
318318 # Add IdfMapping settings
319319 idf_key = self .get_pkgkey (IdfMapping )
320- if idf_key is None :
321- raise ValueError ("No IdfMapping package found in model" )
322- idf_pkg = cast (IdfMapping , self [idf_key ])
320+ idf_pkg = cast (IdfMapping , self [idf_key ]) # type: ignore[index]
323321 simulation_settings .update (idf_pkg ._get_output_settings ())
324322
325323 simulation_settings ["unsa_svat_path" ] = self ._render_unsaturated_database_path (
@@ -361,9 +359,7 @@ def write(
361359
362360 # Get index and svat
363361 grid_key = self .get_pkgkey (GridData )
364- if grid_key is None :
365- raise ValueError ("No GridData package found in model" )
366- grid_pkg = cast (GridData , self [grid_key ])
362+ grid_pkg = cast (GridData , self [grid_key ]) # type: ignore[index]
367363 index , svat = grid_pkg .generate_isactive_svat_arrays ()
368364
369365 # write package contents
@@ -564,9 +560,7 @@ def split(
564560
565561 # First, handle the grid data and determine the overlap.
566562 grid_key = self .get_pkgkey (GridData )
567- if grid_key is None :
568- raise ValueError ("No GridData package found in model" )
569- grid_pkg = cast (GridData , self [grid_key ])
563+ grid_pkg = cast (GridData , self [grid_key ]) # type: ignore[index]
570564 is_in_active_domain = {}
571565
572566 for submodel_name , submodel in partitioned_submodels .items ():
0 commit comments