diff --git a/src/napari_tomotwin/_tests/test_load_umap.py b/src/napari_tomotwin/_tests/test_load_umap.py index a1f2e50..43825b5 100644 --- a/src/napari_tomotwin/_tests/test_load_umap.py +++ b/src/napari_tomotwin/_tests/test_load_umap.py @@ -36,7 +36,10 @@ def test_something(self): umap_df = pd.DataFrame(umap) umap_df.attrs['tomogram_input_shape'] = (100, 100, 100) - umap_df.attrs["stride"] = (1,1,1) + umap_df.attrs['embeddings_attrs'] = { + "stride": (1,1,1), + "tomogram_input_shape": (100,100,100) + } umap_df.to_pickle(f"{tmpdirname}/umap.tumap") widget, _ = viewer.window.add_plugin_dock_widget('napari-tomotwin', widget_name='Cluster UMAP embeddings') diff --git a/src/napari_tomotwin/load_umap.py b/src/napari_tomotwin/load_umap.py index 347b1c2..b92887e 100644 --- a/src/napari_tomotwin/load_umap.py +++ b/src/napari_tomotwin/load_umap.py @@ -159,7 +159,8 @@ def load_umap(self, filename: pathlib.Path): if 'tomogram_input_shape' not in self.umap.attrs['embeddings_attrs']: napari.utils.notifications.show_error( "The umap was calculated with an old version of TomoTwin. Please update TomoTwin and re-estimate the umap.") - self.pbar.progressbar.hide() + if self.pbar is not None: + self.pbar.progressbar.hide() import sys sys.exit(1) if self.pbar is not None: