def is_equivalent(self, other, logger, tolerance=0.):
        """
        Test if self and `other` are equivalent.

        other: :class:`FlowSolution`
            The flowfield to check against.

        logger: :class:`Logger` or None
            Used to log debug messages that will indicate what, if anything, is
            not equivalent.

        tolerance: float
            The maximum relative difference in array values to be considered
            equivalent.
        """
        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 __HOLE__:
                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
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/datatypes/domain/flow.py/FlowSolution.is_equivalent