Remove PCA colormap bug for float output maps (#2620)

Previously, "PCA" would be offered as a colormap option for float outputs (and throws "PCA is not a known colormap" error).
This commit is contained in:
Chung Min Kim authored and GitHub committed 2023-11-26 22:11:05 -08:00
1 parent 43703fa05a
commit c896ee4e0a
1 file changed
+1 -1
+1 -1
View File
@@ -445,7 +445,7 @@ def _get_colormap_options(dimensions: int, dtype: type) -> List[Colormaps]:
if dimensions == 3:
colormap_options = ["default"]
if dimensions == 1 and dtype in [torch.float64, torch.float32, torch.float16, torch.bfloat16]:
colormap_options = [c for c in list(get_args(Colormaps)) if c != "default"]
colormap_options = [c for c in list(get_args(Colormaps)) if c not in ("default", "pca")]
if dimensions > 3:
colormap_options = ["pca"]
return colormap_options