-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#8 related refactoring [using dict for rows representation]. Fixed lo…
…gging bug in unit tests.
- Loading branch information
Showing
6 changed files
with
39 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import unittest | ||
from os.path import join, dirname | ||
|
||
from arenets.arekit.common.data.row_ids.base import BaseIDProvider | ||
from arenets.arekit.common.data.views.samples import LinkedSamplesStorageView | ||
from arenets.arekit.contrib.utils.data.readers.csv_pd import PandasCsvReader | ||
|
||
|
||
class TestSamplesStorageView(unittest.TestCase): | ||
|
||
def __get_local_dir(self, local_filepath): | ||
return join(dirname(__file__), local_filepath) | ||
|
||
def test(self): | ||
samples_filepath = self.__get_local_dir("test_data/sample-train.tsv.gz") | ||
reader = PandasCsvReader() | ||
storage = reader.read(samples_filepath) | ||
samples_view = LinkedSamplesStorageView(row_ids_provider=BaseIDProvider()) | ||
for data in samples_view.iter_from_storage(storage): | ||
print(type(data)) | ||
print(len(storage)) |