def test_deepcopy_subset(adata, spmat: type):
    adata.obsp["arr"] = np.zeros((adata.n_obs, adata.n_obs))
    adata.obsp["spmat"] = spmat((adata.n_obs, adata.n_obs))

    adata = deepcopy(adata[:10].copy())

    assert isinstance(adata.obsp["arr"], np.ndarray)
    assert not isinstance(adata.obsp["arr"], ArrayView)
    np.testing.assert_array_equal(adata.obsp["arr"].shape, (10, 10))

    assert isinstance(adata.obsp["spmat"], spmat)
    assert not isinstance(
        adata.obsp["spmat"],
        SparseCSRView if spmat is sparse.csr_matrix else SparseCSCView,
    )
    np.testing.assert_array_equal(adata.obsp["spmat"].shape, (10, 10))
def airgap(airgap, ax=0):
    """creates plot of flux density in airgap"""
    if ax == 0:
        ax = plt.gca()
    ax.set_title('Airgap Flux Density [T]')
    ax.plot(airgap['pos'], airgap['B'],
            label='Max {:4.2f} T'.format(max(airgap['B'])))
    ax.plot(airgap['pos'], airgap['B_fft'],
            label='Base Ampl {:4.2f} T'.format(airgap['Bamp']))
    ax.set_xlabel('Position/°')
    ax.legend()
    ax.grid(True)