-
Notifications
You must be signed in to change notification settings - Fork 33
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
Conversation
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" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
Recent updates changed it so that the
AdaptImages
were computed and passed to anAnalysis
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 theAdaptImages
when they are used and then caches them. This means pipelines can be resumed much faster again.