Skip to content

Commit 211f3de

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents b73ac9a + 7cf8b5d commit 211f3de

20 files changed

Lines changed: 163 additions & 98 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,27 @@ jobs:
1414

1515
runs-on: ubuntu-latest
1616
strategy:
17+
fail-fast: false
1718
matrix:
18-
python-version: [3.12.12]
19+
python-version: [ "3.10", "3.11", "3.12" ]
1920

2021
steps:
21-
- uses: actions/checkout@v2
22-
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v2
24-
with:
25-
python-version: ${{ matrix.python-version }}
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install -e .[dev,test]
30-
- name: Check style
31-
run: |
32-
black stlearn tests
33-
ruff check stlearn tests
34-
- name: Check types
35-
run: |
36-
mypy stlearn tests
37-
- name: Test with pytest
38-
run: |
39-
pytest
22+
- uses: actions/checkout@v2
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -e .[dev,test]
31+
- name: Check style
32+
run: |
33+
black stlearn tests
34+
ruff check stlearn tests
35+
- name: Check types
36+
run: |
37+
mypy stlearn tests
38+
- name: Test with pytest
39+
run: |
40+
pytest

HISTORY.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
History
33
=======
44

5-
1.2.1 (2025-10-20)
5+
1.2.2 (2025-10-20)
66
------------------
77
* Added support for Python 3.11 and 3.12.
88
* Upgraded scanpy to 1.11 - clustering will be different.

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ undissociated tissue sample.
3838
Latest Additions
3939
----------------
4040

41-
.. include:: release_notes/1.2.1.rst
41+
.. include:: release_notes/1.2.2.rst
4242

4343
.. include:: release_notes/1.1.5.rst
4444

docs/references.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ References
2424
*UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction*,
2525
`arXiv <https://arxiv.org/abs/1802.03426>`__.
2626
27-
.. [Weinreb16] Weinreb *et al.* (2016),
27+
.. [Weinreb17] Weinreb *et al.* (2017),
2828
*SPRING: a kinetic interface for visualizing high dimensional single-cell expression data*,
2929
`bioRxiv <https://doi.org/10.1101/090332>`__.
3030
@@ -36,10 +36,6 @@ References
3636
*Massively parallel digital transcriptional profiling of single cells*,
3737
`Nature Communications <https://doi.org/10.1038/ncomms14049>`__.
3838
39-
.. [Weinreb17] Weinreb *et al.* (2016),
40-
*SPRING: a kinetic interface for visualizing high dimensional single-cell expression data*,
41-
`bioRxiv <https://doi.org/10.1101/090332>`__.
42-
4339
.. [Blondel08] Blondel *et al.* (2008),
4440
*Fast unfolding of communities in large networks*,
4541
`J. Stat. Mech. <https://doi.org/10.1088/1742-5468/2008/10/P10008>`__.

docs/release_notes/1.1.5.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
~~~~~~~~~~~~~~~~~~~~~~~~~
33

44
.. rubric:: Features
5+
56
* Add Leiden clustering wrapper.
6-
* Fix documentation, refactor code in spatial.SME.
7+
* Fix documentation, refactor code in spatial.SME.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
1.2.1 `2025-10-20`
1+
1.2.2 `2025-10-20`
22
~~~~~~~~~~~~~~~~~~~~~~~~~
33

44
.. rubric:: Features
5+
56
* Added support for Python 3.11 and 3.12.
67
* Upgraded scanpy to 1.11 - clustering will be different.
78
* Added more CCI tests.
89

910
.. rubric:: Bugs
10-
* Fixed copy-paste error in louvain.py file.
11+
12+
* Fixed copy-paste error in louvain.py file.

docs/release_notes/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Release Notes
22
===================================================
33

4-
.. include:: 1.2.1.rst
4+
.. include:: 1.2.2.rst
55

66
.. include:: 1.1.5.rst
77

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "stlearn"
7-
version = "1.2.1"
7+
version = "1.2.2"
88
authors = [
99
{name = "Genomics and Machine Learning lab", email = "andrew.newman@uq.edu.au"},
1010
]

