def test_scale_rep(count_matrix_format, zero_center): """ Test that it doesn't matter where the array being scaled is in the anndata object. """ X = count_matrix_format(sp.random(100, 200, density=0.3).toarray()) check_rep_mutation(sc.pp.scale, X, zero_center=zero_center) check_rep_results(sc.pp.scale, X, zero_center=zero_center)
def test_log1p_rep(count_matrix_format, base): X = count_matrix_format(sp.random(100, 200, density=0.3).toarray()) check_rep_mutation(sc.pp.log1p, X, base=base) check_rep_results(sc.pp.log1p, X, base=base)
def test_normalize_total_rep(typ, dtype): # Test that layer kwarg works X = typ(sparse.random(100, 50, format="csr", density=0.2, dtype=dtype)) check_rep_mutation(sc.pp.normalize_total, X, fields=["layer"]) check_rep_results(sc.pp.normalize_total, X, fields=["layer"])