# Path: calliope/time/funcs.py
# def get_daily_timesteps(data, check_uniformity=False):
# def normalized_copy(data):
# def _copy_non_t_vars(data0, data1):
# def _combine_datasets(data0, data1):
# def _drop_timestep_vars(data, timesteps):
# def apply_clustering(
#     data,
#     timesteps,
#     clustering_func,
#     how,
#     normalize=True,
#     scale_clusters="mean",
#     storage_inter_cluster=True,
#     model_run=None,
#     **kwargs,
# ):
# def resample(data, timesteps, resolution):
#     def _resample(var, how):
# def drop(data, timesteps):
# def lookup_clusters(dataset):
# 
# Path: calliope/exceptions.py
# def _formatwarning(message, category, filename, lineno, line=None):
# def warn(message, _class=ModelWarning):
# def print_warnings_and_raise_errors(warnings=None, errors=None):
# class ModelError(Exception):
# class BackendError(Exception):
# class ModelWarning(Warning):
# class BackendWarning(Warning):


import pandas as pd
from calliope.time import funcs
from calliope import exceptions
"""
Copyright (C) since 2013 Calliope contributors listed in AUTHORS.
Licensed under the Apache 2.0 License (see LICENSE file).

masks.py
~~~~~~~~

Functions to pick timesteps from data given certain criteria.

"""




def _get_array(data, var, tech, **kwargs):
    subset = {"techs": tech}
    if kwargs is not None:
        subset.update({k: v for k, v in kwargs.items()})

    unusable_dims = (
        set(subset.keys()).difference(["techs", "nodes"]).difference(data[var].dims)
    )
    if unusable_dims:

# Path: calliope/time/funcs.py
# def get_daily_timesteps(data, check_uniformity=False):
# def normalized_copy(data):
# def _copy_non_t_vars(data0, data1):
# def _combine_datasets(data0, data1):
# def _drop_timestep_vars(data, timesteps):
# def apply_clustering(
#     data,
#     timesteps,
#     clustering_func,
#     how,
#     normalize=True,
#     scale_clusters="mean",
#     storage_inter_cluster=True,
#     model_run=None,
#     **kwargs,
# ):
# def resample(data, timesteps, resolution):
#     def _resample(var, how):
# def drop(data, timesteps):
# def lookup_clusters(dataset):
# 
# Path: calliope/exceptions.py
# def _formatwarning(message, category, filename, lineno, line=None):
# def warn(message, _class=ModelWarning):
# def print_warnings_and_raise_errors(warnings=None, errors=None):
# class ModelError(Exception):
# class BackendError(Exception):
# class ModelWarning(Warning):
# class BackendWarning(Warning):


# Path: calliope/time/masks.py
import pandas as pd
from calliope.time import funcs
from calliope import exceptions

"""
Copyright (C) since 2013 Calliope contributors listed in AUTHORS.
Licensed under the Apache 2.0 License (see LICENSE file).

masks.py
~~~~~~~~

Functions to pick timesteps from data given certain criteria.

"""




def _get_array(data, var, tech, **kwargs):
    subset = {"techs": tech}
    if kwargs is not None:
        subset.update({k: v for k, v in kwargs.items()})

    unusable_dims = (
        set(subset.keys()).difference(["techs", "nodes"]).difference(data[var].dims)
    )
    if unusable_dims:

        raise exceptions.ModelError(