Skip to content
Snippets Groups Projects
Commit b487168c authored by Bienchen's avatar Bienchen
Browse files

Fallback for Singularity image finding.

parent e9ef7486
Branches
Tags 4.0.2
No related merge requests found
Changes in Release 3.1.1
=================================================================================
* `run_af2` Python package:
* Adapt to new AF2 versioning scheme
* Fallback for picking up the Singularity image automatically
Changes in Release 3.1.0
=================================================================================
......
......@@ -179,7 +179,9 @@ def _assemble_singularity_call( # pylint: disable=too-many-arguments
def _determine_af2_image(af2_image_dir):
"""Select an image from a given directory. File name of the images need to
be of form alphafold-<YYYY-MM-DD>.sif. The path to the latest image will be
returned, determined by the '<YYYY-MM-DD>' component of the file name."""
returned, determined by the '<YYYY-MM-DD>' component of the file name. If
the file name is of different form, an arbitrary file ending with '.sif'
will be used."""
lst_mtch = "0000-00-00"
af2_path = ""
af2_files = os.listdir(af2_image_dir)
......@@ -194,6 +196,8 @@ def _determine_af2_image(af2_image_dir):
if mtch.group(1) > lst_mtch:
af2_path = af2_file
lst_mtch = mtch.group(1)
elif af2_file.endswith(".sif"):
af2_path = af2_file
af2_path = os.path.join(af2_image_dir, af2_path)
return af2_path
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment