Returns attribute generator that yields namedtuples containing
        path value pairs
        
        Parameters
        ----------
        attr : str
            Name of the search attribute

        Returns
        -------
        attr_generator : generator
            Returns a generator that yields named tuples with field names
            path and value.

        Examples
        --------
        >>> gen = h5f.attr_gen('elangle')
        >>> pair = next(gen)
        >>> print(pair.path)
        '/dataset1/where'
        >>> print(pair.value)
        0.5

def attr_gen(self, attr):
        """Returns attribute generator that yields namedtuples containing
        path value pairs
        
        Parameters
        ----------
        attr : str
            Name of the search attribute

        Returns
        -------
        attr_generator : generator
            Returns a generator that yields named tuples with field names
            path and value.

        Examples
        --------
        >>> gen = h5f.attr_gen('elangle')
        >>> pair = next(gen)
        >>> print(pair.path)
        '/dataset1/where'
        >>> print(pair.value)
        0.5

        """
        HiisiHDF._clear_cache()
        HiisiHDF.CACHE['search_attribute'] = attr
        HiisiHDF._find_attr_paths('/', self['/']) # Check root attributes
        self.visititems(HiisiHDF._find_attr_paths)
        path_attr_gen = (PathValue(attr_path, self[attr_path].attrs.get(attr)) for attr_path in HiisiHDF.CACHE['attribute_paths'])
        return path_attr_gen