Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scale function(_get_mean_var) updated for dense array, speedup upto ~4.65x #3099

Closed
wants to merge 14 commits into from

Merge pull request #2 from scverse/scale-mean-variance

63404f2
Select commit
Loading
Failed to load commit list.
Closed

scale function(_get_mean_var) updated for dense array, speedup upto ~4.65x #3099

Merge pull request #2 from scverse/scale-mean-variance
63404f2
Select commit
Loading
Failed to load commit list.
Azure Pipelines / scverse.scanpy failed Jun 26, 2024 in 23m 54s

Build #20240626.3 had test failures

Details

Tests

  • Failed: 18 (0.25%)
  • Passed: 6,518 (91.65%)
  • Other: 576 (8.10%)
  • Total: 7,112
Code coverage

  • 9556 of 12552 line covered (76.13%)

Annotations

Check failure on line 2042 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / scverse.scanpy

Build log #L2042

Bash exited with code '1'.

Check failure on line 2176 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / scverse.scanpy

Build log #L2176

Bash exited with code '1'.

Check failure on line 2504 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / scverse.scanpy

Build log #L2504

Bash exited with code '1'.

Check failure on line 1849 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / scverse.scanpy

Build log #L1849

Bash exited with code '132'.

Check failure on line 1 in tests/test_score_genes.py::test_score_with_reference

See this annotation in the file changed.

@azure-pipelines azure-pipelines / scverse.scanpy

tests/test_score_genes.py::test_score_with_reference

def test_score_with_reference():
        """
        Checks if score_genes output agrees with pre-computed reference values.
        The reference values had been generated using the same code
        and stored as a pickle object in ./data
        """
    
        adata = paul15()
        sc.pp.normalize_per_cell(adata, counts_per_cell_after=10000)
        sc.pp.scale(adata)
    
        sc.tl.score_genes(adata, gene_list=adata.var_names[:100], score_name="Test")
        with (HERE / "score_genes_reference_paul2015.pkl").open("rb") as file:
            reference = pickle.load(file)
        # np.testing.assert_allclose(reference, adata.obs["Test"].to_numpy())
>       np.testing.assert_array_equal(reference, adata.obs["Test"].to_numpy())

tests/test_score_genes.py:77: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<built-in function eq>, array([-0.2027711941, -0.0095327853, -0.0092715188, ...,  0.2243069104,
       -0.0767864967,...61957]), array([-0.2327050515,  0.0162357776, -0.0057529853, ...,  0.1831248169,
       -0.0875716893, -0.0273508919]))
kwds = {'err_msg': '', 'header': 'Arrays are not equal', 'strict': False, 'verbose': True}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Arrays are not equal
E           
E           Mismatched elements: 2730 / 2730 (100%)
E           Max absolute difference: 0.1607912583
E           Max relative difference: 1538.698935321
E            x: array([-0.202771, -0.009533, -0.009272, ...,  0.224307, -0.076786,
E                  -0.012066])
E            y: array([-0.232705,  0.016236, -0.005753, ...,  0.183125, -0.087572,
E                  -0.027351])

/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/contextlib.py:81: AssertionError
Raw output
/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/contextlib.py:81: AssertionError:

Check failure on line 1 in tests/test_score_genes.py::test_score_with_reference

See this annotation in the file changed.

@azure-pipelines azure-pipelines / scverse.scanpy

tests/test_score_genes.py::test_score_with_reference

def test_score_with_reference():
        """
        Checks if score_genes output agrees with pre-computed reference values.
        The reference values had been generated using the same code
        and stored as a pickle object in ./data
        """
    
        adata = paul15()
        sc.pp.normalize_per_cell(adata, counts_per_cell_after=10000)
        sc.pp.scale(adata)
    
        sc.tl.score_genes(adata, gene_list=adata.var_names[:100], score_name="Test")
        with (HERE / "score_genes_reference_paul2015.pkl").open("rb") as file:
            reference = pickle.load(file)
        # np.testing.assert_allclose(reference, adata.obs["Test"].to_numpy())
>       np.testing.assert_array_equal(reference, adata.obs["Test"].to_numpy())

tests/test_score_genes.py:77: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<built-in function eq>, array([-0.2027711941, -0.0095327853, -0.0092715188, ...,  0.2243069104,
       -0.0767864967,...61957]), array([-0.2327050515,  0.0162357776, -0.0057529853, ...,  0.1831248169,
       -0.0875716893, -0.0273508919]))
kwds = {'err_msg': '', 'header': 'Arrays are not equal', 'strict': False, 'verbose': True}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Arrays are not equal
E           
E           Mismatched elements: 2730 / 2730 (100%)
E           Max absolute difference: 0.1607912583
E           Max relative difference: 1538.698935321
E            x: array([-0.202771, -0.009533, -0.009272, ...,  0.224307, -0.076786,
E                  -0.012066])
E            y: array([-0.232705,  0.016236, -0.005753, ...,  0.183125, -0.087572,
E                  -0.027351])

/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/contextlib.py:81: AssertionError
Raw output
/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/contextlib.py:81: AssertionError:

Check failure on line 1 in tests/test_score_genes.py::test_score_with_reference

See this annotation in the file changed.

@azure-pipelines azure-pipelines / scverse.scanpy

tests/test_score_genes.py::test_score_with_reference

def test_score_with_reference():
        """
        Checks if score_genes output agrees with pre-computed reference values.
        The reference values had been generated using the same code
        and stored as a pickle object in ./data
        """
    
        adata = paul15()
        sc.pp.normalize_per_cell(adata, counts_per_cell_after=10000)
        sc.pp.scale(adata)
    
        sc.tl.score_genes(adata, gene_list=adata.var_names[:100], score_name="Test")
        with (HERE / "score_genes_reference_paul2015.pkl").open("rb") as file:
            reference = pickle.load(file)
        # np.testing.assert_allclose(reference, adata.obs["Test"].to_numpy())
>       np.testing.assert_array_equal(reference, adata.obs["Test"].to_numpy())
E       AssertionError: 
E       Arrays are not equal
E       
E       Mismatched elements: 2730 / 2730 (100%)
E       Max absolute difference: 0.1607912583
E       Max relative difference: 1538.698935321
E        x: array([-0.202771, -0.009533, -0.009272, ...,  0.224307, -0.076786,
E              -0.012066])
E        y: array([-0.232705,  0.016236, -0.005753, ...,  0.183125, -0.087572,
E              -0.027351])

tests/test_score_genes.py:77: AssertionError
Raw output
/home/vsts/work/1/s/tests/test_score_genes.py:77: AssertionError:

Check failure on line 1 in tests/test_backed.py::test_backed_error[sparse-pca]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / scverse.scanpy

tests/test_backed.py::test_backed_error[sparse-pca]

Test failed