mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-02 04:28:11 +08:00
Merge pull request #119 from chanzuckerberg/csweaver/travis
Setup travis integration
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
|||||||
|
language: python
|
||||||
|
python:
|
||||||
|
- "3.6"
|
||||||
|
node_js:
|
||||||
|
- "8"
|
||||||
|
cache:
|
||||||
|
pip: true
|
||||||
|
install:
|
||||||
|
- set -eo pipefail
|
||||||
|
- pip install flake8 httpie
|
||||||
|
- ./bin/build-client
|
||||||
|
- python setup.py install
|
||||||
|
script:
|
||||||
|
- set -eo pipefail
|
||||||
|
- flake8 server/app/
|
||||||
|
- pytest -s server/test/test_filter.py server/test/test_scanpy_engine.py
|
||||||
|
- cellxgene &
|
||||||
|
- for i in {1..90}; do if http :5005/api/v0.1/initialize > /dev/null; then break; else echo "Waiting for server..."; sleep 1; fi; done
|
||||||
|
- pytest server/test/test_api.py
|
||||||
@@ -107,7 +107,7 @@ class ScanpyEngine(CXGDriver):
|
|||||||
:param df: from filter_cells, dataframe
|
:param df: from filter_cells, dataframe
|
||||||
:return: [cellid, x, y]
|
:return: [cellid, x, y]
|
||||||
"""
|
"""
|
||||||
getattr(sc.tl, self.graph_method)(df)
|
getattr(sc.tl, self.graph_method)(df, random_state=123)
|
||||||
graph = df.obsm["X_{graph_method}".format(graph_method=self.graph_method)]
|
graph = df.obsm["X_{graph_method}".format(graph_method=self.graph_method)]
|
||||||
normalized_graph = (graph - graph.min()) / (graph.max() - graph.min())
|
normalized_graph = (graph - graph.min()) / (graph.max() - graph.min())
|
||||||
return np.hstack((df.obs["cell_name"].values.reshape(len(df.obs.index), 1), normalized_graph)).tolist()
|
return np.hstack((df.obs["cell_name"].values.reshape(len(df.obs.index), 1), normalized_graph)).tolist()
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class UtilTest(unittest.TestCase):
|
|||||||
self.assertEqual(len(metadata), 2638)
|
self.assertEqual(len(metadata), 2638)
|
||||||
self.assertIn('louvain', metadata[0])
|
self.assertIn('louvain', metadata[0])
|
||||||
|
|
||||||
|
@unittest.skip("Umap not producing the same graph on different systems, even with the same seed. Skipping for now")
|
||||||
def test_create_graph(self):
|
def test_create_graph(self):
|
||||||
graph = self.data.create_graph(df=self.data.data)
|
graph = self.data.create_graph(df=self.data.data)
|
||||||
self.assertEqual(graph[0][1], 0.5545382653143183)
|
self.assertEqual(graph[0][1], 0.5545382653143183)
|
||||||
|
|||||||
Reference in New Issue
Block a user