def test_modify_view_component(matrix_type, mapping_name):
    adata = ad.AnnData(
        np.zeros((10, 10)),
        **{mapping_name: dict(m=matrix_type(asarray(sparse.random(10, 10))))},
    )
    init_hash = joblib.hash(adata)

    subset = adata[:5, :][:, :5]
    assert subset.is_view
    m = getattr(subset, mapping_name)["m"]
    m[0, 0] = 100
    assert not subset.is_view
    assert getattr(subset, mapping_name)["m"][0, 0] == 100

    assert init_hash == joblib.hash(adata)
def _theme_widget_style(layout, widget_style):

        row = layout.row()

        subsplit = row.split(percentage=0.95)

        padding = subsplit.split(percentage=0.15)
        colsub = padding.column()
        colsub = padding.column()
        colsub.row().prop(widget_style, "outline")
        colsub.row().prop(widget_style, "item", slider=True)
        colsub.row().prop(widget_style, "inner", slider=True)
        colsub.row().prop(widget_style, "inner_sel", slider=True)

        subsplit = row.split(percentage=0.85)

        padding = subsplit.split(percentage=0.15)
        colsub = padding.column()
        colsub = padding.column()
        colsub.row().prop(widget_style, "text")
        colsub.row().prop(widget_style, "text_sel")
        colsub.prop(widget_style, "show_shaded")
        subsub = colsub.column(align=True)
        subsub.active = widget_style.show_shaded
        subsub.prop(widget_style, "shadetop")
        subsub.prop(widget_style, "shadedown")

        layout.separator()