diff --git a/slsim/lens.py b/slsim/lens.py index d641b783e..2ebbd3ee1 100644 --- a/slsim/lens.py +++ b/slsim/lens.py @@ -802,7 +802,8 @@ def lenstronomy_kwargs(self, band=None): kwargs_model["source_redshift_list"] = self.source_redshift_list elif self.max_redshift_source_class.light_profile == "double_sersic": kwargs_model["source_redshift_list"] = [ - z for z in self.source_redshift_list for _ in range(2)] + z for z in self.source_redshift_list for _ in range(2) + ] kwargs_model["z_source_convention"] = ( self.max_redshift_source_class.redshift ) @@ -905,12 +906,8 @@ def source_light_model_lenstronomy(self, band=None): source_models_list_restructure = source_models_list kwargs_source_list_restructure = kwargs_source_list else:""" - source_models_list_restructure = list( - np.concatenate(source_models_list) - ) - kwargs_source_list_restructure = list( - np.concatenate(kwargs_source_list) - ) + source_models_list_restructure = list(np.concatenate(source_models_list)) + kwargs_source_list_restructure = list(np.concatenate(kwargs_source_list)) source_models["source_light_model_list"] = source_models_list_restructure kwargs_source = kwargs_source_list_restructure else: diff --git a/tests/test_image_simulation.py b/tests/test_image_simulation.py index 7a1e8d59d..a33722d3a 100644 --- a/tests/test_image_simulation.py +++ b/tests/test_image_simulation.py @@ -467,23 +467,23 @@ def setup_method(self): ) self.image1 = sharp_image( - lens_class1, - band="i", - mag_zero_point=27, - delta_pix=0.2, - num_pix=64, - with_source=True, - with_deflector=True, - ) - self.image2=sharp_image( - lens_class2, - band="i", - mag_zero_point=27, - delta_pix=0.2, - num_pix=64, - with_source=True, - with_deflector=False, - ) + lens_class1, + band="i", + mag_zero_point=27, + delta_pix=0.2, + num_pix=64, + with_source=True, + with_deflector=True, + ) + self.image2 = sharp_image( + lens_class2, + band="i", + mag_zero_point=27, + delta_pix=0.2, + num_pix=64, + with_source=True, + with_deflector=False, + ) self.image3 = sharp_image( lens_class3, band="i", @@ -494,10 +494,9 @@ def setup_method(self): with_deflector=True, ) self.combined_image = self.image1 + self.image2 + def test_image_multiple_source(self): - npt.assert_almost_equal( - self.image3, self.combined_image, decimal=8 - ) + npt.assert_almost_equal(self.image3, self.combined_image, decimal=8) if __name__ == "__main__":