Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cklamann committed Feb 13, 2024
1 parent 2e442f6 commit 300e4a5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
18 changes: 11 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from setuptools import setup, find_packages

setup(
name='starling',
version='0.1.0',
url='https://github.com/camlab-bioml/starling',
name="starling",
version="0.1.0",
url="https://github.com/camlab-bioml/starling",
project_urls={
"Issues": "https://github.com/camlab-bioml/starling/issues",
"Source": "https://github.com/camlab-bioml/starling",
Expand All @@ -12,18 +12,22 @@
author_email="[email protected]",
packages=find_packages(),
package_dir={"starling": "starling"},
package_data={'': ['*.json', "*.html", "*.css"]},
package_data={"": ["*.json", "*.html", "*.css"]},
include_package_data=True,
description="",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
keywords=["imaging cytometry classifier single-cell"],
classifiers=[
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.8"
"Programming Language :: Python :: 3.8",
],
license="MIT",
install_requires=["pip==23.2.1" "torch==1.12.1", "tensorflow==2.14.0",
"pytorch-lightning==2.1.0", "scanpy==1.9.5"],
install_requires=[
"pip==23.2.1" "torch==1.12.1",
"tensorflow==2.14.0",
"pytorch-lightning==2.1.0",
"scanpy==1.9.5",
],
python_requires=">=3.9.0",
)
6 changes: 3 additions & 3 deletions starling/starling.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ def result(self, threshold=0.5) -> None:
# else:
c = self.model_params["log_mu"].detach().exp().cpu().numpy()
# v = self.model_params['log_sigma'].cpu().detach().exp().cpu().numpy()
self.adata.varm[
"st_exp_centroids"
] = c.T # pd.DataFrame(c, columns=self.adata.var_names)
self.adata.varm["st_exp_centroids"] = (
c.T
) # pd.DataFrame(c, columns=self.adata.var_names)

if self.model_cell_size:
self.adata.uns["st_cell_size_centroids"] = (
Expand Down
2 changes: 1 addition & 1 deletion starling/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import torch
from flowsom import flowsom
from scanpy import AnnData
from sklearn.cluster import KMeans, AgglomerativeClustering
from sklearn.cluster import AgglomerativeClustering, KMeans
from sklearn.mixture import GaussianMixture
from torch.utils.data import DataLoader, Dataset

Expand Down
4 changes: 3 additions & 1 deletion tests/test_starling.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ def test_can_instantiate(simple_adata_with_size):
assert type(st.X) == torch.Tensor
assert type(st.S) == torch.Tensor


def test_can_instantiate_without_size(simple_adata):
st = ST(simple_adata, model_cell_size=False)
assert type(st.X) == torch.Tensor
assert st.S is None


def test_prepare_data(simple_adata_km_initialized):
st = ST(simple_adata_km_initialized, model_cell_size=True)
assert getattr(st, 'model_params', None) is None
assert getattr(st, "model_params", None) is None
st.prepare_data()
assert st.model_params is not None

0 comments on commit 300e4a5

Please sign in to comment.