Skip to content

Commit

Permalink
Minor fixes in dynapcnn visualizer and unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Bauer committed Aug 6, 2024
1 parent 94336e6 commit c30e555
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sinabs/backend/dynapcnn/dynapcnn_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __init__(
- `power_measurement`: Arguments that can be passed `power_measurement` plot.
"""
# Checks if the configuration passed is valid
if add_readout_plot and not readout_images:
if add_readout_plot and readout_images is None:
raise ValueError(
"If a readout plot is to be displayed image paths should be passed as a list."
+ "The order of the images, should match the model output."
Expand Down
9 changes: 5 additions & 4 deletions tests/test_dynapcnn/test_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def X_available() -> bool:
True,
reason="A window needs to pop. Needs UI. Makes sense to check this test manually",
)
@pytest.mark.parametrize("spike_count_plot,readout_plot", vis_init_args)
@pytest.mark.parametrize("spike_count_plot,readout_plot,readout_node", vis_init_args)
def test_visualizer_initialization(
spike_count_plot: bool, readout_plot: bool, readout_filter: Union[str, Callable]
spike_count_plot: bool, readout_plot: bool, readout_node: Union[str, Callable]
):
dvs_shape = (128, 128)
spike_collection_interval = 500
Expand All @@ -40,8 +40,9 @@ def test_visualizer_initialization(
dvs_shape=dvs_shape,
spike_collection_interval=spike_collection_interval,
add_spike_count_plot=spike_count_plot,
add_readout_plot=spike_readout_plot,
readout_filter=readout_filter,
add_readout_plot=readout_plot,
readout_node=readout_node,
readout_images=[],
)
visualizer.create_visualizer_process(
f"tcp://0.0.0.0:{visualizer.samna_visualizer_port}"
Expand Down

0 comments on commit c30e555

Please sign in to comment.