-
Notifications
You must be signed in to change notification settings - Fork 12
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
Conversation
|
||
from autogalaxy.analysis.adapt_images.adapt_images import AdaptImages | ||
|
||
class AdaptImageMaker: |
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.
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
)
if isinstance(paths, af.DatabasePaths): | ||
return |
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.
Why the exception here? Might be cleaner to put this outside the function
settings typically control the overall run-time. | ||
""" | ||
|
||
if paths is None: |
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
@property | ||
def preloads_cls(self): | ||
return Preloads | ||
|
||
@property | ||
def fit_maker_cls(self): | ||
return FitMaker |
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 also do this by setting class level attributes.
class AnalysisDataset(Analysis):
Preloads = Preloads
FitMaker = FitMaker
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.
Going to do this in a moment when I do it for the Result casting.
os.makedirs(paths.profile_path, exist_ok=True) | ||
self.preloads.output_info_to_summary(file_path=paths.profile_path) |
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.
Handle directory creation right before the data is output (e.g. in the output_info_to_summary
method)
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.