def is_equivalent(self, other, logger, tolerance=0.):
        if not isinstance(other, FlowSolution):
            logger.debug('other is not a FlowSolution object.')
            return False

        if other.grid_location != self.grid_location:
            logger.debug('grid locations are not equal: %s vs. %s.',
                         other.grid_location, self.grid_location)
            return False

        if other.ghosts != self.ghosts:
            logger.debug('flow ghost cell counts are not equal: %s vs. %s.',
                         other.ghosts, self.ghosts)
            return False

        for arr in self._arrays:
            name = self.name_of_obj(arr)
            try:
                other_arr = getattr(other, name)
            except AttributeError:
                logger.debug('other is missing array %r', name)
                return False
            if tolerance > 0.:
                if not numpy.allclose(other_arr, arr, tolerance, tolerance):
                    logger.debug("%s values are not 'close'.", name)
                    return False
            else:
                if (other_arr != arr).any():
                    logger.debug('%s values are not equal.', name)
                    return False

        for vector in self._vectors:
            name = self.name_of_obj(vector)
            try:
                other_vector = getattr(other, name)
            except AttributeError:
                logger.debug('other is missing vector %r', name)
                return False
            if not vector.is_equivalent(other_vector, name, logger, tolerance):
                return False

# TODO: check scalars

        return True
Determing index by day from a dataset.
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/datatypes/domain/flow.py/FlowSolution.is_equivalent--crossover with--dataset/ETHPy150Open yinhm/datafeed/datafeed/datastore.py/Day._index_of_day