Skip to content

Commit addb7b3

Browse files
Jammy2211Jammy2211
authored andcommitted
cast to float to fix agg
1 parent d514d4b commit addb7b3

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

autolens/lens/tracer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ def __init__(
5050
The cosmology used to perform ray-tracing calculations.
5151
"""
5252

53+
# if isinstance(galaxies, af.ModelInstance):
54+
# galaxies = list(galaxies.values())
55+
5356
self.galaxies = galaxies
5457

5558
self.cosmology = cosmology or ag.cosmo.Planck15()

autolens/lens/tracer_util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def plane_redshifts_from(galaxies: List[ag.Galaxy]) -> List[float]:
3232

3333
galaxies_ascending_redshift = sorted(galaxies, key=lambda galaxy: galaxy.redshift)
3434

35-
plane_redshifts = [galaxy.redshift for galaxy in galaxies_ascending_redshift]
35+
# Coerce to float to avoid issues with other float types not being hashable.
36+
plane_redshifts = [float(galaxy.redshift) for galaxy in galaxies_ascending_redshift]
3637

3738
return list(dict.fromkeys(plane_redshifts))
3839

0 commit comments

Comments
 (0)