-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for brainmapper sub-module (#52)
* test create all cell csv * add test for summarise_points_by_region * add export tests and keep original atlas location
- Loading branch information
Showing
3 changed files
with
237 additions
and
13 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import numpy as np | ||
import pytest | ||
|
||
from brainglobe_utils.brainmapper.export import export_points_to_brainrender | ||
|
||
|
||
@pytest.fixture | ||
def points(): | ||
return np.reshape(np.arange(0, 12), (4, 3)) | ||
|
||
|
||
def test_export_brainrender(tmp_path, points): | ||
""" | ||
Test that a .npy file can be saved with correct resolution | ||
""" | ||
resolution = 100 | ||
save_path = tmp_path / "points.npy" | ||
export_points_to_brainrender(points, resolution, save_path) | ||
|
||
reloaded = np.load(save_path) | ||
assert (reloaded == points * resolution).all() |