data.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:ISB-CGC-pipelines 作者: isb-cgc 项目源码 文件源码
def calculateDiskSize(tokenFile=None, fileUuid=None, inputFiles=None, inputFileSize=None, scalingFactor=None, roundToNearestGbInterval=None):
        if inputFiles is not None:
            fileSize = 0
            for f in inputFiles:
                fileSize += int(subprocess.check_output(["gsutil", "du", f]).split(' ')[0])

        elif fileUuid is not None:
            fileSize = GDCDataUtils.getFilesize(fileUuid, tokenFile)

        elif inputFileSize is not None:
            filesize = inputFileSize

        else:
            raise DataUtilsError("Couldn't determine disk size! Please provide a path to an existing file in GCS or a file uuid from the GDC.")

        if scalingFactor is not None:
            scalingFactor = int(scalingFactor)
        else:
            scalingFactor = 1

        if roundToNearestGbInterval is not None:
            roundTo = float(roundToNearestGbInterval) * 1000000000

        else:
            roundTo = 1

        return int(math.ceil(scalingFactor * fileSize / roundTo) * roundTo) / 1000000000
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号