-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better handling of duplicate posts (i.e. edits)
- Loading branch information
Robert Meyer
committed
Feb 13, 2018
1 parent
d17128b
commit 0c67507
Showing
8 changed files
with
109 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import os | ||
|
||
from pandas.testing import assert_frame_equal | ||
import pandas as pd | ||
|
||
from integration_tests.model_test import temp_dir | ||
from tests.fixtures.random_data import create_n_random_posts | ||
import trufflepig.preprocessing as tppp | ||
|
||
|
||
def test_load_or_preproc(temp_dir): | ||
filename = os.path.join(temp_dir, 'pptest.gz') | ||
|
||
post_frame = pd.DataFrame(create_n_random_posts(10)) | ||
|
||
frame = tppp.load_or_preprocess(post_frame, filename, | ||
ncores=5, chunksize=20) | ||
|
||
assert len(os.listdir(temp_dir)) == 1 | ||
|
||
frame2 = tppp.load_or_preprocess(post_frame, filename, | ||
ncores=5, chunksize=20) | ||
|
||
assert len(os.listdir(temp_dir)) == 1 | ||
assert_frame_equal(frame, frame2) |
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