Skip to content

refactor: promote search-zip preservation to a public paths method #1389

Description

@Jammy2211

Overview

_append_to_search_zip (private, in autogalaxy/analysis/adapt_images/adapt_images.py, cross-imported by autolens/analysis/result.py) appends post-completion cache files into a search's .zip so paths.restore() — which deletes the output dir and re-extracts the zip — cannot destroy them on the next resume. That concern belongs to the paths layer: any code writing artifacts into a completed search's files/ needs it (born in PyAutoGalaxy#502 / autolens_profiling#70).

Plan

  • PyAutoFit: public AbstractPaths.preserve_in_zip(file_path) — no-op when the zip is absent; skip when the member already exists; arcname relative to output_path. Unit test: write into a zipped search's files/, preserve, restore(), assert survival.
  • PyAutoGalaxy: call result.paths.preserve_in_zip(...); delete the private helper.
  • PyAutoLens: call self.paths.preserve_in_zip(...); delete the cross-import.
  • PRs ordered PyAutoFit → PyAutoGalaxy → PyAutoLens; behaviour identical throughout.

Suggested branch: feature/preserve-in-zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions