# Path: argos/utils/cls.py
# def check_class(obj, target_class, allow_none = False):
#     """ Checks that the  obj is a (sub)type of target_class.
#         Raises a TypeError if this is not the case.
# 
#         :param obj: object whos type is to be checked
#         :type obj: any type
#         :param target_class: target type/class
#         :type target_class: any class or type
#         :param allow_none: if true obj may be None
#         :type allow_none: boolean
#     """
#     if not isinstance(obj, target_class):
#         if not (allow_none and obj is None):
#             raise TypeError("obj must be a of type {}, got: {}"
#                             .format(target_class, type(obj)))
# 
# def is_an_array(var, allow_none=False):
#     """ Returns True if var is a numpy array.
#     """
#     return isinstance(var, np.ndarray) or (var is None and allow_none)
# 
# def check_is_an_array(var, allow_none=False):
#     """ Calls is_an_array and raises a type error if the check fails.
#     """
#     if not is_an_array(var, allow_none=allow_none):
#         raise TypeError("var must be a NumPy array, however type(var) is {}"
#                         .format(type(var)))
# 
# def array_is_structured(array):
#     """ Returns True if the array has a structured data type.
#     """
#     return bool(array.dtype.names)


import logging
import numpy as np
import numpy.ma as ma
from argos.utils.cls import check_class, is_an_array, check_is_an_array, array_is_structured
    def __init__(self, data, mask, fill_value):
        """ Constructor

            :param data:
            :param mask: array with mask or single boolean for the complete mask
            :param fill_value:
        """
        check_is_an_array(data)
        check_class(mask, (np.ndarray, bool, np.bool_))

        # Init fields
        self._data = None
        self._mask = None
        self._fill_value= None

        # Use setters
        self.data = data
        self.mask = mask
        self.fill_value= fill_value


    @property
    def data(self):
        """ The array values. Will be a numpy array."""
        return self._data


    @data.setter
    def data(self, values):
        """ The array values. Must be a numpy array."""

# Path: argos/utils/cls.py
# def check_class(obj, target_class, allow_none = False):
#     """ Checks that the  obj is a (sub)type of target_class.
#         Raises a TypeError if this is not the case.
# 
#         :param obj: object whos type is to be checked
#         :type obj: any type
#         :param target_class: target type/class
#         :type target_class: any class or type
#         :param allow_none: if true obj may be None
#         :type allow_none: boolean
#     """
#     if not isinstance(obj, target_class):
#         if not (allow_none and obj is None):
#             raise TypeError("obj must be a of type {}, got: {}"
#                             .format(target_class, type(obj)))
# 
# def is_an_array(var, allow_none=False):
#     """ Returns True if var is a numpy array.
#     """
#     return isinstance(var, np.ndarray) or (var is None and allow_none)
# 
# def check_is_an_array(var, allow_none=False):
#     """ Calls is_an_array and raises a type error if the check fails.
#     """
#     if not is_an_array(var, allow_none=allow_none):
#         raise TypeError("var must be a NumPy array, however type(var) is {}"
#                         .format(type(var)))
# 
# def array_is_structured(array):
#     """ Returns True if the array has a structured data type.
#     """
#     return bool(array.dtype.names)


# Path: argos/utils/masks.py
import logging
import numpy as np
import numpy.ma as ma
from argos.utils.cls import check_class, is_an_array, check_is_an_array, array_is_structured

    def __init__(self, data, mask, fill_value):
        """ Constructor

            :param data:
            :param mask: array with mask or single boolean for the complete mask
            :param fill_value:
        """
        check_is_an_array(data)
        check_class(mask, (np.ndarray, bool, np.bool_))

        # Init fields
        self._data = None
        self._mask = None
        self._fill_value= None

        # Use setters
        self.data = data
        self.mask = mask
        self.fill_value= fill_value


    @property
    def data(self):
        """ The array values. Will be a numpy array."""
        return self._data


    @data.setter
    def data(self, values):
        """ The array values. Must be a numpy array."""

        check_is_an_array(values)