Skip to content

Commit

Permalink
Merge pull request #278 from sibirrer/main
Browse files Browse the repository at this point in the history
minor refactoring with inheritance
  • Loading branch information
nkhadka21 authored Nov 15, 2024
2 parents d04efde + 90fad85 commit 6c2f91e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 1 addition & 5 deletions slsim/lens.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
analytical_lens_model_support,
)
from slsim.Util.param_util import ellipticity_slsim_to_lenstronomy
from slsim.LOS.los_individual import LOSIndividual
from lenstronomy.LightModel.light_model import LightModel
from lenstronomy.Util import constants
from lenstronomy.Util import data_util
Expand Down Expand Up @@ -66,7 +65,7 @@ def __init__(
:param los_class: line of sight dictionary (optional, takes these values instead of drawing from distribution)
:type los_class: ~LOSIndividual() class object
"""
self.deflector = deflector_class
super().__init__(source_class=source_class, deflector_class=deflector_class, los_class=los_class)
self.cosmo = cosmo
self.test_area = test_area
self._lens_equation_solver = lens_equation_solver
Expand Down Expand Up @@ -98,9 +97,6 @@ def __init__(
z_source=float(self.max_redshift_source_class.redshift),
cosmo=self.cosmo,
)
if los_class is None:
los_class = LOSIndividual()
self.los_class = los_class

@property
def image_number(self):
Expand Down
4 changes: 4 additions & 0 deletions slsim/lensed_system_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from abc import ABC, abstractmethod
from slsim.LOS.los_individual import LOSIndividual


class LensedSystemBase(ABC):
Expand All @@ -20,6 +21,9 @@ def __init__(self, source_class, deflector_class, los_class):
self.source = source_class
else:
self.source = [source_class]
if los_class is None:
los_class = LOSIndividual()
self.los_class = los_class

@abstractmethod
def deflector_position(self):
Expand Down

0 comments on commit 6c2f91e

Please sign in to comment.