traittypes icon indicating copy to clipboard operation
traittypes copied to clipboard

nan support

Open maartenbreddels opened this issue 6 years ago • 0 comments

https://github.com/jupyter-widgets/traittypes/blob/609b402bcbf8dd3bc0ad4b0dd76fc32d68221871/traittypes/traittypes.py#L112 will think arrays are not equal always when they contain a nan, the proper code might be sth like:

            try:
                return np.allclose(a, b, 0, 0, equal_nan=True)
            except (TypeError, ValueError):
                return False

There are more places around, like in ipywidgets

  • https://github.com/jupyter-widgets/ipywidgets/blob/463cb0444d1a2f31c3d5cacfe6b38d067f231406/ipywidgets/widgets/widget.py#L530 I'm not sure we should have a common strategy, or it should be a per-situation solution, such as the referenced bqplot issue (coming soon).

maartenbreddels avatar Nov 08 '18 13:11 maartenbreddels