@@ -137,7 +137,7 @@ def skip_if_fields_missing(fields: list[str], root=False):
137137
138138 def actual_decorator (validator ):
139139 @wraps (validator )
140- def _validator (cls , * args , ** kwargs ):
140+ def _validator (cls , * args : Any , ** kwargs : Any ):
141141 """New validator function."""
142142 values = kwargs .get ("values" )
143143 if values is None :
@@ -180,7 +180,7 @@ def _hash_self(self) -> str:
180180 self .to_hdf5 (bf )
181181 return hashlib .md5 (bf .getvalue ()).hexdigest ()
182182
183- def __init__ (self , ** kwargs ) :
183+ def __init__ (self , ** kwargs : Any ) -> None :
184184 """Init method, includes post-init validators."""
185185 log .begin_capture ()
186186 super ().__init__ (** kwargs )
@@ -274,7 +274,7 @@ def _default(o):
274274
275275 return hashlib .sha256 (json_str .encode ("utf-8" )).hexdigest ()
276276
277- def copy (self , deep : bool = True , validate : bool = True , ** kwargs ) -> Self :
277+ def copy (self , deep : bool = True , validate : bool = True , ** kwargs : Any ) -> Self :
278278 """Copy a Tidy3dBaseModel. With ``deep=True`` and ``validate=True`` as default."""
279279 kwargs .update (deep = deep )
280280 new_copy = pydantic .BaseModel .copy (self , ** kwargs )
@@ -286,7 +286,7 @@ def copy(self, deep: bool = True, validate: bool = True, **kwargs) -> Self:
286286 return new_copy
287287
288288 def updated_copy (
289- self , path : Optional [str ] = None , deep : bool = True , validate : bool = True , ** kwargs
289+ self , path : Optional [str ] = None , deep : bool = True , validate : bool = True , ** kwargs : Any
290290 ) -> Self :
291291 """Make copy of a component instance with ``**kwargs`` indicating updated field values.
292292
@@ -345,7 +345,7 @@ def updated_copy(
345345
346346 return self ._updated_copy (deep = deep , validate = validate , ** {field_name : new_component })
347347
348- def _updated_copy (self , deep : bool = True , validate : bool = True , ** kwargs ) -> Self :
348+ def _updated_copy (self , deep : bool = True , validate : bool = True , ** kwargs : Any ) -> Self :
349349 """Make copy of a component instance with ``**kwargs`` indicating updated field values."""
350350 return self .copy (update = kwargs , deep = deep , validate = validate )
351351
@@ -370,7 +370,7 @@ def from_file(
370370 group_path : Optional [str ] = None ,
371371 lazy : bool = False ,
372372 on_load : Optional [Callable ] = None ,
373- ** parse_obj_kwargs ,
373+ ** parse_obj_kwargs : Any ,
374374 ) -> Self :
375375 """Loads a :class:`Tidy3dBaseModel` from .yaml, .json, .hdf5, or .hdf5.gz file.
376376
@@ -471,7 +471,7 @@ def to_file(self, fname: PathLike) -> None:
471471 return converter (fname = fname )
472472
473473 @classmethod
474- def from_json (cls , fname : PathLike , ** parse_obj_kwargs ) -> Self :
474+ def from_json (cls , fname : PathLike , ** parse_obj_kwargs : Any ) -> Self :
475475 """Load a :class:`Tidy3dBaseModel` from .json file.
476476
477477 Parameters
@@ -536,7 +536,7 @@ def to_json(self, fname: PathLike) -> None:
536536 file_handle .write (json_string )
537537
538538 @classmethod
539- def from_yaml (cls , fname : PathLike , ** parse_obj_kwargs ) -> Self :
539+ def from_yaml (cls , fname : PathLike , ** parse_obj_kwargs : Any ) -> Self :
540540 """Loads :class:`Tidy3dBaseModel` from .yaml file.
541541
542542 Parameters
@@ -759,7 +759,7 @@ def from_hdf5(
759759 fname : PathLike ,
760760 group_path : str = "" ,
761761 custom_decoders : Optional [list [Callable ]] = None ,
762- ** parse_obj_kwargs ,
762+ ** parse_obj_kwargs : Any ,
763763 ) -> Self :
764764 """Loads :class:`Tidy3dBaseModel` instance to .hdf5 file.
765765
@@ -903,7 +903,7 @@ def from_hdf5_gz(
903903 fname : PathLike ,
904904 group_path : str = "" ,
905905 custom_decoders : Optional [list [Callable ]] = None ,
906- ** parse_obj_kwargs ,
906+ ** parse_obj_kwargs : Any ,
907907 ) -> Self :
908908 """Loads :class:`Tidy3dBaseModel` instance to .hdf5.gz file.
909909
@@ -1036,7 +1036,7 @@ def _json_string(self) -> str:
10361036 """
10371037 return self ._json ()
10381038
1039- def _json (self , indent = INDENT , exclude_unset = False , ** kwargs ) -> str :
1039+ def _json (self , indent = INDENT , exclude_unset = False , ** kwargs : Any ) -> str :
10401040 """Overwrites the model ``json`` representation with some extra customized handling.
10411041
10421042 Parameters
@@ -1114,7 +1114,7 @@ def _insert_traced_fields(self, field_mapping: AutogradFieldMap) -> Self:
11141114
11151115 self_dict = self .dict ()
11161116
1117- def insert_value (x , path : tuple [str , ...], sub_dict : dict ):
1117+ def insert_value (x , path : tuple [str , ...], sub_dict : dict ) -> None :
11181118 """Insert a value into the path into a dictionary."""
11191119 current_dict = sub_dict
11201120 for key in path [:- 1 ]:
@@ -1349,13 +1349,13 @@ def __init__(
13491349 self ,
13501350 fname : PathLike ,
13511351 group_path : Optional [str ],
1352- parse_obj_kwargs : Optional [ dict [ str , Any ]] ,
1352+ parse_obj_kwargs : Any ,
13531353 ):
13541354 object .__setattr__ (self , "_lazy_fname" , Path (fname ))
13551355 object .__setattr__ (self , "_lazy_group_path" , group_path )
13561356 object .__setattr__ (self , "_lazy_parse_obj_kwargs" , dict (parse_obj_kwargs or {}))
13571357
1358- def copy (self , ** kwargs ):
1358+ def copy (self , ** kwargs : Any ):
13591359 """Return another lazy proxy instead of materializing."""
13601360 return _LazyProxy (
13611361 self ._lazy_fname ,
0 commit comments