
#def to_napari(
#    input_data: "os.PathLike | pd.DataFrame",
#    reader: ReaderInterface | None = None,
#) -> "list[tuple[npt.ArrayLike, dict[str, typing.Any], str]]":
#    """
#    Read a tlpkl conform file into memory to use within napari.
#
#    :param path: Path of the file to read information from.
#    :type path: pathlib.Path or str
#
#    :return: Data to create a point, i.e., coords, point_kwargs, and type
#    :rtype: list[tuple[npt.ArrayLike, dict[str, typing.Any], str]]
#    """
#    if isinstance(input_data, (os.PathLike, str)):
#        input_data = reader.read(input_data)
#    data, coords_idx, metadata_idx, extra_kwargs = reader.prepare_napari(
#        input_data
#    )
#
#    colors = mcm.get_cmap("gist_rainbow")
#    n_classes = np.unique(data["grp_idx"]).size
#    n_classes = np.maximum(n_classes, 2)  # Avoid zero division error
#
#    output_list: "list[tuple[npt.ArrayLike, dict[str, typing.Any], str]]" = []
#    for idx, (cluster_name, cluster_df) in enumerate(
#        data.sort_values(by=["sort_idx"]).groupby("grp_idx", sort=False)
#    ):
#        color = colors(idx / (n_classes - 1))
#        metadata = {
#            f"{entry}_{func.__name__}": func(cluster_df[entry])
#            for func in [min, max]
#            for entry in metadata_idx
#        }
#        metadata["id"] = cluster_df["sort_idx"].iloc[0]
#
#        # to_numpy currently needed. Should be fixed in 0.4.16rc8
#        features = {
#            entry: cluster_df[entry].to_numpy() for entry in metadata_idx
#        }
#
#        kwargs = {
#            "edge_color": [color],
#            "face_color": "transparent",
#            "symbol": "disc",
#            "edge_width": 2,
#            "edge_width_is_relative": False,
#            "size": cluster_df["boxsize"],
#            "out_of_slice_display": True,
#            "opacity": 0.5,
#            "name": cluster_name,
#            "metadata": metadata,
#            "features": features,
#        }
#        kwargs.update(extra_kwargs)
#        output_list.append((cluster_df[coords_idx], kwargs, "points"))
#
#    return output_list
