Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
nkhadka21 committed Nov 22, 2024
1 parent f79be44 commit 8cbc096
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions slsim/lens.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand Down
13 changes: 8 additions & 5 deletions tests/test_lens.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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",
Expand Down

0 comments on commit 8cbc096

Please sign in to comment.