def cost()

in azure-slurm/slurmcc/cli.py [0:0]


    def cost(self, config: Dict, start, end, out, fmt=None):
        """
        Cost analysis and reporting tool that maps Azure costs
        to SLURM Job Accounting data. This is an experimental
        feature.
        """

        curr = datetime.today()
        delta = timedelta(days=365)

        if (curr - start) >= delta:
            raise ValueError("Start date cannot be more than 1 year back from today")

        if start > end:
            raise ValueError("Start date cannot be after end date")
        if end > curr:
            raise ValueError("End date cannot be in the future")
        if start == end:
            end = datetime.combine(end.date(), time(hour=23,minute=59,second=59))

        azcost = azurecost(config)
        driver = cost.CostDriver(azcost, config)
        driver.run(start, end, out, fmt)