Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Commit

Permalink
Update contributing and tests (#5)
Browse files Browse the repository at this point in the history
* update cells to brainrender

* update CONTRIBUTING.md

* update imlib api call
  • Loading branch information
adamltyson authored Jan 28, 2020
1 parent 880d86b commit 6af2057
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ before pushing changes.

#### Releases
Travis will automatically release any tagged commit on the master branch.
Hence to release a new version of cellfinder, use either GitHub, or the git
Hence to release a new version of neuro, use either GitHub, or the git
CLI to tag the relevant commit and push to master.


Expand Down
15 changes: 9 additions & 6 deletions neuro/points/points_to_brainrender.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import argparse
import imlib.IO.cells as cells_io
from imlib.misc import check_positive_float, check_positive_int
from imlib.general.misc import check_positive_float, check_positive_int


def run(
Expand All @@ -21,12 +21,15 @@ def run(
):
print(f"Converting file: {cells_file}")
cells = cells_io.get_cells(cells_file)
cells = cells_io.cells_to_dataframe(cells)

cells["x"] = cells["x"] * pixel_size_x
cells["y"] = cells["y"] * pixel_size_y
cells["z"] = cells["z"] * pixel_size_z
for cell in cells:
cell.transform(
x_scale=pixel_size_x,
y_scale=pixel_size_y,
z_scale=pixel_size_z,
integer=True,
)

cells = cells_io.cells_to_dataframe(cells)
cells.columns = ["z", "y", "x", "type"]

cells["x"] = max_z - cells["x"]
Expand Down
9 changes: 7 additions & 2 deletions tests/tests/test_integration/test_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ def test_points_to_brainrender(tmpdir):
sys.argv = args
points_to_brainrender_run()

pd.read_hdf(brainrender_file_test, key="df") == pd.read_hdf(
brainrender_file, key="df"
assert (
(
pd.read_hdf(brainrender_file_test, key="df")
== pd.read_hdf(brainrender_file, key="df")
)
.all()
.all()
)

0 comments on commit 6af2057

Please sign in to comment.