stlearn/embedding/ica.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,22 @@ def run_ica(
2626
or 'cube'.
2727
You can also provide your own function. It should return a tuple
2828
containing the value of the function, and of its derivative, in the
29-
point. Example:
30-
def my_g(x):
31-
return x ** 3, (3 * x ** 2).mean(axis=-1)
29+
point. Example::
30+
31+
def my_g(x):
32+
return x ** 3, (3 * x ** 2).mean(axis=-1)
3233
tol
3334
Tolerance on update at each iteration.
3435
use_data
3536
if None, then using all the gene expression profile. Else, use
3637
the chosen data from adata.obsm.
3738
copy
3839
Return a copy instead of writing to adata.
40+
3941
Returns
4042
-------
4143
Depending on `copy`, returns or updates `adata` with the following fields.
4244
`X_ica` : :class:`numpy.ndarray` (`adata.obsm`)
43-
Independent Component Analysis representation of data.
4445
"""
4546

4647
adata = adata.copy() if copy else adata

stlearn/embedding/pca.py

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ def run_pca(
2020
) -> AnnData | None:
2121
"""\
2222
Wrap function scanpy.pp.pca
23+
2324
Principal component analysis [Pedregosa11]_.
2425
Computes PCA coordinates, loadings and variance decomposition.
2526
Uses the implementation of *scikit-learn* [Pedregosa11]_.
27+
2628
Parameters
2729
----------
2830
data
@@ -38,12 +40,12 @@ def run_pca(
3840
Passing `None` decides automatically based on sparseness of the data.
3941
svd_solver
4042
SVD solver to use:
41-
`'arpack'` (the default - deterministic)
42-
for the ARPACK wrapper in SciPy (:func:`~scipy.sparse.linalg.svds`)
43-
`'randomized'`
44-
for the randomized algorithm due to Halko (2009).
45-
`'auto'`
46-
chooses automatically depending on the size of the problem.
43+
44+
- `'arpack'` (the default - deterministic) for the ARPACK wrapper in
45+
SciPy (:func:`~scipy.sparse.linalg.svds`)
46+
- `'randomized'` for the randomized algorithm due to Halko (2009).
47+
- `'auto'` chooses automatically depending on the size of the problem.
48+
4749
random_state
4850
Change to use different initial states for the optimization.
4951
return_info
@@ -52,7 +54,7 @@ def run_pca(
5254
use_highly_variable
5355
Whether to use highly variable genes only, stored in
5456
`.var['highly_variable']`.
55-
By default uses them if they have been determined beforehand.
57+
By default, uses them if they have been determined beforehand.
5658
dtype
5759
Numpy data type string to which to convert the result.
5860
copy
@@ -65,22 +67,21 @@ def run_pca(
6567
chunk_size
6668
Number of observations to include in each chunk.
6769
Required if `chunked=True` was passed.
70+
6871
Returns
6972
-------
70-
X_pca : :class:`~scipy.sparse.spmatrix`, :class:`~numpy.ndarray`
73+
X_pca: :class:`~scipy.sparse.spmatrix`, :class:`~numpy.ndarray`
7174
If `data` is array-like and `return_info=False` was passed,
72-
this function only returns `X_pca`…
73-
adata : anndata.AnnData
74-
…otherwise if `copy=True` it returns or else adds fields to `adata`:
75-
`.obsm['X_pca']`
76-
PCA representation of data.
77-
`.varm['PCs']`
78-
The principal components containing the loadings.
79-
`.uns['pca']['variance_ratio']`
80-
Ratio of explained variance.
81-
`.uns['pca']['variance']`
82-
Explained variance, equivalent to the eigenvalues of the
83-
covariance matrix.
75+
this function only returns `X_pca`.
76+
adata: anndata.AnnData
77+
Otherwise if `copy=True` it returns or else adds fields to `adata`:
78+
79+
- `.obsm['X_pca']` - PCA representation of data.
80+
- `.varm['PCs']` - The principal components containing the loadings.
81+
- `.uns['pca']['variance_ratio']` - Ratio of explained variance.
82+
- `.uns['pca']['variance']` - Explained variance, equivalent to the
83+
eigenvalues of the covariance matrix.
84+
8485
"""
8586

8687
adata = scanpy.pp.pca(

0 commit comments

Comments
 (0)