Global template cache folder + envvar to control its location#371
Merged
arogozhnikov merged 3 commits intomainfrom May 1, 2025
Merged
Global template cache folder + envvar to control its location#371arogozhnikov merged 3 commits intomainfrom
arogozhnikov merged 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 variableCHAI_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.