InsightSoftwareConsortium / InsightSoftwareConsortium/ITK

Wrong parameter to ExhaustiveOptimizerv4.SetNumberOfSteps crashes Python kernel

Open
#1,749 1 comment 0 reactions 0 assignees View on GitHub
area:Python wrapping status:Use_Milestone_Backlog type:Bug
Dominant language
C++
Stars
1.7k
Forks
748
Avg merge
1d 1h
Merged PRs (30d)
64

Description

### Description

This hangs a Jupyter Lab notebook and crashes IPython.
```
import itk
import numpy as np
import matplotlib.pyplot as plt
OptimizerType = itk.ExhaustiveOptimizerv4[itk.D]
optimizer = OptimizerType.New()
#optimizer.SetNumberOfSteps([5, 0]) # correct
optimizer.SetNumberOfSteps(5) # incorrect
```
### Expected behavior

A soft type-error that doesn't crash the kernel.

### Actual behavior

It hard crashes.

### Versions

ITK release branch, Python Wrapping.

### Environment

ipython 7.13.0
jupyter-lab 1.2.7
Python 3.7.6

ITK release branch built locally and referenced using WrapITK.pth

### Additional Information

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.