Skip to content

Commit

Permalink
Use data path and fixtures consistently (#58)
Browse files Browse the repository at this point in the history
* use data path and fixtures consistently

* fix formatting of long lists in test_cell_io

* move test_cell_io data to data dir

* refactor fixtures
  • Loading branch information
K-Meech authored Mar 21, 2024
1 parent 87ca009 commit 264f849
Show file tree
Hide file tree
Showing 17 changed files with 363 additions and 444 deletions.
13 changes: 10 additions & 3 deletions brainglobe_utils/cells/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,16 @@ def group_cells_by_z(cells: List[Cell]) -> DefaultDict[float, List[Cell]]:
"""
For a list of Cells return a dict of lists of cells, grouped by plane.
:param list cells: list of cells from cellfinder.cells.cells.Cell
:return: defaultdict, with each key being a plane (e.g. 1280)
and each entry being a list of Cells
Parameters
----------
cells : List of Cell
List of cells from cellfinder.cells.cells.Cell
Returns
-------
DefaultDict
defaultdict, with each key being a plane (e.g. 1280) and each entry
being a list of Cells
"""
cells_groups = defaultdict(list)
for cell in cells:
Expand Down
13 changes: 13 additions & 0 deletions tests/data/IO/cell_io_vals/x_vals.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
181,2117,4082,2137,2129
2141,2130,2130,2133,2141
2162,2127,1801,2176,2194
2664,2435,1266,568,2103
2098,2105,2208,2162,2221
2081,2230,2015,2072,1413
1950,3340,2051,3362,2046
2046,2046,2047,2032,2923
2064,2267,2297,2004,2356
2357,2359,2360,2365,2612
2623,2657,2906,2165,2685
2892,2896,2894,2901,2270
1924,2505,2531,2542,2536
13 changes: 13 additions & 0 deletions tests/data/IO/cell_io_vals/y_vals.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
2379,133,332,134,133
134,132,133,136,136
130,1026,336,134,134
336,343,3427,2012,138
138,140,135,134,137
142,139,1045,141,2045
1048,142,142,145,150
151,151,151,146,147
147,147,1068,149,521
522,523,523,525,520
520,521,522,524,522
526,525,525,526,524
974,522,527,524,523
13 changes: 13 additions & 0 deletions tests/data/IO/cell_io_vals/z_vals.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
1282,1276,1281,1286,1276
1278,1277,1278,1285,1297
1274,1294,1290,1279,1280
1296,1290,1294,1294,1285
1279,1289,1275,1286,1281
1284,1275,1291,1273,1294
1294,1274,1274,1274,1283
1287,1290,1294,1272,1275
1275,1274,1292,1273,1288
1286,1287,1289,1298,1274
1274,1273,1275,1275,1278
1286,1278,1288,1295,1279
1282,1275,1276,1275,1286
9 changes: 9 additions & 0 deletions tests/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from pathlib import Path

import pytest


@pytest.fixture
def data_path():
"""Directory storing all test data"""
return Path(__file__).parent.parent / "data"
Loading

0 comments on commit 264f849

Please sign in to comment.