From 8cbc0960079c7659056ac32bc6ec6be990189c78 Mon Sep 17 00:00:00 2001 From: narayan Date: Fri, 22 Nov 2024 11:16:05 -0500 Subject: [PATCH] minor change --- slsim/lens.py | 4 ++-- tests/test_lens.py | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/slsim/lens.py b/slsim/lens.py index 236c97d3..1b684544 100644 --- a/slsim/lens.py +++ b/slsim/lens.py @@ -355,7 +355,7 @@ def deflector_redshift(self): :return: lens redshift """ - return self.deflector.redshift + return float(self.deflector.redshift) @property def source_redshift_list(self): @@ -365,7 +365,7 @@ def source_redshift_list(self): """ source_redshifts = [] for source in self.source: - source_redshifts.append(source.redshift) + source_redshifts.append(float(source.redshift)) return source_redshifts @property diff --git a/tests/test_lens.py b/tests/test_lens.py index 5da2288c..8fe5eece 100644 --- a/tests/test_lens.py +++ b/tests/test_lens.py @@ -522,10 +522,10 @@ def setup_method(self): path = os.path.dirname(__file__) source_dict1 = Table.read( os.path.join(path, "TestData/source_supernovae_new.fits"), format="fits" - ) + )[0] deflector_dict = Table.read( os.path.join(path, "TestData/deflector_supernovae_new.fits"), format="fits" - ) + )[0] self.source1 = Source( source_dict=source_dict1, cosmo=self.cosmo, @@ -538,10 +538,13 @@ def setup_method(self): sn_absolute_mag_band="bessellb", sn_absolute_zpsys="ab", ) - # We initiate the another Source class with the same source. In this class, - # source position will be different and all the lensing quantities will be different + source_dict2=Table.read( + os.path.join(path, "TestData/source_supernovae_new.fits"), format="fits" + ) + source_dict2["z"] = 0.9 + source_dict2 = source_dict2[0] self.source2 = Source( - source_dict=source_dict1, + source_dict=source_dict2, cosmo=self.cosmo, source_type="point_plus_extended", light_profile="double_sersic",