3131logger .configure (** config )
3232
3333
34- def get_susceptibilities (sources , susceptibility ):
34+ def get_susceptibilities (sources , susceptibility = None ):
3535 """Return a list of length (len(sources)) with susceptibility values
3636 Priority is given at the source level, however if value is not found, it is searched
3737 up the parent tree, if available. Raises an error if no value is found when reached
@@ -141,6 +141,8 @@ def demag_tensor(
141141 if pairs_matching and split != 1 :
142142 msg = "Pairs matching does not support splitting"
143143 raise ValueError (msg )
144+ mask_inds = None
145+ getH_params = {}
144146 if max_dist != 0 :
145147 mask_inds , getH_params , pos0 , rot0 = filter_distance (
146148 src_list , max_dist , return_params = False , return_base_geo = True
@@ -158,7 +160,9 @@ def demag_tensor(
158160 # point matching field and demag tensor
159161 with timelog (f"getH with unit_pol={ unit_pol } " , min_log_time = min_log_time ):
160162 if pairs_matching or max_dist != 0 :
161- polarization = np .repeat (pol_all , len (src_list ), axis = 0 )[mask_inds ]
163+ polarization = np .repeat (pol_all , len (src_list ), axis = 0 )
164+ if mask_inds is not None :
165+ polarization = polarization [mask_inds ]
162166 H_unique = magpy .getH (
163167 "Cuboid" , polarization = polarization , ** getH_params
164168 )
0 commit comments