Skip to content

Commit

Permalink
fully tested
Browse files Browse the repository at this point in the history
  • Loading branch information
Jammy2211 committed Sep 2, 2024
1 parent 4202c8f commit 0d802df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions autogalaxy/aggregator/ellipse/fit_ellipse.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from autogalaxy.aggregator.imaging.imaging import _imaging_from
from autogalaxy.aggregator.ellipse.ellipses import _ellipses_from
from autogalaxy.aggregator.ellipse.multipoles import _multipole_list_from
from autogalaxy.aggregator.ellipse.multipoles import _multipoles_from


def _fit_ellipse_from(
Expand Down Expand Up @@ -49,11 +49,19 @@ def _fit_ellipse_from(
dataset_list = _imaging_from(fit=fit)

ellipse_list_list = _ellipses_from(fit=fit, instance=instance)
multipole_list_list = _multipole_list_from(fit=fit, instance=instance)

try:
multipole_list_list = _multipoles_from(fit=fit, instance=instance)
except AttributeError:
multipole_list_list = [[None] * len(ellipse_list_list)] * len(
ellipse_list_list[0]
)

fit_dataset_list = []

for dataset, ellipse_list, multipole_lists in zip(dataset_list, ellipse_list_list, multipole_list_list):
for dataset, ellipse_list, multipole_lists in zip(
dataset_list, ellipse_list_list, multipole_list_list
):
for ellipse, multipole_list in zip(ellipse_list, multipole_lists):
fit_dataset_list.append(
FitEllipse(
Expand Down
4 changes: 2 additions & 2 deletions autogalaxy/aggregator/ellipse/multipoles.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
logger = logging.getLogger(__name__)


def _multipole_list_from(
def _multipoles_from(
fit: af.Fit, instance: af.ModelInstance
) -> List[List[List[EllipseMultipole]]]:
"""
Expand Down Expand Up @@ -107,4 +107,4 @@ def object_via_gen_from(
A manual instance that overwrites the max log likelihood instance in fit (e.g. for drawing the instance
randomly from the PDF).
"""
return _multipole_list_from(fit=fit, instance=instance)
return _multipoles_from(fit=fit, instance=instance)

0 comments on commit 0d802df

Please sign in to comment.