Skip to content

Global template cache folder + envvar to control its location#371

Merged
arogozhnikov merged 3 commits intomainfrom
kevin/templ
May 1, 2025
Merged

Global template cache folder + envvar to control its location#371
arogozhnikov merged 3 commits intomainfrom
kevin/templ

Conversation

@wukevin
Copy link
Contributor

@wukevin wukevin commented Apr 30, 2025

Description

Redirects template structures to be stored in a globally-shared folder (default repo_root / downloads / template_cifs) that can be overridden by a environment variable CHAI_TEMPLATE_CIF_FOLDER.

Motivation

Inspired by #370 - allows re-using template structures that have already been downloaded, also custom structures (though these need to be saved in the global cache folder as identifier.cif.gz.

Test plan

Tested locally; verified that cache exists and is reused between runs.

@wukevin wukevin requested review from arogozhnikov and Copilot April 30, 2025 17:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR redirects the storage of template structures to a globally shared folder, allowing reuse of cached templates across runs and custom overrides with an environment variable.

  • Updated the docstring for downloading CIF files to indicate no-op behavior when file exists.
  • Introduced a global constant for the template CIF cache folder with an environment variable override.
  • Removed the local template cache folder parameter in favor of the global setting.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
chai_lab/data/io/rcsb.py Updated CIF file download docstring to detail no-op behavior when file exists.
chai_lab/data/dataset/templates/context.py Added global TEMPLATE_CIF_FOLDER from environment variable with a default value.
chai_lab/chai1.py Removed passing of a local template cache folder to use the global setting instead.

@arogozhnikov arogozhnikov changed the title Kevin/templ Global template cache folder + envvar to control its location Apr 30, 2025
@arogozhnikov arogozhnikov merged commit eb63e84 into main May 1, 2025
4 checks passed
@arogozhnikov arogozhnikov deleted the kevin/templ branch May 1, 2025 15:52
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.

3 participants