Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed tests, restructuring iterability of structures
- Loading branch information
Showing
9 changed files
with
145 additions
and
81 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 |
---|---|---|
|
@@ -4,3 +4,4 @@ tifffile | |
treelib | ||
pandas | ||
requests | ||
meshio |
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,8 +1,10 @@ | ||
import pytest | ||
from brainatlas_api.bg_atlas import TestAtlas | ||
import tempfile | ||
from brainatlas_api.bg_atlas import ExampleAtlas | ||
|
||
# import tempfile | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def atlas_path(): | ||
return TestAtlas(brainglobe_path=tempfile.mkdtemp()).root_dir | ||
# brainglobe_path=tempfile.mkdtemp() | ||
return ExampleAtlas().root_dir |
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,36 @@ | ||
from brainatlas_api.structure_class import StructuresDict | ||
|
||
|
||
struct_list = [ | ||
{ | ||
"acronym": "root", | ||
"id": 997, | ||
"name": "root", | ||
"structure_id_path": [997], | ||
"rgb_triplet": [255, 255, 255], | ||
"mesh_filename": None, | ||
}, | ||
{ | ||
"acronym": "grey", | ||
"id": 8, | ||
"name": "Basic cell groups and regions", | ||
"structure_id_path": [997, 8], | ||
"rgb_triplet": [191, 218, 227], | ||
"mesh_filename": None, | ||
}, | ||
{ | ||
"acronym": "CH", | ||
"id": 567, | ||
"name": "Cerebrum", | ||
"structure_id_path": [997, 8, 567], | ||
"rgb_triplet": [176, 240, 255], | ||
"mesh_filename": None, | ||
}, | ||
] | ||
|
||
|
||
def test_structure_indexing(): | ||
struct_dict = StructuresDict(struct_list) | ||
assert struct_dict[997] == struct_dict["root"] | ||
assert struct_dict[997.0] == struct_dict["root"] | ||
assert struct_dict["997"] == struct_dict["root"] |