Source code for ddm.utils

import os
import multiprocessing
from urllib.error import HTTPError
import psutil
from dask.diagnostics import ProgressBar
import pims


[docs]def dask_progressbar(show=True): pbar = ProgressBar() if show: pbar.register() else: pbar.unregister()
[docs]def is_gpu_available(): try: import cupy except ImportError: return False if cupy.cuda.runtime.getDeviceCount() > 0: return True else: return False
[docs]def verify_bioformats_jar(): """Check presence of .jar file for pims.bioformats and download verison 6.5 if missing""" # Catch problem with jar library try: pims.bioformats._find_jar() except HTTPError: pims.bioformats.download_jar(version="6.5")