Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-43357: Assorted fixes/improvements for fitting and plotting #29

Merged
merged 5 commits into from
May 15, 2024

Conversation

taranu
Copy link
Collaborator

@taranu taranu commented May 2, 2024

These are various things that came up during testing. There's no particular theme to the changes.

Copy link

@cmsaunders cmsaunders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor comments...

"""RuntimeError for when there is no data to fit."""

@classmethod
@abstractmethod

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you want this to have @abstractmethod.

@@ -473,6 +473,12 @@ def fit(
if len(flux_total) != 1:
raise RuntimeError(f"len({flux_total=}) != 1; PSF model is badly-formed")
flux_total = flux_total[0]
gaussians_linear = None
if config.fit_linear_init:
flux_total.fixed = False

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a point to setting this, then changing it at line 480? Is flux_total actually a parameter of model_source that is affecting the next line? If so, please add a comment explaining.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is the easiest way to make the next line work correctly, and I added a note about that.

@@ -506,6 +512,7 @@ def fit(
# dummy size for first iteration
size, size_new = 0, 0
fitInputs = FitInputsDummy()
catexp_get_psf_image = catexp.get_psf_image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are you getting out of moving this here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a probably-irrelevant micro-optimization. I could do the same with setting modeller=self.modeller to avoid more attribute retrievals in the for loop, for example.

@taranu taranu force-pushed the tickets/DM-43357 branch from ab9866e to 7c25e83 Compare May 15, 2024 01:28
@taranu taranu merged commit 2631d95 into main May 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants