def test_view_delattr(attr, subset_func):
    base = gen_adata((10, 10))
    orig_hash = joblib.hash(base)
    subset = base[subset_func(base.obs_names), subset_func(base.var_names)]
    empty = ad.AnnData(obs=subset.obs[[]], var=subset.var[[]])

    delattr(subset, attr)

    assert not subset.is_view
    # Should now have same value as default
    assert_equal(getattr(subset, attr), getattr(empty, attr))
    assert orig_hash == joblib.hash(base)  # Original should not be modified
def add_backend(self, backend):
        """
        Adds a new backend to the list

        @param backend_id: the id of the backend to add
        """
        if backend:
            backend_iter = self.liststore.append([
                backend.get_id(),
                self.dialog.get_pixbuf_from_icon_name(backend.get_icon(),
                                                      16),
                backend.get_human_name(),
                self._get_markup_for_tags(backend.get_attached_tags()),
            ])
            self.backendid_to_iter[backend.get_id()] = backend_iter