-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4018ad
commit 764e8dd
Showing
1 changed file
with
30 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from uatk_spc.reader import SPCReaderParquet as SPCReader | ||
import pathlib | ||
import os | ||
|
||
|
||
def get_path(): | ||
return pathlib.Path(os.path.abspath(__file__)).parent.joinpath("data/") | ||
|
||
|
||
TEST_REGION = "test_region" | ||
TEST_PATH = get_path() | ||
|
||
|
||
def test_reader(): | ||
spc = SPCReader(TEST_PATH, TEST_REGION) | ||
print(spc.people) | ||
assert spc.people.shape[0] == 4991 | ||
|
||
|
||
def test_merge_people_and_time_use_diaries(): | ||
spc = SPCReader(TEST_PATH, TEST_REGION) | ||
merged = spc.merge_people_and_time_use_diaries( | ||
{"health": ["bmi"], "demographics": ["age_years"]}, diary_type="weekday_diaries" | ||
) | ||
assert merged.shape == (197_397, 30) | ||
|
||
def test_merge_people_and_households(): | ||
spc = SPCReader(TEST_PATH, TEST_REGION) | ||
merged = spc.merge_people_and_households() | ||
assert merged.shape == (4991, 18) |