Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jordenrabasco committed Sep 22, 2024
1 parent 418d156 commit 685d8cb
Showing 1 changed file with 30 additions and 20 deletions.
50 changes: 30 additions & 20 deletions q2_dada2/tests/test_denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ def test_defaults(self):
read_stats_md = dict(md)["Denoised_Read_Stats"]
error_model_md = dict(md)["Error_Plot_Stats"]
self.assertEqual(read_stats_md, exp_md)
self.assertEqual(error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))
self.assertEqual(
error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))

def test_override(self):
with open(self.get_data_path('expected/single-override.tsv')) as fh:
Expand Down Expand Up @@ -94,8 +95,9 @@ def test_override(self):
read_stats_md = dict(md)["Denoised_Read_Stats"]
error_model_md = dict(md)["Error_Plot_Stats"]
self.assertEqual(read_stats_md, exp_md)
self.assertEqual(error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))
self.assertEqual(
error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))

def test_mixed_barcodes_and_ids(self):
demux_seqs = SingleLanePerSamplePairedEndFastqDirFmt(
Expand Down Expand Up @@ -158,8 +160,9 @@ def test_underscore_samples(self):
read_stats_md = dict(md)["Denoised_Read_Stats"]
error_model_md = dict(md)["Error_Plot_Stats"]
self.assertEqual(read_stats_md, exp_md)
self.assertEqual(error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))
self.assertEqual(
error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))

def test_no_chimera_method(self):
with open(self.get_data_path('expected/single-default.tsv')) as fh:
Expand All @@ -184,8 +187,9 @@ def test_no_chimera_method(self):
read_stats_md = dict(md)["Denoised_Read_Stats"]
error_model_md = dict(md)["Error_Plot_Stats"]
self.assertEqual(read_stats_md, exp_md)
self.assertEqual(error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))
self.assertEqual(
error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))

def test_pseudo_pooling(self):
with open(self.get_data_path('expected/single-pseudo.tsv')) as fh:
Expand All @@ -210,8 +214,9 @@ def test_pseudo_pooling(self):
read_stats_md = dict(md)["Denoised_Read_Stats"]
error_model_md = dict(md)["Error_Plot_Stats"]
self.assertEqual(read_stats_md, exp_md)
self.assertEqual(error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))
self.assertEqual(
error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))


class TestDenoisePaired(TestPluginBase):
Expand Down Expand Up @@ -243,8 +248,9 @@ def test_defaults(self):
read_stats_md = dict(md)["Denoised_Read_Stats"]
error_model_md = dict(md)["Error_Plot_Stats"]
self.assertEqual(read_stats_md, exp_md)
self.assertEqual(error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))
self.assertEqual(
error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))

def test_remove_empty(self):
with open(self.get_data_path('expected/paired-remove-empty-default.tsv'
Expand All @@ -269,8 +275,9 @@ def test_remove_empty(self):
read_stats_md = dict(md)["Denoised_Read_Stats"]
error_model_md = dict(md)["Error_Plot_Stats"]
self.assertEqual(read_stats_md, exp_md)
self.assertEqual(error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))
self.assertEqual(
error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))

def test_override(self):
with open(self.get_data_path('expected/paired-override.tsv')) as fh:
Expand Down Expand Up @@ -299,8 +306,9 @@ def test_override(self):
read_stats_md = dict(md)["Denoised_Read_Stats"]
error_model_md = dict(md)["Error_Plot_Stats"]
self.assertEqual(read_stats_md, exp_md)
self.assertEqual(error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))
self.assertEqual(
error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))

def test_all_reads_filtered(self):
with self.assertRaisesRegex(ValueError, 'filter'):
Expand Down Expand Up @@ -362,8 +370,9 @@ def test_no_chimera_method(self):
read_stats_md = dict(md)["Denoised_Read_Stats"]
error_model_md = dict(md)["Error_Plot_Stats"]
self.assertEqual(read_stats_md, exp_md)
self.assertEqual(error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))
self.assertEqual(
error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))


# More thorough tests exist in TestDenoiseSingle --- denoise-pyro is basically
Expand Down Expand Up @@ -401,8 +410,9 @@ def test_defaults(self):
read_stats_md = dict(md)["Denoised_Read_Stats"]
error_model_md = dict(md)["Error_Plot_Stats"]
self.assertEqual(read_stats_md, exp_md)
self.assertEqual(error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))
self.assertEqual(
error_model_md.to_dataframe().replace('', pd.NA, inplace=True),
exp_error_md.to_dataframe().replace('', pd.NA, inplace=True))

def test_trunc_len_bigger_than_max_len(self):
with self.assertRaisesRegex(ValueError, 'max_len'):
Expand Down

0 comments on commit 685d8cb

Please sign in to comment.