Skip to content

Commit 65b0705

Browse files
ebolyenDorielaGrabocka
authored andcommitted
REF: fix private imports for q2-types refactor (bokulich-lab#95)
1 parent c72d5e9 commit 65b0705

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

q2_assembly/iss/tests/test_iss.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import biom
1919
import pandas as pd
2020
from q2_types.feature_data import DNAIterator
21-
from q2_types.feature_table._transformer import _table_to_dataframe
2221
from qiime2.plugin.testing import TestPluginBase
22+
from qiime2.plugin.util import transform
2323

2424
from q2_assembly.iss.iss import (
2525
_abundances_to_biom,
@@ -153,13 +153,13 @@ def test_abundances_to_biom(self):
153153
glob.glob(os.path.join(self.get_data_path("abundances"), "*.txt"))
154154
)
155155
obs_table = _abundances_to_biom(abunds_fp)
156+
obs_df = transform(obs_table, to_type=pd.DataFrame)
156157

157158
with open(self.get_data_path("abundances/biom_table.tsv"), "r") as f:
158159
exp_table = biom.Table.from_tsv(f, None, None, lambda x: x)
160+
exp_df = transform(exp_table, to_type=pd.DataFrame)
159161

160-
pd.testing.assert_frame_equal(
161-
_table_to_dataframe(obs_table), _table_to_dataframe(exp_table)
162-
)
162+
pd.testing.assert_frame_equal(obs_df, exp_df)
163163

164164
def test_generate_reads_wrong_genome_counts(self):
165165
with self.assertRaisesRegex(Exception, r".*provided 2 kingdom\(s\) but 1.*"):
@@ -189,6 +189,8 @@ def test_generate_reads_action(self, p1, p2, p3):
189189
["samp1", "samp2"], self.test_params_list, test_temp_dir.name
190190
)
191191

192+
obs_abundances_df = transform(obs_abundances, to_type=pd.DataFrame)
193+
192194
exp_genomes = {
193195
"genome1": "ATGCATGC",
194196
"genome2": "GATCGCATGA",
@@ -201,9 +203,8 @@ def test_generate_reads_action(self, p1, p2, p3):
201203

202204
with open(self.get_data_path("abundances/biom_table.tsv"), "r") as f:
203205
exp_biom_table = biom.Table.from_tsv(f, None, None, lambda x: x)
204-
pd.testing.assert_frame_equal(
205-
_table_to_dataframe(obs_abundances), _table_to_dataframe(exp_biom_table)
206-
)
206+
exp_df = transform(exp_biom_table, to_type=pd.DataFrame)
207+
pd.testing.assert_frame_equal(obs_abundances_df, exp_df)
207208

208209

209210
if __name__ == "__main__":

q2_assembly/plugin_setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
SequencesWithQuality,
2020
SingleBowtie2Index,
2121
)
22-
from q2_types.per_sample_sequences._type import AlignmentMap
22+
from q2_types.per_sample_sequences import AlignmentMap
2323
from q2_types.sample_data import SampleData
2424
from qiime2.core.type import Bool, Choices, Properties, Str, TypeMap, Visualization
2525
from qiime2.plugin import Citations, Collection, Int, List, Plugin, Range

0 commit comments

Comments
 (0)