def library_hierarchy_depth(self):
        """ Calculates the library hierarchy depth

        Counting starts at the current library state. So if the there is no upper library state the depth is one.
        
        :return: library hierarchy depth
        :rtype: int
        """
        current_library_hierarchy_depth = 1
        library_root_state = self.get_next_upper_library_root_state()
        while library_root_state is not None:
            current_library_hierarchy_depth += 1
            library_root_state = library_root_state.parent.get_next_upper_library_root_state()
        return current_library_hierarchy_depth