Closed timoleistner closed 1 year ago
If I try to create an interactive plot (like in the docs) with hover_data provided as argument, there is no check if the argument tools is None.
tools
None
p = umap.plot.interactive( mapper, labels=fmnist.target[:30000], hover_data=hover_data, point_size=2 ) umap.plot.show(p)
https://github.com/lmcinnes/umap/blob/5f7512b95061e72b362017abd1e4cb9517c9c8bc/umap/plot.py#L1443C1-L1453C26
This is a simple fix with either the following
if tools: for _tool in tools: if _tool.__class__.__name__ == "HoverTool": tooltip_needed = False break
or more explicit and on par with the rest of the code style
if tools is not None: for _tool in tools: if _tool.__class__.__name__ == "HoverTool": tooltip_needed = False break
or with changing the default value of the argument to an empty list.
p = umap.plot.interactive( mapper, labels=fmnist.target[:30000], hover_data=hover_data, tools=[], point_size=2 ) umap.plot.show(p)
Or update the docs and include my last code snippet with the empty list argument. If you decide on a solution I can also make a pull request :)
Edit: made a pull request
If I try to create an interactive plot (like in the docs) with hover_data provided as argument, there is no check if the argument
tools
isNone
.https://github.com/lmcinnes/umap/blob/5f7512b95061e72b362017abd1e4cb9517c9c8bc/umap/plot.py#L1443C1-L1453C26
This is a simple fix with either the following
or more explicit and on par with the rest of the code style
or with changing the default value of the argument to an empty list.
Or update the docs and include my last code snippet with the empty list argument. If you decide on a solution I can also make a pull request :)
Edit: made a pull request