Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytests for output paths mcorr, cnmf, cnmfe #10

Merged
merged 2 commits into from
May 18, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 103 additions & 8 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,49 @@ def test_mcorr():
print(df.iloc[-1]['outputs']['traceback'])
assert df.iloc[-1]['outputs']['success'] is True
assert df.iloc[-1]['outputs']['traceback'] is None
assert vid_dir.joinpath(df.iloc[-1]['outputs']['mcorr-output-path']
) == \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}-mcorr_els__d1_60_d2_80_d3_1_order_F_frames_2000_.mmap')
# assert vid_dir.joinpath(df.iloc[-1]['outputs']['mcorr-output-path']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove these commented lines

# ) == \
# vid_dir.joinpath(
# f'{df.iloc[-1]["uuid"]}-mcorr_els__d1_60_d2_80_d3_1_order_F_frames_2000_.mmap')

# parentdir + df_output_name = get_full_data_path(df_output_name) = parentdir+manual_output_name
# Expected name = uuid+_mean.npy

#projections
#correlations

# test to check mmap output path
assert vid_dir.joinpath(df.iloc[-1]['outputs']['mcorr-output-path']
) == \
get_full_data_path(df.iloc[-1]['outputs']['mcorr-output-path']
)== \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}-mcorr_els__d1_60_d2_80_d3_1_order_F_frames_2000_.mmap')

# test to check mean-projection output path
assert vid_dir.joinpath(df.iloc[-1]['outputs']['mean-projection-path']) == \
get_full_data_path(df.iloc[-1]['outputs']['mean-projection-path']) == \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_mean.npy')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

append projection, so _mean_projection.npy


# test to check std-projection output path
assert vid_dir.joinpath(df.iloc[-1]['outputs']['std-projection-path']) == \
get_full_data_path(df.iloc[-1]['outputs']['std-projection-path']) == \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_std.npy')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

append projection


# test to check max-projection output path
assert vid_dir.joinpath(df.iloc[-1]['outputs']['max-projection-path']) == \
get_full_data_path(df.iloc[-1]['outputs']['max-projection-path']) == \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_max.npy')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

append projection


# test to check correlation image output path
assert vid_dir.joinpath(df.iloc[-1]['outputs']['corr-img-path']) == \
get_full_data_path(df.iloc[-1]['outputs']['corr-img-path']) == \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_cn.npy')


def test_cnmf():
set_parent_data_path(vid_dir)
Expand Down Expand Up @@ -223,16 +254,43 @@ def test_cnmf():
# Confirm output path is as expected
assert df.iloc[-1]['outputs']['success'] is True
assert df.iloc[-1]['outputs']['traceback'] is None


assert vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}.hdf5') == \
get_full_data_path(df.iloc[-1]['outputs']['cnmf-hdf5-path']) == \
vid_dir.joinpath(df.iloc[-1]['outputs']['cnmf-hdf5-path'])

# test to check mmap output path
assert vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_cnmf-memmap__d1_60_d2_80_d3_1_order_C_frames_2000_.mmap') == \
get_full_data_path(df.iloc[-1]['outputs']['cnmf-memmap-path']) == \
vid_dir.joinpath(df.iloc[-1]['outputs']['cnmf-memmap-path']
)

assert vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}.hdf5') == \
get_full_data_path(df.iloc[-1]['outputs']['cnmf-hdf5-path']) == \
vid_dir.joinpath(df.iloc[-1]['outputs']['cnmf-hdf5-path'])
# test to check mean-projection output path
assert vid_dir.joinpath(df.iloc[-1]['outputs']['mean-projection-path']) == \
get_full_data_path(df.iloc[-1]['outputs']['mean-projection-path']) == \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_mean.npy')

# test to check std-projection output path
assert vid_dir.joinpath(df.iloc[-1]['outputs']['std-projection-path']) == \
get_full_data_path(df.iloc[-1]['outputs']['std-projection-path']) == \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_std.npy')

# test to check max-projection output path
assert vid_dir.joinpath(df.iloc[-1]['outputs']['max-projection-path']) == \
get_full_data_path(df.iloc[-1]['outputs']['max-projection-path']) == \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_max.npy')

# test to check correlation image output path
assert vid_dir.joinpath(df.iloc[-1]['outputs']['corr-img-path']) == \
get_full_data_path(df.iloc[-1]['outputs']['corr-img-path']) == \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_cn.npy')


def test_cnmfe():
Expand Down Expand Up @@ -320,6 +378,43 @@ def test_cnmfe():
get_full_data_path(df.iloc[-1]['outputs']['cnmf-memmap-path'])
assert vid_dir.joinpath(f'{df.iloc[-1]["uuid"]}.hdf5') == \
get_full_data_path(df.iloc[-1]['outputs']['cnmf-hdf5-path'])

# test to check mmap output path
assert vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_cnmf-memmap__d1_60_d2_80_d3_1_order_C_frames_2000_.mmap') == \
get_full_data_path(df.iloc[-1]['outputs']['cnmf-memmap-path']) == \
vid_dir.joinpath(df.iloc[-1]['outputs']['cnmf-memmap-path']
)

# test to check mean-projection output path
assert vid_dir.joinpath(df.iloc[-1]['outputs']['mean-projection-path']) == \
get_full_data_path(df.iloc[-1]['outputs']['mean-projection-path']) == \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_mean.npy')

# test to check std-projection output path
assert vid_dir.joinpath(df.iloc[-1]['outputs']['std-projection-path']) == \
get_full_data_path(df.iloc[-1]['outputs']['std-projection-path']) == \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_std.npy')

# test to check max-projection output path
assert vid_dir.joinpath(df.iloc[-1]['outputs']['max-projection-path']) == \
get_full_data_path(df.iloc[-1]['outputs']['max-projection-path']) == \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_max.npy')

# test to check correlation image output path
assert vid_dir.joinpath(df.iloc[-1]['outputs']['corr-img-path']) == \
get_full_data_path(df.iloc[-1]['outputs']['corr-img-path']) == \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_cn.npy')

# test to check pnr image output path
assert vid_dir.joinpath(df.iloc[-1]['outputs']['pnr-image-path']) == \
get_full_data_path(df.iloc[-1]['outputs']['pnr-image-path']) == \
vid_dir.joinpath(
f'{df.iloc[-1]["uuid"]}_pn.npy')


def test_remove_item():
Expand Down