Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyrosettacluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Please refer to the following table to select _one_ environment file extraction
> Also note the `record["instance"]["sha1"]` nested key value holding the GitHub commit SHA1 required to [reproduce the PyRosettaCluster simulation](#clone-original-repository)!

> [!NOTE]
> **Extraction method #2:** If running `dump_env_file.py`, the `pyrosetta` package (with version >=2025.47) must be installed in any existing virtual environment, and that virtual environment's python interpreter used to run the script.
> **Extraction method #2:** If running `dump_env_file.py`, the `pyrosetta` package (with version `>=2025.47`) and the [PyPI pyrosetta-distributed](https://pypi.org/project/pyrosetta-distributed/) package (for the `pyrosetta.distributed` framework dependencies) must be installed in any existing virtual environment, and that virtual environment's python interpreter used to run the script.
>
> Also note the printed GitHub commit SHA1 required to [reproduce the PyRosettaCluster simulation](#clone-original-repository)!

Expand Down Expand Up @@ -238,3 +238,4 @@ if __name__ == "__main__":




19 changes: 9 additions & 10 deletions pyrosettacluster/dump_env_file.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Extract and write a PyRosettaCluster environment file based on
metadata from a PyRosettaCluster result. This script requires PyRosetta version >=2025.47
to be installed for the PyRosettaCluster environment file extraction.
Extract and write a PyRosettaCluster environment file based on metadata from a PyRosettaCluster
output decoy file or PyRosettaCluster output scorefile. This script requires PyRosetta version
`>=2025.47` and `pyrosetta.distributed` framework dependencies to be installed.
"""

__author__ = "Jason C. Klima"
Expand Down Expand Up @@ -68,7 +68,10 @@ def main(
env_manager = metadata_kwargs.get("environment_manager") # may be `None` in legacy cases

sha1 = instance_kwargs.get("sha1")
print("[INFO] " + "-" * 72)
print("[INFO] Please note the GitHub SHA1 from which the original simulation was run!")
print(f"[INFO] GitHub SHA1: {sha1}")
print("[INFO] " + "-" * 72)

# Determine output files based on manager
if env_manager == "pixi":
Expand Down Expand Up @@ -152,12 +155,7 @@ def ensure_env_dir(path: Optional[str]) -> str:


if __name__ == "__main__":
parser = argparse.ArgumentParser(
description=(
"Dump a PyRosettaCluster environment file using metadata contained in a "
"PyRosettaCluster output decoy file or PyRosettaCluster output scorefile."
)
)
parser = argparse.ArgumentParser(description=__doc__)

# -------------------------------------------------------------------------
# Inputs for `pyrosetta.distributed.cluster.get_instance_kwargs`
Expand Down Expand Up @@ -204,7 +202,7 @@ def ensure_env_dir(path: Optional[str]) -> str:
# -------------------------------------------------------------------------
parser.add_argument(
"--env_dir",
type=ensure_env_dir,
type=str,
required=False,
default=None,
help=(
Expand Down Expand Up @@ -247,6 +245,7 @@ def ensure_env_dir(path: Optional[str]) -> str:
)

args = parser.parse_args()
args.env_dir = ensure_env_dir(args.env_dir)

main(
input_file=args.input_file,
Expand Down
10 changes: 6 additions & 4 deletions pyrosettacluster/recreate_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
The environment manager used (i.e., either 'conda', 'mamba', 'uv', or 'pixi') is
automatically determined from the operating system environment variable
'PYROSETTACLUSTER_ENVIRONMENT_MANAGER' if exported, or otherwise it must be
provided using the `--env_manager` flag. Run `./recreate_env.py --help` for more details.
provided using the `--env_manager` flag.
"""

__author__ = "Jason C. Klima"
Expand Down Expand Up @@ -217,7 +217,7 @@ def validate_env_manager(manager: str) -> str:
parser = argparse.ArgumentParser(
description=(
"Recreate a PyRosettaCluster environment using one of the supported "
"environment managers ('pixi', 'uv', 'conda', 'mamba')."
f"environment managers ('pixi', 'uv', 'conda', 'mamba').\n{__doc__}"
)
)

Expand Down Expand Up @@ -261,8 +261,10 @@ def validate_env_manager(manager: str) -> str:
type=int,
default=[0, 1],
help=(
"Optionally specify the PyRosetta installer mirror order to try, e.g. `--mirror_order 0 1`. "
"See the PyPI 'pyrosetta-installer' package website for details."
"Optionally, if using the `uv` environment manager and the `pyrosetta-installer` package "
"is specified as a dependency in the `requirements.txt` file, then this option sets the "
"PyRosetta installer mirror order to try, e.g. `--mirror_order 0 1`. If not using `uv`, "
"this option is ignored. See the PyPI 'pyrosetta-installer' package website for details."
),
)

Expand Down
Loading