-
Notifications
You must be signed in to change notification settings - Fork 90
fix: use user-specific temp directories to avoid permission errors #151
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
|
|
||
| """Preprocessing pipelines for template data ran before training/evaluation.""" | ||
|
|
||
| import getpass | ||
| import logging | ||
| import multiprocessing as mp | ||
| import os | ||
|
|
@@ -1602,7 +1603,7 @@ def _prepare_output_directories(self) -> "TemplatePreprocessorSettings": | |
| ) | ||
|
|
||
| self.output_directory = ( | ||
| self.output_directory or Path(tempfile.gettempdir()) / "of3_template_data" | ||
| self.output_directory or Path(tempfile.gettempdir()) / f"of3_template_data_{getpass.getuser()}" | ||
| ) | ||
|
Comment on lines
1605
to
1607
|
||
| base = self.output_directory | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,13 +12,22 @@ | |||||||||||
| # See the License for the specific language governing permissions and | ||||||||||||
| # limitations under the License. | ||||||||||||
|
|
||||||||||||
| import getpass | ||||||||||||
| import json | ||||||||||||
| import logging | ||||||||||||
| import os | ||||||||||||
| import random | ||||||||||||
| import shutil | ||||||||||||
| import tarfile | ||||||||||||
| import tempfile | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| def _get_username() -> str: | ||||||||||||
| """Get current username for user-specific temp directories.""" | ||||||||||||
| try: | ||||||||||||
| return getpass.getuser() | ||||||||||||
| except Exception: | ||||||||||||
| return str(os.getuid()) if hasattr(os, "getuid") else "default" | ||||||||||||
| import time | ||||||||||||
| import warnings | ||||||||||||
|
Comment on lines
+25
to
32
|
||||||||||||
| from dataclasses import dataclass, field | ||||||||||||
|
|
@@ -997,7 +1006,7 @@ class MsaComputationSettings(BaseModel): | |||||||||||
| server_user_agent: str = "openfold" | ||||||||||||
| server_url: Url = Url("https://api.colabfold.com") | ||||||||||||
| save_mappings: bool = True | ||||||||||||
| msa_output_directory: Path = Path(tempfile.gettempdir()) / "of3_colabfold_msas" | ||||||||||||
| msa_output_directory: Path = Path(tempfile.gettempdir()) / f"of3_colabfold_msas_{_get_username()}" | ||||||||||||
|
||||||||||||
| msa_output_directory: Path = Path(tempfile.gettempdir()) / f"of3_colabfold_msas_{_get_username()}" | |
| msa_output_directory: Path = ( | |
| Path(tempfile.gettempdir()) | |
| / f"of3_colabfold_msas_{_get_username()}" | |
| ) |
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.
This line likely exceeds the repo's 88-character limit and will be reformatted by
ruff format --check. Please runruff formator split the path construction across multiple lines.