Commit cd730a6f authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

Fixing tests

parent 5dbc8a1c
Pipeline #5444 failed with stages
in 37 minutes and 17 seconds
...@@ -57,10 +57,13 @@ class HeatmapTask(AnalyticTask): ...@@ -57,10 +57,13 @@ class HeatmapTask(AnalyticTask):
for i in range(df.shape[0])] for i in range(df.shape[0])]
z_df = pd.DataFrame(z_df, columns=df.columns, index=df.index) z_df = pd.DataFrame(z_df, columns=df.columns, index=df.index)
method = 'limma'
if ranking_method in ['mean', 'median', 'variance']:
method = ranking_method
# compute statistic for ranking # compute statistic for ranking
stats = array_stats.get_stats(df=df, subsets=subsets, stats = array_stats.get_stats(df=df, subsets=subsets,
params=params, params=params,
ranking_method=ranking_method) ranking_method=method)
# sort by ranking_value # sort by ranking_value
self.sort(df, stats[ranking_method], ranking_method) self.sort(df, stats[ranking_method], ranking_method)
......
...@@ -21,6 +21,7 @@ class TestBoxplotAnalytics: ...@@ -21,6 +21,7 @@ class TestBoxplotAnalytics:
[104, 'bar', 4]], [104, 'bar', 4]],
columns=['id', 'feature', 'value']) columns=['id', 'feature', 'value'])
results = self.task.main(features=[df_1, df_2], results = self.task.main(features=[df_1, df_2],
transformation='identity',
categories=[], categories=[],
id_filter=[], id_filter=[],
subsets=[]) subsets=[])
...@@ -54,6 +55,7 @@ class TestBoxplotAnalytics: ...@@ -54,6 +55,7 @@ class TestBoxplotAnalytics:
[204, 'bar', 100]], [204, 'bar', 100]],
columns=['id', 'feature', 'value']) columns=['id', 'feature', 'value'])
results = self.task.main(features=[df_1, df_2], categories=[], results = self.task.main(features=[df_1, df_2], categories=[],
transformation='identity',
id_filter=[], subsets=[]) id_filter=[], subsets=[])
df = pd.DataFrame.from_dict(json.loads(results['data'])) df = pd.DataFrame.from_dict(json.loads(results['data']))
assert np.all(df['outlier'] == [True, False, False, False, True, assert np.all(df['outlier'] == [True, False, False, False, True,
...@@ -67,6 +69,7 @@ class TestBoxplotAnalytics: ...@@ -67,6 +69,7 @@ class TestBoxplotAnalytics:
[104, 'foo', 100]], [104, 'foo', 100]],
columns=['id', 'feature', 'value']) columns=['id', 'feature', 'value'])
results = self.task.main(features=[df], categories=[], results = self.task.main(features=[df], categories=[],
transformation='identity',
id_filter=[], subsets=[]) id_filter=[], subsets=[])
assert results['statistics']['foo////s1']['median'] == 2 assert results['statistics']['foo////s1']['median'] == 2
...@@ -86,6 +89,7 @@ class TestBoxplotAnalytics: ...@@ -86,6 +89,7 @@ class TestBoxplotAnalytics:
[105, 'gender', 'male']], [105, 'gender', 'male']],
columns=['id', 'feature', 'value']) columns=['id', 'feature', 'value'])
results = self.task.main(features=[df], categories=[categories], results = self.task.main(features=[df], categories=[categories],
transformation='identity',
id_filter=[], subsets=[]) id_filter=[], subsets=[])
assert 'foo//female//s1' in results['statistics'] assert 'foo//female//s1' in results['statistics']
assert 'foo//male//s1' not in results['statistics'] assert 'foo//male//s1' not in results['statistics']
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment