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 #160

Merged
merged 11 commits into from
Apr 8, 2024
Merged

Feature/adapt loading #160

merged 11 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.


from autogalaxy.analysis.adapt_images.adapt_images import AdaptImages

class AdaptImageMaker:
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's a not a huge amount of point in this class given that you could simply call:

result.adapt_images_from(
    use_model_images=self.use_model_images
)

Comment on lines +117 to +118
if isinstance(paths, af.DatabasePaths):
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the exception here? Might be cleaner to put this outside the function

settings typically control the overall run-time.
"""

if paths is None:
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

Comment on lines +64 to +70
@property
def preloads_cls(self):
return Preloads

@property
def fit_maker_cls(self):
return FitMaker
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 also do this by setting class level attributes.

class AnalysisDataset(Analysis):
    Preloads = Preloads
    FitMaker = FitMaker

Copy link
Owner Author

Choose a reason for hiding this comment

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

Going to do this in a moment when I do it for the Result casting.

Comment on lines +139 to +140
os.makedirs(paths.profile_path, exist_ok=True)
self.preloads.output_info_to_summary(file_path=paths.profile_path)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Handle directory creation right before the data is output (e.g. in the output_info_to_summary method)

@Jammy2211 Jammy2211 merged commit e0e5793 into main Apr 8, 2024
1 of 9 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.

None yet

2 participants