Skip to content

Commit

Permalink
Remove unused function.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Feb 4, 2025
1 parent c2265dd commit 71d5e73
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions cubids/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""

import json
import re
from pathlib import Path

import numpy as np
Expand All @@ -15,35 +14,6 @@
from cubids.constants import ID_VARS, NON_KEY_ENTITIES


def _get_container_type(image_name):
"""Get and return the container type.
Parameters
----------
image_name : :obj:`str`
The name of the container image.
Returns
-------
:obj:`str`
The container type, either "docker" or "singularity".
Raises
------
:obj:`Exception`
If the container type cannot be determined.
"""
# If it's a file on disk, it must be a singularity image
if Path(image_name).exists():
return "singularity"

# It needs to match a docker tag pattern to be docker
if re.match(r"(?:.+\/)?([^:]+)(?::.+)?", image_name):
return "docker"

raise Exception("Unable to determine the container type of " + image_name)


def _compress_lists(df):
"""Compress lists in a DataFrame to strings.
Expand Down

0 comments on commit 71d5e73

Please sign in to comment.