@@ -45,14 +45,6 @@ def _guard_invalid_params(params1, params2):
4545 missing_param_strings = ", " .join (f"{ p } " for p in missing_params )
4646 raise InvalidParameters (f"Invalid parameter(s): { missing_param_strings } " )
4747
48- @staticmethod
49- def _hash_params (params : dict | list [dict ]) -> int :
50- """Creates an single_params_dict or the repeating_params_list."""
51- if isinstance (params , list ):
52- return hash (tuple ([self ._hash_params (dictionary ) for dictionary in params ]))
53- else :
54- return hash (tuple ([item for _ , item in params .items ()]))
55-
5648 @staticmethod
5749 def _fill_params_dict (template : dict , * args , ** kwargs ) -> dict :
5850 BaseDispersion ._guard_invalid_params (list (kwargs .keys ()), list (template .keys ()))
@@ -97,6 +89,13 @@ def __init__(self, *args, **kwargs):
9789 self .hash_single_params = None
9890 self .hash_rep_params = None
9991
92+ def _hash_params (self , params : dict | list [dict ]) -> int :
93+ """Creates an single_params_dict or the repeating_params_list."""
94+ if isinstance (params , list ):
95+ return hash (tuple ([self ._hash_params (dictionary ) for dictionary in params ]))
96+ else :
97+ return hash (tuple ([item for _ , item in params .items ()]))
98+
10099 @abstractmethod
101100 def dielectric_function (self , lbda : npt .ArrayLike ) -> npt .NDArray :
102101 """Calculates the dielectric function in a given wavelength window.
@@ -134,9 +133,10 @@ def get_dielectric(self, lbda: Optional[npt.ArrayLike] = None) -> npt.NDArray:
134133
135134 from .table_epsilon import TableEpsilon
136135 from .table_index import Table
136+ from .pseudo_dielectric import PseudoDielectricFunction
137137
138138 if not isinstance (self , (DispersionSum , IndexDispersionSum )):
139- if isinstance (self , (TableEpsilon , Table )):
139+ if isinstance (self , (TableEpsilon , Table , PseudoDielectricFunction )):
140140 if self .last_lbda is lbda :
141141 return self .cached_diel
142142 else :
0 commit comments