@@ -45,14 +45,6 @@ def _guard_invalid_params(params1, params2):
45
45
missing_param_strings = ", " .join (f"{ p } " for p in missing_params )
46
46
raise InvalidParameters (f"Invalid parameter(s): { missing_param_strings } " )
47
47
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
-
56
48
@staticmethod
57
49
def _fill_params_dict (template : dict , * args , ** kwargs ) -> dict :
58
50
BaseDispersion ._guard_invalid_params (list (kwargs .keys ()), list (template .keys ()))
@@ -97,6 +89,13 @@ def __init__(self, *args, **kwargs):
97
89
self .hash_single_params = None
98
90
self .hash_rep_params = None
99
91
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
+
100
99
@abstractmethod
101
100
def dielectric_function (self , lbda : npt .ArrayLike ) -> npt .NDArray :
102
101
"""Calculates the dielectric function in a given wavelength window.
@@ -134,9 +133,10 @@ def get_dielectric(self, lbda: Optional[npt.ArrayLike] = None) -> npt.NDArray:
134
133
135
134
from .table_epsilon import TableEpsilon
136
135
from .table_index import Table
136
+ from .pseudo_dielectric import PseudoDielectricFunction
137
137
138
138
if not isinstance (self , (DispersionSum , IndexDispersionSum )):
139
- if isinstance (self , (TableEpsilon , Table )):
139
+ if isinstance (self , (TableEpsilon , Table , PseudoDielectricFunction )):
140
140
if self .last_lbda is lbda :
141
141
return self .cached_diel
142
142
else :
0 commit comments