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

Feature/adapt loading #259

Merged
merged 10 commits into from
Apr 8, 2024
Merged

Feature/adapt loading #259

merged 10 commits into from
Apr 8, 2024

Conversation

Jammy2211
Copy link
Owner

Recent updates changed it so that the AdaptImages were computed and passed to an Analysis object during search chaining pipelines.

However, this meant resuming already completed pipelines is slow, because the adapt images would be computed for each fit even though for fits that are already completed the adapt images are not used.

This PR instead uses an AdaptImageMaker object, which computes the AdaptImages when they are used and then caches them. This means pipelines can be resumed much faster again.

Comment on lines 134 to 142
raise exc.AnalysisException(
"You have begun a model-fit which reconstructs the source using a pixelization.\n\n"
"However, you have not input a `positions_likelihood` object.\n\n"
"It is likely your model-fit will infer an inaccurate solution.\n\n "
""
"Please read the following readthedocs page for a description of why this is, and how to set up"
"a positions likelihood object:\n\n"
""
"https://pyautolens.readthedocs.io/en/latest/general/demagnified_solutions.html"
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can use a triple-quote to avoid having to pass formatting characters as Python interprets its contents literally (although you might not like the indentation)

raise exc.AnalysisException(
                    """You have begun a model-fit which reconstructs the source using a pixelization.

However, you have not input a `positions_likelihood` object.

It is likely your model-fit will infer an inaccurate solution.

Please read the following readthedocs page for a description of why this is, and how to set up a positions likelihood object:
            
https://pyautolens.readthedocs.io/en/latest/general/demagnified_solutions.html"""
                )

file_path=paths._files_path / "tracer.json",
)
except AttributeError:
pass
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be worth quietly logging the error?

directory = path.dirname(path.realpath(__file__))


def test__relocate_pix_border__determines_if_border_pixel_relocation_is_used(
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would be better as multiple tests using fixtures

assert tracer.galaxies[2].mass.einstein_radius == 0.2


def test__tracer_for_instance__subhalo_redshift_rescale_used(analysis_imaging_7x7):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here

@Jammy2211 Jammy2211 merged commit 2a4dc5d into main Apr 8, 2024
0 of 8 checks 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