forked from LorenFrankLab/spyglass
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
7 changed files
with
155 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
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 |
---|---|---|
@@ -1,12 +1,19 @@ | ||
from datajoint.hash import key_hash | ||
import pytest | ||
|
||
|
||
def test_fetch1_dataframe(lin_v1, lin_merge, lin_merge_key): | ||
hash_df = key_hash( | ||
(lin_merge & lin_merge_key).fetch1_dataframe().round(3).to_dict() | ||
) | ||
hash_exp = "883a7b8aa47931ae7b265660ca27b462" | ||
assert hash_df == hash_exp, "Dataframe differs from expected" | ||
df = (lin_merge & lin_merge_key).fetch1_dataframe().round(3).sum().to_dict() | ||
exp = { | ||
"linear_position": 3249449.258, | ||
"projected_x_position": 472245.797, | ||
"projected_y_position": 317857.473, | ||
"track_segment_id": 31158.0, | ||
} | ||
|
||
for k in exp: | ||
assert ( | ||
pytest.approx(df[k], rel=1e-3) == exp[k] | ||
), f"Value differs from expected: {k}" | ||
|
||
|
||
# TODO: Add more tests of this pipeline, not just the fetch1_dataframe method |
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