From d7adf1058041fc03354d04f27b2a61b1d7b0b571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Weber=20Mendon=C3=A7a?= Date: Thu, 26 Sep 2024 20:42:59 -0300 Subject: [PATCH 1/8] Move images to _static folder (#483) # References and relevant issues Related to https://github.com/napari/napari.github.io/pull/412 and other considerations around artifact size # Description This PR moves all images to be under _static/images with the rationale that it will potentially be easier to compress/redirect them and keep the artifact size smaller. If this is not a good idea, I'm happy to close. It just seems better to gather all binaries in the same folder and not have them spread over the repo. --- docs/{ => _static}/images/2D-button.png | Bin .../images/3D-button.png} | Bin docs/{ => _static}/images/3D_paths.png | Bin .../images/3d_interaction.ai | 0 .../images/3d_interaction_click_line.png | Bin .../images/3d_interaction_coordianates.png | Bin .../3d_interaction_ray_intersection.png | Bin docs/{ => _static}/images/IPython.png | Bin .../images}/Viewer-with-arrows.png | Bin .../images}/add_points.png | Bin .../images/add_vectors_image.png | Bin .../images}/annotated_bbox.png | Bin docs/{guides => _static}/images/blending.png | Bin .../images}/bundle_02.png | Bin .../images}/bundle_04.png | Bin .../images}/bundle_06.png | Bin .../images}/bundle_07.png | Bin .../images}/bundle_09.png | Bin .../images}/bundle_10.png | Bin .../images}/bundle_11.png | Bin .../images}/bundle_13.png | Bin .../images}/bundle_17.png | Bin .../images}/bundle_18.png | Bin .../images}/bundle_19.png | Bin .../images}/bundle_20.png | Bin .../images}/bundle_21.png | Bin .../images}/bundle_22.png | Bin .../images}/bundle_24.png | Bin .../images}/bundle_28.png | Bin .../images}/bundle_29.png | Bin .../images}/bundle_30.png | Bin .../images}/bundle_31.png | Bin .../images}/bundle_32.png | Bin .../images}/bundle_33.png | Bin .../images}/bundle_34.png | Bin .../images}/bundle_35.png | Bin .../images}/bundle_dev_warning.png | Bin .../images}/bundle_open.png | Bin .../images}/bundle_open_anyway.png | Bin .../images}/bundle_security_privacy.png | Bin .../images/chunked-format.png | Bin .../images/circleci-link.png | Bin .../tutorials => _static/images}/console.png | Bin .../images/context_type_hint.png | Bin docs/{ => _static}/images/coverage_report.png | Bin .../images}/dask_repr.png | Bin .../images}/dims_roll_lock_widget.png | Bin .../images/doc-ci-1.png | Bin .../images/doc-ci-2.png | Bin .../images/doc-ci-3.png | Bin .../images/edit_token_permissions.png | Bin .../images/example-1320.png | Bin .../images/fine_grained_token.png | Bin .../images/labels-layer-eraser.png | Bin .../images}/launch_cli_empty.png | Bin .../images}/launch_cli_image.png | Bin .../images}/launch_ipython.png | Bin .../images}/launch_jupyter.png | Bin .../images}/launch_script.png | Bin .../images}/layerlist.png | Bin .../lines_not_run_highlighted_in_red.png | Bin docs/{ => _static}/images/logo.png | Bin .../main-menu-file-sub-menu-preferences.png | Bin .../images}/main-menu-file.png | Bin .../images}/main-menu-help.png | Bin .../images}/main-menu-plugins.png | Bin .../images}/main-menu-view.png | Bin .../images}/main-menu-window.png | Bin .../images}/nD_labels.png | Bin .../images/napari-logo-3-with-guides.png | Bin docs/{ => _static}/images/napari-logo-3.png | Bin .../images/napari-logo-old-new.png | Bin .../napari_plugins_1st_napari_get_reader.png | Bin .../napari_plugins_2nd_reader_function.png | Bin .../napari_plugins_3rd_pytest_passed.png | Bin ...est_get_reader_returns_callable-failed.png | Bin .../napari_plugins_5th_tests_passed.png | Bin docs/{ => _static}/images/ndisplay.png | Bin docs/{guides => _static}/images/octree.png | Bin .../images/paging-chunks.png | Bin docs/{ => _static}/images/pan-zoom-tool.png | Bin .../images/plugin-install-dialog.png | Bin docs/{ => _static}/images/plugin-menu.png | Bin .../images/point-adding-tool.png | Bin .../images/point-deleting-tool.png | Bin .../images/point-selecting-tool.png | Bin .../images}/points_save_dialog.png | Bin docs/{guides => _static}/images/rendering.png | Bin .../images}/rotated-image.png | Bin .../images/screenshot-add-image.png | Bin .../images/second_coverage_report.png | Bin docs/{ => _static}/images/secrets_section.png | Bin .../images}/segmentation_bbox.png | Bin .../images}/segmentation_labels.png | Bin .../images/shape-add-ellipses.png | Bin docs/{ => _static}/images/shape-add-lasso.png | Bin docs/{ => _static}/images/shape-add-lines.png | Bin docs/{ => _static}/images/shape-add-path.png | Bin .../images/shape-add-polygons.png | Bin .../images/shape-add-rectangles.png | Bin .../images/shape-delete-shape.png | Bin .../images/shape-move-to-back.png | Bin .../images/shape-move-to-front.png | Bin .../images/shape-select-shape.png | Bin .../images/shape-vertex-insert.png | Bin .../images/shape-vertices-select.png | Bin .../images/shape_vertex_delete.png | Bin .../test_coverage_htmlcov_directory.png | Bin docs/{ => _static}/images/tests.png | Bin .../images/token_permission_form.png | Bin .../images/token_permission_selection.png | Bin .../images}/tracks_btrack.png | Bin docs/{ => _static}/images/transform-icon.svg | 0 docs/{ => _static}/images/transform-tool.png | Bin .../images/update_token_permissions.png | Bin .../images}/viewer-buttons.png | Bin .../images}/viewer_layout.jpg | Bin docs/{ => _static}/images/vs_code_debug.png | Bin .../windows_bundle_command_terminal.png | Bin .../windows_bundle_installer_finish.png | Bin .../windows_bundle_installer_progress.png | Bin .../windows_bundle_installer_start.png | Bin .../images}/windows_launch_napari.png | Bin docs/conf.py | 4 +- .../contributing/documentation/index.md | 8 ++-- docs/developers/contributing/testing.md | 2 +- docs/developers/coredev/maintenance.md | 12 ++--- docs/guides/3D_interactivity.md | 6 +-- docs/guides/contexts_expressions.md | 2 +- docs/guides/layers.md | 8 ++-- docs/howtos/layers/image.md | 4 +- docs/howtos/layers/labels.md | 8 ++-- docs/howtos/layers/points.md | 14 +++--- docs/howtos/layers/shapes.md | 36 +++++++------- docs/howtos/layers/surface.md | 8 ++-- docs/howtos/layers/tracks.md | 8 ++-- docs/howtos/layers/vectors.md | 10 ++-- docs/images/3D-button.png | Bin 4756 -> 0 bytes docs/naps/5-new-logo.md | 8 ++-- .../building_a_plugin/debug_plugins.md | 2 +- .../finding_and_installing_plugins.md | 4 +- .../3-readers-and-fixtures.md | 10 ++-- .../testing_workshop_docs/4-test-coverage.md | 8 ++-- docs/release/release_0_5_0.md | 2 +- docs/tutorials/annotation/annotate_points.md | 2 +- .../tutorials/fundamentals/getting_started.md | 10 ++-- docs/tutorials/fundamentals/installation.md | 2 +- .../fundamentals/installation_bundle_conda.md | 44 +++++++++--------- docs/tutorials/fundamentals/quick_start.md | 4 +- docs/tutorials/fundamentals/viewer.md | 10 ++-- docs/tutorials/processing/dask.md | 2 +- .../segmentation/annotate_segmentation.md | 8 ++-- docs/tutorials/tracking/cell_tracking.md | 2 +- 153 files changed, 124 insertions(+), 124 deletions(-) rename docs/{ => _static}/images/2D-button.png (100%) rename docs/{tutorials/assets/tutorials/3D_button.png => _static/images/3D-button.png} (100%) rename docs/{ => _static}/images/3D_paths.png (100%) rename docs/{guides => _static}/images/3d_interaction.ai (100%) rename docs/{guides => _static}/images/3d_interaction_click_line.png (100%) rename docs/{guides => _static}/images/3d_interaction_coordianates.png (100%) rename docs/{guides => _static}/images/3d_interaction_ray_intersection.png (100%) rename docs/{ => _static}/images/IPython.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/Viewer-with-arrows.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/add_points.png (100%) rename docs/{ => _static}/images/add_vectors_image.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/annotated_bbox.png (100%) rename docs/{guides => _static}/images/blending.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_02.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_04.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_06.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_07.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_09.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_10.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_11.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_13.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_17.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_18.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_19.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_20.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_21.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_22.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_24.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_28.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_29.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_30.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_31.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_32.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_33.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_34.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_35.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_dev_warning.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_open.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_open_anyway.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/bundle_security_privacy.png (100%) rename docs/{guides => _static}/images/chunked-format.png (100%) rename docs/{developers/contributing/documentation => _static}/images/circleci-link.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/console.png (100%) rename docs/{guides => _static}/images/context_type_hint.png (100%) rename docs/{ => _static}/images/coverage_report.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/dask_repr.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/dims_roll_lock_widget.png (100%) rename docs/{developers/contributing/documentation => _static}/images/doc-ci-1.png (100%) rename docs/{developers/contributing/documentation => _static}/images/doc-ci-2.png (100%) rename docs/{developers/contributing/documentation => _static}/images/doc-ci-3.png (100%) rename docs/{ => _static}/images/edit_token_permissions.png (100%) rename docs/{guides => _static}/images/example-1320.png (100%) rename docs/{ => _static}/images/fine_grained_token.png (100%) rename docs/{ => _static}/images/labels-layer-eraser.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/launch_cli_empty.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/launch_cli_image.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/launch_ipython.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/launch_jupyter.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/launch_script.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/layerlist.png (100%) rename docs/{ => _static}/images/lines_not_run_highlighted_in_red.png (100%) rename docs/{ => _static}/images/logo.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/main-menu-file-sub-menu-preferences.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/main-menu-file.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/main-menu-help.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/main-menu-plugins.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/main-menu-view.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/main-menu-window.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/nD_labels.png (100%) rename docs/{ => _static}/images/napari-logo-3-with-guides.png (100%) rename docs/{ => _static}/images/napari-logo-3.png (100%) rename docs/{ => _static}/images/napari-logo-old-new.png (100%) rename docs/{ => _static}/images/napari_plugins_1st_napari_get_reader.png (100%) rename docs/{ => _static}/images/napari_plugins_2nd_reader_function.png (100%) rename docs/{ => _static}/images/napari_plugins_3rd_pytest_passed.png (100%) rename docs/{ => _static}/images/napari_plugins_4th_test_get_reader_returns_callable-failed.png (100%) rename docs/{ => _static}/images/napari_plugins_5th_tests_passed.png (100%) rename docs/{ => _static}/images/ndisplay.png (100%) rename docs/{guides => _static}/images/octree.png (100%) rename docs/{guides => _static}/images/paging-chunks.png (100%) rename docs/{ => _static}/images/pan-zoom-tool.png (100%) rename docs/{ => _static}/images/plugin-install-dialog.png (100%) rename docs/{ => _static}/images/plugin-menu.png (100%) rename docs/{ => _static}/images/point-adding-tool.png (100%) rename docs/{ => _static}/images/point-deleting-tool.png (100%) rename docs/{ => _static}/images/point-selecting-tool.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/points_save_dialog.png (100%) rename docs/{guides => _static}/images/rendering.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/rotated-image.png (100%) rename docs/{ => _static}/images/screenshot-add-image.png (100%) rename docs/{ => _static}/images/second_coverage_report.png (100%) rename docs/{ => _static}/images/secrets_section.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/segmentation_bbox.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/segmentation_labels.png (100%) rename docs/{ => _static}/images/shape-add-ellipses.png (100%) rename docs/{ => _static}/images/shape-add-lasso.png (100%) rename docs/{ => _static}/images/shape-add-lines.png (100%) rename docs/{ => _static}/images/shape-add-path.png (100%) rename docs/{ => _static}/images/shape-add-polygons.png (100%) rename docs/{ => _static}/images/shape-add-rectangles.png (100%) rename docs/{ => _static}/images/shape-delete-shape.png (100%) rename docs/{ => _static}/images/shape-move-to-back.png (100%) rename docs/{ => _static}/images/shape-move-to-front.png (100%) rename docs/{ => _static}/images/shape-select-shape.png (100%) rename docs/{ => _static}/images/shape-vertex-insert.png (100%) rename docs/{ => _static}/images/shape-vertices-select.png (100%) rename docs/{ => _static}/images/shape_vertex_delete.png (100%) rename docs/{ => _static}/images/test_coverage_htmlcov_directory.png (100%) rename docs/{ => _static}/images/tests.png (100%) rename docs/{ => _static}/images/token_permission_form.png (100%) rename docs/{ => _static}/images/token_permission_selection.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/tracks_btrack.png (100%) rename docs/{ => _static}/images/transform-icon.svg (100%) rename docs/{ => _static}/images/transform-tool.png (100%) rename docs/{ => _static}/images/update_token_permissions.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/viewer-buttons.png (100%) rename docs/{tutorials/assets/tutorials => _static/images}/viewer_layout.jpg (100%) rename docs/{ => _static}/images/vs_code_debug.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/windows_bundle_command_terminal.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/windows_bundle_installer_finish.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/windows_bundle_installer_progress.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/windows_bundle_installer_start.png (100%) rename docs/{tutorials/assets/tutorials/installation => _static/images}/windows_launch_napari.png (100%) delete mode 100644 docs/images/3D-button.png diff --git a/docs/images/2D-button.png b/docs/_static/images/2D-button.png similarity index 100% rename from docs/images/2D-button.png rename to docs/_static/images/2D-button.png diff --git a/docs/tutorials/assets/tutorials/3D_button.png b/docs/_static/images/3D-button.png similarity index 100% rename from docs/tutorials/assets/tutorials/3D_button.png rename to docs/_static/images/3D-button.png diff --git a/docs/images/3D_paths.png b/docs/_static/images/3D_paths.png similarity index 100% rename from docs/images/3D_paths.png rename to docs/_static/images/3D_paths.png diff --git a/docs/guides/images/3d_interaction.ai b/docs/_static/images/3d_interaction.ai similarity index 100% rename from docs/guides/images/3d_interaction.ai rename to docs/_static/images/3d_interaction.ai diff --git a/docs/guides/images/3d_interaction_click_line.png b/docs/_static/images/3d_interaction_click_line.png similarity index 100% rename from docs/guides/images/3d_interaction_click_line.png rename to docs/_static/images/3d_interaction_click_line.png diff --git a/docs/guides/images/3d_interaction_coordianates.png b/docs/_static/images/3d_interaction_coordianates.png similarity index 100% rename from docs/guides/images/3d_interaction_coordianates.png rename to docs/_static/images/3d_interaction_coordianates.png diff --git a/docs/guides/images/3d_interaction_ray_intersection.png b/docs/_static/images/3d_interaction_ray_intersection.png similarity index 100% rename from docs/guides/images/3d_interaction_ray_intersection.png rename to docs/_static/images/3d_interaction_ray_intersection.png diff --git a/docs/images/IPython.png b/docs/_static/images/IPython.png similarity index 100% rename from docs/images/IPython.png rename to docs/_static/images/IPython.png diff --git a/docs/tutorials/assets/tutorials/Viewer-with-arrows.png b/docs/_static/images/Viewer-with-arrows.png similarity index 100% rename from docs/tutorials/assets/tutorials/Viewer-with-arrows.png rename to docs/_static/images/Viewer-with-arrows.png diff --git a/docs/tutorials/assets/tutorials/add_points.png b/docs/_static/images/add_points.png similarity index 100% rename from docs/tutorials/assets/tutorials/add_points.png rename to docs/_static/images/add_points.png diff --git a/docs/images/add_vectors_image.png b/docs/_static/images/add_vectors_image.png similarity index 100% rename from docs/images/add_vectors_image.png rename to docs/_static/images/add_vectors_image.png diff --git a/docs/tutorials/assets/tutorials/annotated_bbox.png b/docs/_static/images/annotated_bbox.png similarity index 100% rename from docs/tutorials/assets/tutorials/annotated_bbox.png rename to docs/_static/images/annotated_bbox.png diff --git a/docs/guides/images/blending.png b/docs/_static/images/blending.png similarity index 100% rename from docs/guides/images/blending.png rename to docs/_static/images/blending.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_02.png b/docs/_static/images/bundle_02.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_02.png rename to docs/_static/images/bundle_02.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_04.png b/docs/_static/images/bundle_04.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_04.png rename to docs/_static/images/bundle_04.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_06.png b/docs/_static/images/bundle_06.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_06.png rename to docs/_static/images/bundle_06.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_07.png b/docs/_static/images/bundle_07.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_07.png rename to docs/_static/images/bundle_07.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_09.png b/docs/_static/images/bundle_09.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_09.png rename to docs/_static/images/bundle_09.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_10.png b/docs/_static/images/bundle_10.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_10.png rename to docs/_static/images/bundle_10.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_11.png b/docs/_static/images/bundle_11.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_11.png rename to docs/_static/images/bundle_11.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_13.png b/docs/_static/images/bundle_13.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_13.png rename to docs/_static/images/bundle_13.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_17.png b/docs/_static/images/bundle_17.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_17.png rename to docs/_static/images/bundle_17.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_18.png b/docs/_static/images/bundle_18.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_18.png rename to docs/_static/images/bundle_18.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_19.png b/docs/_static/images/bundle_19.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_19.png rename to docs/_static/images/bundle_19.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_20.png b/docs/_static/images/bundle_20.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_20.png rename to docs/_static/images/bundle_20.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_21.png b/docs/_static/images/bundle_21.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_21.png rename to docs/_static/images/bundle_21.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_22.png b/docs/_static/images/bundle_22.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_22.png rename to docs/_static/images/bundle_22.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_24.png b/docs/_static/images/bundle_24.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_24.png rename to docs/_static/images/bundle_24.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_28.png b/docs/_static/images/bundle_28.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_28.png rename to docs/_static/images/bundle_28.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_29.png b/docs/_static/images/bundle_29.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_29.png rename to docs/_static/images/bundle_29.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_30.png b/docs/_static/images/bundle_30.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_30.png rename to docs/_static/images/bundle_30.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_31.png b/docs/_static/images/bundle_31.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_31.png rename to docs/_static/images/bundle_31.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_32.png b/docs/_static/images/bundle_32.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_32.png rename to docs/_static/images/bundle_32.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_33.png b/docs/_static/images/bundle_33.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_33.png rename to docs/_static/images/bundle_33.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_34.png b/docs/_static/images/bundle_34.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_34.png rename to docs/_static/images/bundle_34.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_35.png b/docs/_static/images/bundle_35.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_35.png rename to docs/_static/images/bundle_35.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_dev_warning.png b/docs/_static/images/bundle_dev_warning.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_dev_warning.png rename to docs/_static/images/bundle_dev_warning.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_open.png b/docs/_static/images/bundle_open.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_open.png rename to docs/_static/images/bundle_open.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_open_anyway.png b/docs/_static/images/bundle_open_anyway.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_open_anyway.png rename to docs/_static/images/bundle_open_anyway.png diff --git a/docs/tutorials/assets/tutorials/installation/bundle_security_privacy.png b/docs/_static/images/bundle_security_privacy.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/bundle_security_privacy.png rename to docs/_static/images/bundle_security_privacy.png diff --git a/docs/guides/images/chunked-format.png b/docs/_static/images/chunked-format.png similarity index 100% rename from docs/guides/images/chunked-format.png rename to docs/_static/images/chunked-format.png diff --git a/docs/developers/contributing/documentation/images/circleci-link.png b/docs/_static/images/circleci-link.png similarity index 100% rename from docs/developers/contributing/documentation/images/circleci-link.png rename to docs/_static/images/circleci-link.png diff --git a/docs/tutorials/assets/tutorials/console.png b/docs/_static/images/console.png similarity index 100% rename from docs/tutorials/assets/tutorials/console.png rename to docs/_static/images/console.png diff --git a/docs/guides/images/context_type_hint.png b/docs/_static/images/context_type_hint.png similarity index 100% rename from docs/guides/images/context_type_hint.png rename to docs/_static/images/context_type_hint.png diff --git a/docs/images/coverage_report.png b/docs/_static/images/coverage_report.png similarity index 100% rename from docs/images/coverage_report.png rename to docs/_static/images/coverage_report.png diff --git a/docs/tutorials/assets/tutorials/dask_repr.png b/docs/_static/images/dask_repr.png similarity index 100% rename from docs/tutorials/assets/tutorials/dask_repr.png rename to docs/_static/images/dask_repr.png diff --git a/docs/tutorials/assets/tutorials/dims_roll_lock_widget.png b/docs/_static/images/dims_roll_lock_widget.png similarity index 100% rename from docs/tutorials/assets/tutorials/dims_roll_lock_widget.png rename to docs/_static/images/dims_roll_lock_widget.png diff --git a/docs/developers/contributing/documentation/images/doc-ci-1.png b/docs/_static/images/doc-ci-1.png similarity index 100% rename from docs/developers/contributing/documentation/images/doc-ci-1.png rename to docs/_static/images/doc-ci-1.png diff --git a/docs/developers/contributing/documentation/images/doc-ci-2.png b/docs/_static/images/doc-ci-2.png similarity index 100% rename from docs/developers/contributing/documentation/images/doc-ci-2.png rename to docs/_static/images/doc-ci-2.png diff --git a/docs/developers/contributing/documentation/images/doc-ci-3.png b/docs/_static/images/doc-ci-3.png similarity index 100% rename from docs/developers/contributing/documentation/images/doc-ci-3.png rename to docs/_static/images/doc-ci-3.png diff --git a/docs/images/edit_token_permissions.png b/docs/_static/images/edit_token_permissions.png similarity index 100% rename from docs/images/edit_token_permissions.png rename to docs/_static/images/edit_token_permissions.png diff --git a/docs/guides/images/example-1320.png b/docs/_static/images/example-1320.png similarity index 100% rename from docs/guides/images/example-1320.png rename to docs/_static/images/example-1320.png diff --git a/docs/images/fine_grained_token.png b/docs/_static/images/fine_grained_token.png similarity index 100% rename from docs/images/fine_grained_token.png rename to docs/_static/images/fine_grained_token.png diff --git a/docs/images/labels-layer-eraser.png b/docs/_static/images/labels-layer-eraser.png similarity index 100% rename from docs/images/labels-layer-eraser.png rename to docs/_static/images/labels-layer-eraser.png diff --git a/docs/tutorials/assets/tutorials/launch_cli_empty.png b/docs/_static/images/launch_cli_empty.png similarity index 100% rename from docs/tutorials/assets/tutorials/launch_cli_empty.png rename to docs/_static/images/launch_cli_empty.png diff --git a/docs/tutorials/assets/tutorials/launch_cli_image.png b/docs/_static/images/launch_cli_image.png similarity index 100% rename from docs/tutorials/assets/tutorials/launch_cli_image.png rename to docs/_static/images/launch_cli_image.png diff --git a/docs/tutorials/assets/tutorials/launch_ipython.png b/docs/_static/images/launch_ipython.png similarity index 100% rename from docs/tutorials/assets/tutorials/launch_ipython.png rename to docs/_static/images/launch_ipython.png diff --git a/docs/tutorials/assets/tutorials/launch_jupyter.png b/docs/_static/images/launch_jupyter.png similarity index 100% rename from docs/tutorials/assets/tutorials/launch_jupyter.png rename to docs/_static/images/launch_jupyter.png diff --git a/docs/tutorials/assets/tutorials/launch_script.png b/docs/_static/images/launch_script.png similarity index 100% rename from docs/tutorials/assets/tutorials/launch_script.png rename to docs/_static/images/launch_script.png diff --git a/docs/tutorials/assets/tutorials/layerlist.png b/docs/_static/images/layerlist.png similarity index 100% rename from docs/tutorials/assets/tutorials/layerlist.png rename to docs/_static/images/layerlist.png diff --git a/docs/images/lines_not_run_highlighted_in_red.png b/docs/_static/images/lines_not_run_highlighted_in_red.png similarity index 100% rename from docs/images/lines_not_run_highlighted_in_red.png rename to docs/_static/images/lines_not_run_highlighted_in_red.png diff --git a/docs/images/logo.png b/docs/_static/images/logo.png similarity index 100% rename from docs/images/logo.png rename to docs/_static/images/logo.png diff --git a/docs/tutorials/assets/tutorials/main-menu-file-sub-menu-preferences.png b/docs/_static/images/main-menu-file-sub-menu-preferences.png similarity index 100% rename from docs/tutorials/assets/tutorials/main-menu-file-sub-menu-preferences.png rename to docs/_static/images/main-menu-file-sub-menu-preferences.png diff --git a/docs/tutorials/assets/tutorials/main-menu-file.png b/docs/_static/images/main-menu-file.png similarity index 100% rename from docs/tutorials/assets/tutorials/main-menu-file.png rename to docs/_static/images/main-menu-file.png diff --git a/docs/tutorials/assets/tutorials/main-menu-help.png b/docs/_static/images/main-menu-help.png similarity index 100% rename from docs/tutorials/assets/tutorials/main-menu-help.png rename to docs/_static/images/main-menu-help.png diff --git a/docs/tutorials/assets/tutorials/main-menu-plugins.png b/docs/_static/images/main-menu-plugins.png similarity index 100% rename from docs/tutorials/assets/tutorials/main-menu-plugins.png rename to docs/_static/images/main-menu-plugins.png diff --git a/docs/tutorials/assets/tutorials/main-menu-view.png b/docs/_static/images/main-menu-view.png similarity index 100% rename from docs/tutorials/assets/tutorials/main-menu-view.png rename to docs/_static/images/main-menu-view.png diff --git a/docs/tutorials/assets/tutorials/main-menu-window.png b/docs/_static/images/main-menu-window.png similarity index 100% rename from docs/tutorials/assets/tutorials/main-menu-window.png rename to docs/_static/images/main-menu-window.png diff --git a/docs/tutorials/assets/tutorials/nD_labels.png b/docs/_static/images/nD_labels.png similarity index 100% rename from docs/tutorials/assets/tutorials/nD_labels.png rename to docs/_static/images/nD_labels.png diff --git a/docs/images/napari-logo-3-with-guides.png b/docs/_static/images/napari-logo-3-with-guides.png similarity index 100% rename from docs/images/napari-logo-3-with-guides.png rename to docs/_static/images/napari-logo-3-with-guides.png diff --git a/docs/images/napari-logo-3.png b/docs/_static/images/napari-logo-3.png similarity index 100% rename from docs/images/napari-logo-3.png rename to docs/_static/images/napari-logo-3.png diff --git a/docs/images/napari-logo-old-new.png b/docs/_static/images/napari-logo-old-new.png similarity index 100% rename from docs/images/napari-logo-old-new.png rename to docs/_static/images/napari-logo-old-new.png diff --git a/docs/images/napari_plugins_1st_napari_get_reader.png b/docs/_static/images/napari_plugins_1st_napari_get_reader.png similarity index 100% rename from docs/images/napari_plugins_1st_napari_get_reader.png rename to docs/_static/images/napari_plugins_1st_napari_get_reader.png diff --git a/docs/images/napari_plugins_2nd_reader_function.png b/docs/_static/images/napari_plugins_2nd_reader_function.png similarity index 100% rename from docs/images/napari_plugins_2nd_reader_function.png rename to docs/_static/images/napari_plugins_2nd_reader_function.png diff --git a/docs/images/napari_plugins_3rd_pytest_passed.png b/docs/_static/images/napari_plugins_3rd_pytest_passed.png similarity index 100% rename from docs/images/napari_plugins_3rd_pytest_passed.png rename to docs/_static/images/napari_plugins_3rd_pytest_passed.png diff --git a/docs/images/napari_plugins_4th_test_get_reader_returns_callable-failed.png b/docs/_static/images/napari_plugins_4th_test_get_reader_returns_callable-failed.png similarity index 100% rename from docs/images/napari_plugins_4th_test_get_reader_returns_callable-failed.png rename to docs/_static/images/napari_plugins_4th_test_get_reader_returns_callable-failed.png diff --git a/docs/images/napari_plugins_5th_tests_passed.png b/docs/_static/images/napari_plugins_5th_tests_passed.png similarity index 100% rename from docs/images/napari_plugins_5th_tests_passed.png rename to docs/_static/images/napari_plugins_5th_tests_passed.png diff --git a/docs/images/ndisplay.png b/docs/_static/images/ndisplay.png similarity index 100% rename from docs/images/ndisplay.png rename to docs/_static/images/ndisplay.png diff --git a/docs/guides/images/octree.png b/docs/_static/images/octree.png similarity index 100% rename from docs/guides/images/octree.png rename to docs/_static/images/octree.png diff --git a/docs/guides/images/paging-chunks.png b/docs/_static/images/paging-chunks.png similarity index 100% rename from docs/guides/images/paging-chunks.png rename to docs/_static/images/paging-chunks.png diff --git a/docs/images/pan-zoom-tool.png b/docs/_static/images/pan-zoom-tool.png similarity index 100% rename from docs/images/pan-zoom-tool.png rename to docs/_static/images/pan-zoom-tool.png diff --git a/docs/images/plugin-install-dialog.png b/docs/_static/images/plugin-install-dialog.png similarity index 100% rename from docs/images/plugin-install-dialog.png rename to docs/_static/images/plugin-install-dialog.png diff --git a/docs/images/plugin-menu.png b/docs/_static/images/plugin-menu.png similarity index 100% rename from docs/images/plugin-menu.png rename to docs/_static/images/plugin-menu.png diff --git a/docs/images/point-adding-tool.png b/docs/_static/images/point-adding-tool.png similarity index 100% rename from docs/images/point-adding-tool.png rename to docs/_static/images/point-adding-tool.png diff --git a/docs/images/point-deleting-tool.png b/docs/_static/images/point-deleting-tool.png similarity index 100% rename from docs/images/point-deleting-tool.png rename to docs/_static/images/point-deleting-tool.png diff --git a/docs/images/point-selecting-tool.png b/docs/_static/images/point-selecting-tool.png similarity index 100% rename from docs/images/point-selecting-tool.png rename to docs/_static/images/point-selecting-tool.png diff --git a/docs/tutorials/assets/tutorials/points_save_dialog.png b/docs/_static/images/points_save_dialog.png similarity index 100% rename from docs/tutorials/assets/tutorials/points_save_dialog.png rename to docs/_static/images/points_save_dialog.png diff --git a/docs/guides/images/rendering.png b/docs/_static/images/rendering.png similarity index 100% rename from docs/guides/images/rendering.png rename to docs/_static/images/rendering.png diff --git a/docs/tutorials/assets/tutorials/rotated-image.png b/docs/_static/images/rotated-image.png similarity index 100% rename from docs/tutorials/assets/tutorials/rotated-image.png rename to docs/_static/images/rotated-image.png diff --git a/docs/images/screenshot-add-image.png b/docs/_static/images/screenshot-add-image.png similarity index 100% rename from docs/images/screenshot-add-image.png rename to docs/_static/images/screenshot-add-image.png diff --git a/docs/images/second_coverage_report.png b/docs/_static/images/second_coverage_report.png similarity index 100% rename from docs/images/second_coverage_report.png rename to docs/_static/images/second_coverage_report.png diff --git a/docs/images/secrets_section.png b/docs/_static/images/secrets_section.png similarity index 100% rename from docs/images/secrets_section.png rename to docs/_static/images/secrets_section.png diff --git a/docs/tutorials/assets/tutorials/segmentation_bbox.png b/docs/_static/images/segmentation_bbox.png similarity index 100% rename from docs/tutorials/assets/tutorials/segmentation_bbox.png rename to docs/_static/images/segmentation_bbox.png diff --git a/docs/tutorials/assets/tutorials/segmentation_labels.png b/docs/_static/images/segmentation_labels.png similarity index 100% rename from docs/tutorials/assets/tutorials/segmentation_labels.png rename to docs/_static/images/segmentation_labels.png diff --git a/docs/images/shape-add-ellipses.png b/docs/_static/images/shape-add-ellipses.png similarity index 100% rename from docs/images/shape-add-ellipses.png rename to docs/_static/images/shape-add-ellipses.png diff --git a/docs/images/shape-add-lasso.png b/docs/_static/images/shape-add-lasso.png similarity index 100% rename from docs/images/shape-add-lasso.png rename to docs/_static/images/shape-add-lasso.png diff --git a/docs/images/shape-add-lines.png b/docs/_static/images/shape-add-lines.png similarity index 100% rename from docs/images/shape-add-lines.png rename to docs/_static/images/shape-add-lines.png diff --git a/docs/images/shape-add-path.png b/docs/_static/images/shape-add-path.png similarity index 100% rename from docs/images/shape-add-path.png rename to docs/_static/images/shape-add-path.png diff --git a/docs/images/shape-add-polygons.png b/docs/_static/images/shape-add-polygons.png similarity index 100% rename from docs/images/shape-add-polygons.png rename to docs/_static/images/shape-add-polygons.png diff --git a/docs/images/shape-add-rectangles.png b/docs/_static/images/shape-add-rectangles.png similarity index 100% rename from docs/images/shape-add-rectangles.png rename to docs/_static/images/shape-add-rectangles.png diff --git a/docs/images/shape-delete-shape.png b/docs/_static/images/shape-delete-shape.png similarity index 100% rename from docs/images/shape-delete-shape.png rename to docs/_static/images/shape-delete-shape.png diff --git a/docs/images/shape-move-to-back.png b/docs/_static/images/shape-move-to-back.png similarity index 100% rename from docs/images/shape-move-to-back.png rename to docs/_static/images/shape-move-to-back.png diff --git a/docs/images/shape-move-to-front.png b/docs/_static/images/shape-move-to-front.png similarity index 100% rename from docs/images/shape-move-to-front.png rename to docs/_static/images/shape-move-to-front.png diff --git a/docs/images/shape-select-shape.png b/docs/_static/images/shape-select-shape.png similarity index 100% rename from docs/images/shape-select-shape.png rename to docs/_static/images/shape-select-shape.png diff --git a/docs/images/shape-vertex-insert.png b/docs/_static/images/shape-vertex-insert.png similarity index 100% rename from docs/images/shape-vertex-insert.png rename to docs/_static/images/shape-vertex-insert.png diff --git a/docs/images/shape-vertices-select.png b/docs/_static/images/shape-vertices-select.png similarity index 100% rename from docs/images/shape-vertices-select.png rename to docs/_static/images/shape-vertices-select.png diff --git a/docs/images/shape_vertex_delete.png b/docs/_static/images/shape_vertex_delete.png similarity index 100% rename from docs/images/shape_vertex_delete.png rename to docs/_static/images/shape_vertex_delete.png diff --git a/docs/images/test_coverage_htmlcov_directory.png b/docs/_static/images/test_coverage_htmlcov_directory.png similarity index 100% rename from docs/images/test_coverage_htmlcov_directory.png rename to docs/_static/images/test_coverage_htmlcov_directory.png diff --git a/docs/images/tests.png b/docs/_static/images/tests.png similarity index 100% rename from docs/images/tests.png rename to docs/_static/images/tests.png diff --git a/docs/images/token_permission_form.png b/docs/_static/images/token_permission_form.png similarity index 100% rename from docs/images/token_permission_form.png rename to docs/_static/images/token_permission_form.png diff --git a/docs/images/token_permission_selection.png b/docs/_static/images/token_permission_selection.png similarity index 100% rename from docs/images/token_permission_selection.png rename to docs/_static/images/token_permission_selection.png diff --git a/docs/tutorials/assets/tutorials/tracks_btrack.png b/docs/_static/images/tracks_btrack.png similarity index 100% rename from docs/tutorials/assets/tutorials/tracks_btrack.png rename to docs/_static/images/tracks_btrack.png diff --git a/docs/images/transform-icon.svg b/docs/_static/images/transform-icon.svg similarity index 100% rename from docs/images/transform-icon.svg rename to docs/_static/images/transform-icon.svg diff --git a/docs/images/transform-tool.png b/docs/_static/images/transform-tool.png similarity index 100% rename from docs/images/transform-tool.png rename to docs/_static/images/transform-tool.png diff --git a/docs/images/update_token_permissions.png b/docs/_static/images/update_token_permissions.png similarity index 100% rename from docs/images/update_token_permissions.png rename to docs/_static/images/update_token_permissions.png diff --git a/docs/tutorials/assets/tutorials/viewer-buttons.png b/docs/_static/images/viewer-buttons.png similarity index 100% rename from docs/tutorials/assets/tutorials/viewer-buttons.png rename to docs/_static/images/viewer-buttons.png diff --git a/docs/tutorials/assets/tutorials/viewer_layout.jpg b/docs/_static/images/viewer_layout.jpg similarity index 100% rename from docs/tutorials/assets/tutorials/viewer_layout.jpg rename to docs/_static/images/viewer_layout.jpg diff --git a/docs/images/vs_code_debug.png b/docs/_static/images/vs_code_debug.png similarity index 100% rename from docs/images/vs_code_debug.png rename to docs/_static/images/vs_code_debug.png diff --git a/docs/tutorials/assets/tutorials/installation/windows_bundle_command_terminal.png b/docs/_static/images/windows_bundle_command_terminal.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/windows_bundle_command_terminal.png rename to docs/_static/images/windows_bundle_command_terminal.png diff --git a/docs/tutorials/assets/tutorials/installation/windows_bundle_installer_finish.png b/docs/_static/images/windows_bundle_installer_finish.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/windows_bundle_installer_finish.png rename to docs/_static/images/windows_bundle_installer_finish.png diff --git a/docs/tutorials/assets/tutorials/installation/windows_bundle_installer_progress.png b/docs/_static/images/windows_bundle_installer_progress.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/windows_bundle_installer_progress.png rename to docs/_static/images/windows_bundle_installer_progress.png diff --git a/docs/tutorials/assets/tutorials/installation/windows_bundle_installer_start.png b/docs/_static/images/windows_bundle_installer_start.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/windows_bundle_installer_start.png rename to docs/_static/images/windows_bundle_installer_start.png diff --git a/docs/tutorials/assets/tutorials/installation/windows_launch_napari.png b/docs/_static/images/windows_launch_napari.png similarity index 100% rename from docs/tutorials/assets/tutorials/installation/windows_launch_napari.png rename to docs/_static/images/windows_launch_napari.png diff --git a/docs/conf.py b/docs/conf.py index ab41f4d30..db609c0ac 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -139,7 +139,7 @@ # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] -html_logo = "images/logo.png" +html_logo = "_static/images/logo.png" html_sourcelink_suffix = '' html_title = 'napari' @@ -301,7 +301,7 @@ def napari_scraper(block, block_vars, gallery_conf): 'gallery_dirs': 'gallery', # path to where to save gallery generated output 'filename_pattern': '/*.py', 'ignore_pattern': 'README.rst|/*_.py', - 'default_thumb_file': Path(__file__).parent / 'images' / 'logo.png', + 'default_thumb_file': Path(__file__).parent / '_static' / 'images' / 'logo.png', 'plot_gallery': "'True'", # https://github.com/sphinx-gallery/sphinx-gallery/pull/304/files 'download_all_examples': False, 'min_reported_time': 10, diff --git a/docs/developers/contributing/documentation/index.md b/docs/developers/contributing/documentation/index.md index f8796fe30..dc042c7c2 100644 --- a/docs/developers/contributing/documentation/index.md +++ b/docs/developers/contributing/documentation/index.md @@ -397,22 +397,22 @@ you will only be able to preview the documentation on CircleCI. Simply click on **Details** next to the `Check the rendered docs here!` at the bottom of your pull request: -![CircleCI check is highlighted](images/circleci-link.png) +![CircleCI check is highlighted](../../../_static/images/circleci-link.png) #### Download documentation artifact 1. Click on **Details** next to `Build & Deploy PR Docs / Build & Upload Artifact (pull_request)`: -![The "Build & Deploy PR Docs / Build & Upload Artifact" check is highlighted](images/doc-ci-1.png) +![The "Build & Deploy PR Docs / Build & Upload Artifact" check is highlighted](../../../_static/images/doc-ci-1.png) 2. Click on **Summary** on the top left corner: -![Summary link in the "Build & Deploy PR Docs / Build & Uplod Artifact" GitHub Action page](images/doc-ci-2.png) +![Summary link in the "Build & Deploy PR Docs / Build & Uplod Artifact" GitHub Action page](../../../_static/images/doc-ci-2.png) 3. Scroll down to **Artifacts** and click on **html** to download the built documentation: -!["html" link in the Artifacts section of the "Build & Deploy PR Docs / Build & Uplod Artifact" GitHub Action page is highlighted](images/doc-ci-3.png) +!["html" link in the Artifacts section of the "Build & Deploy PR Docs / Build & Uplod Artifact" GitHub Action page is highlighted](../../../_static/images/doc-ci-3.png) 4. Extract the compressed archive and open the `html/index.html` file on your preferred browser. You can also use Python's `http.server` module to open a local server on diff --git a/docs/developers/contributing/testing.md b/docs/developers/contributing/testing.md index 6fd0c9fb7..9564b43d7 100644 --- a/docs/developers/contributing/testing.md +++ b/docs/developers/contributing/testing.md @@ -29,7 +29,7 @@ much as we can with unit tests, requiring fewer integration tests, and the least of functional tests as depicted in the test pyramid below from [softwaretestinghelp.com](https://www.softwaretestinghelp.com/the-difference-between-unit-integration-and-functional-testing/): -![Pyramid diagram depicting the relationship between time to write/execute three different types of tests and return on investment for those tests. The pyramid is split into three sections: the bottom, largest section is Unit testing, the middle section is Integration testing and the top is Functional testing. The size of the section is proportional to the quantity of tests of that type you should write. Moving up the pyramid, tests take longer to write and have a lower return on investment.](../../images/tests.png) +![Pyramid diagram depicting the relationship between time to write/execute three different types of tests and return on investment for those tests. The pyramid is split into three sections: the bottom, largest section is Unit testing, the middle section is Integration testing and the top is Functional testing. The size of the section is proportional to the quantity of tests of that type you should write. Moving up the pyramid, tests take longer to write and have a lower return on investment.](../../_static/images/tests.png) Unit tests are at the base of the pyramid because they are the easiest to write and the quickest to run. The time and effort to implement and maintain tests increases diff --git a/docs/developers/coredev/maintenance.md b/docs/developers/coredev/maintenance.md index 990f30b7c..2254903ad 100644 --- a/docs/developers/coredev/maintenance.md +++ b/docs/developers/coredev/maintenance.md @@ -21,18 +21,18 @@ The token should be named `GHA_TOKEN` and the required permissions are: * **read and write** to pull requests * **read and write** to code - ![screenshot of token permissions in GitHub UI](../../images/update_token_permissions.png) + ![screenshot of token permissions in GitHub UI](../../_static/images/update_token_permissions.png) At the moment of writing this document, there is a difference in names between the summary of the token and the list of permissions. The **code** permission is called **Contents** in the Edit view of the token. -![screenshot of token permissions](../../images/edit_token_permissions.png) +![screenshot of token permissions](../../_static/images/edit_token_permissions.png) ## Refreshing the token To create a new token, go to the personal settings page and select _Developer settings_ at the bottom of the left menu. On the visible screen, expand the _Personal access tokens_ section and click the _Fine-grained token_ link. -![View on list of fine-grained tokens](../../images/fine_grained_token.png) +![View on list of fine-grained tokens](../../_static/images/fine_grained_token.png) Then click the _Generate new token_ button in the upper right corner. @@ -47,11 +47,11 @@ Fill the form: 4. Select **napari** to be the resource owner 5. Select _Only selected repositories_ and then select **napari/napari** repository -![screenshot of the token creation form](../../images/token_permission_form.png) +![screenshot of the token creation form](../../_static/images/token_permission_form.png) 6. Select the required permissions for repository metadata, pull requests, and code (contents) -![screenshot of the token creation form](../../images/token_permission_selection.png) +![screenshot of the token creation form](../../_static/images/token_permission_selection.png) 7. Click the _Generate token_ button 8. Copy token @@ -59,7 +59,7 @@ Fill the form: 10. Expand the _Secrets and variables_ section and select _Actions_ 11. Click the edit button for the `GHA_TOKEN` secret -![screenshot of the token creation form](../../images/secrets_section.png) +![screenshot of the token creation form](../../_static/images/secrets_section.png) 12. Paste a new token to the value field diff --git a/docs/guides/3D_interactivity.md b/docs/guides/3D_interactivity.md index 509691cbd..5fef7f1cd 100644 --- a/docs/guides/3D_interactivity.md +++ b/docs/guides/3D_interactivity.md @@ -5,12 +5,12 @@ ## Coordinate systems in napari In napari, there are three main coordinate systems: (1) canvas, (2) world, and (3) layer. The canvas coordinates system is the 2D coordinate system of the canvas on which the scene is rendered. World coordinates are the nD coordinates of the entire scene. As the name suggests, layer coordinates are the nD coordinate system of the data in a given layer. Layer coordinates are specific to each layer's data and are related to the world coordinate system via the layer transforms. -![A diagram of the coordinate systems and components involved when interacting with layers in napari. The camera faces the 3D scene to generate a 2D image that is presented on the canvas.](images/3d_interaction_coordianates.png) +![A diagram of the coordinate systems and components involved when interacting with layers in napari. The camera faces the 3D scene to generate a 2D image that is presented on the canvas.](../_static/images/3d_interaction_coordianates.png) ## In 3D mode, clicks are lines Since the 3D scene is rendered on a 2D surface (your screen), your mouse click does not map to a specific point in space. As the view is a [parallel projection](https://en.wikipedia.org/wiki/Parallel_projection), napari can determine a line through 3D space that intersects the canvas where the user clicked. -![A diagram that shows how clicking on a 2D position on the canvas corresponds to a 3D click line in the scene that starts from the 3D camera position.](images/3d_interaction_click_line.png) +![A diagram that shows how clicking on a 2D position on the canvas corresponds to a 3D click line in the scene that starts from the 3D camera position.](../_static/images/3d_interaction_click_line.png) When a user clicks or moves the mouse in the canvas, napari emits a mouse event with the following properties: @@ -25,7 +25,7 @@ When a user clicks or moves the mouse in the canvas, napari emits a mouse event ## Determining where the click intersects the data Each napari layer has a method called `get_ray_intersections()` that will return the points on the data bounding box that a given line will intersect (`start_point ` and `end_point `). When the click line (`view_direction`) and position (`position`) are used as inputs, `start_point` and `end_point` are the end points of the segment click line that intersects the layer's axis-alinged data bounding box. `start_point` is the end point that is closest to the camera (i.e, the "first" intersection) and `end_point` is the end point that is farthest from the camera (i.e., the "last" intersection). You can use the line segment between `start_point` and `end_point` to interrogate the layer data that is "under" your cursor. -![A diagram that shows how the 3D click line starting from the camera position intersects with the 3D bounding box associated with a layer's data. There are two intersection points. A start point, which is the first intersection point, and the end point which is the second.](images/3d_interaction_ray_intersection.png) +![A diagram that shows how the 3D click line starting from the camera position intersects with the 3D bounding box associated with a layer's data. There are two intersection points. A start point, which is the first intersection point, and the end point which is the second.](../_static/images/3d_interaction_ray_intersection.png) See the `get_ray_intersection()` docstrings below for details. Note that if the line does not intersect the data bounding box (i.e., the click was outside of the data), `start_point` and `end_point` are `None`. The `position` and `view_direction` should be provided as world coordinates if `world` is set to True and in layer coordinates if `world` is set to `False`. diff --git a/docs/guides/contexts_expressions.md b/docs/guides/contexts_expressions.md index ecf4ccd8a..deb770ceb 100644 --- a/docs/guides/contexts_expressions.md +++ b/docs/guides/contexts_expressions.md @@ -220,7 +220,7 @@ Out[15]: False But unlike a simple string, they can also provide type hinting, linting capabilities, and IDE autocompletion (for napari developers). -![An IDE showing a type hint for an attribute of the LayerListContextKeys class.](images/context_type_hint.png) +![An IDE showing a type hint for an attribute of the LayerListContextKeys class.](../_static/images/context_type_hint.png) A record of all registered context keys can be retrieved with the class method `ContextKey.info()` diff --git a/docs/guides/layers.md b/docs/guides/layers.md index f55b57df9..cb7ab06c0 100644 --- a/docs/guides/layers.md +++ b/docs/guides/layers.md @@ -36,13 +36,13 @@ with the layer from the viewer. These modes are accessible via the layer control widget top buttons and via keyboard shortcuts (these shortcuts will vary depending on the layer type). Currently, there are two base modes: * Pan and zoom -![image: Pan/zoom](../images/pan-zoom-tool.png) +![image: Pan/zoom](../_static/images/pan-zoom-tool.png) The `pan_zoom` mode allows you to pan around and zoom in/out the layer. It's the default mode selected. Note: zooming with the mouse-wheel should essentially always work! * Transform -![image: Transform](../images/transform-tool.png) +![image: Transform](../_static/images/transform-tool.png) The `transform` mode allows you to translate, rotate, and scale the layer graphically. Note: While you can transform 3D layers, at present this mode is only usable in 2D viewer display mode. @@ -106,7 +106,7 @@ other layers. For example, the image below shows an image with the blending set to `additive`. -![napari viewer with an image of a cell. Layer controls are open in the left sidebar with the blending set to additive.](./images/blending.png) +![napari viewer with an image of a cell. Layer controls are open in the left sidebar with the blending set to additive.](../_static/images/blending.png) ## 3D rendering of images @@ -154,7 +154,7 @@ distances from the camera according to a maximum intensity projection to create the 2D image that is then displayed on the screen. This mode works well for many biological images such as these cells growing in culture: -![napari viewer with an image of cells in a culture. Layer controls are open in the left sidebar and rendering set to mip.](./images/rendering.png) +![napari viewer with an image of cells in a culture. Layer controls are open in the left sidebar and rendering set to mip.](../_static/images/rendering.png) When viewing 2D slices the rendering mode has no effect. diff --git a/docs/howtos/layers/image.md b/docs/howtos/layers/image.md index bc2e46fdc..3656515b8 100644 --- a/docs/howtos/layers/image.md +++ b/docs/howtos/layers/image.md @@ -45,11 +45,11 @@ sample image of your choice. ### Buttons -* `Pan/zoom` ![image: Pan/zoom tool](../../images/pan-zoom-tool.png) is the default mode +* `Pan/zoom` ![image: Pan/zoom tool](../../_static/images/pan-zoom-tool.png) is the default mode of the layer and supports panning and zooming. Press the `1` key when the layer is selected to use this mode. -* `Transform` ![image: Transform](../../images/transform-tool.png) enables you to +* `Transform` ![image: Transform](../../_static/images/transform-tool.png) enables you to rotate, scale, or translate the layer. Note: at present this feature is limited to 2D viewer display mode. To reset the transformation, you can Option/Alt-click the transform button (a confirmation dialog will open to diff --git a/docs/howtos/layers/labels.md b/docs/howtos/layers/labels.md index f96995801..0dd147ad6 100644 --- a/docs/howtos/layers/labels.md +++ b/docs/howtos/layers/labels.md @@ -76,7 +76,7 @@ layer: Use this tool to manually erase a label on the `labels layer`. Other layers will not be affected. The label eraser tool looks like this: - ![image: eraser tool](../../images/labels-layer-eraser.png) + ![image: eraser tool](../../_static/images/labels-layer-eraser.png) * **Paintbrush** @@ -260,7 +260,7 @@ mode by pressing the `6` key when the `labels layer` is selected. ### Transform mode -This mode is represented by ![image: Transform](../../images/transform-tool.png) in the +This mode is represented by ![image: Transform](../../_static/images/transform-tool.png) in the `layer controls` panel. It enables you to rotate, scale, or translate the layer. Note: at present this feature is limited to 2D viewer display mode. To reset the transformation, you can Option/Alt-click the transform button (a @@ -512,8 +512,8 @@ where the data is represented as a multiscale image is not editable. All layers can be rendered in both 2D and 3D. One of the viewer buttons at the bottom of the left panel can toggle between these 2 modes. -When in 2D, the button looks like this: ![image: 2D/3D button](../../images/3D-button.png), ready to switch to 3D mode. -When in 3D, the button looks like this: ![image: 2D/3D button](../../images/2D-button.png), ready to switch to 2D mode. +When in 2D, the button looks like this: ![image: 2D/3D button](../../_static/images/3D-button.png), ready to switch to 3D mode. +When in 3D, the button looks like this: ![image: 2D/3D button](../../_static/images/2D-button.png), ready to switch to 2D mode. The number of dimensions sliders will be 2 or 3 less than the total number of dimensions of the layer, allowing you to browse volumetric timeseries data and diff --git a/docs/howtos/layers/points.md b/docs/howtos/layers/points.md index 6913637dc..74e2d3a11 100644 --- a/docs/howtos/layers/points.md +++ b/docs/howtos/layers/points.md @@ -71,14 +71,14 @@ layer: ### Buttons * **Deleting points** - ![image: Delete points tool](../../images/point-deleting-tool.png) + ![image: Delete points tool](../../_static/images/point-deleting-tool.png) Points can be deleted after they have been selected. First select the point or points to delete, then click on the `delete` button in the `layer controls` panel or press the delete key on your keyboard. * **Adding points** - ![image: Add points tool](../../images/point-adding-tool.png) + ![image: Add points tool](../../_static/images/point-adding-tool.png) New points can be added using the point adding tool, shown above, from the layer controls panel. Points can then be added by clicking in the canvas. @@ -102,7 +102,7 @@ layer: select all points in a layer and the *deselect* points from a slice. * **Selecting points** - ![image: Select points tool](../../images/point-selecting-tool.png) + ![image: Select points tool](../../_static/images/point-selecting-tool.png) Select a point using the tool (shown above) and then clicking on that point. You can select multiple points by continuing to shift+click on additional @@ -117,7 +117,7 @@ layer: to move around the `points` layer as you create your selection. * **Pan/zoom** - ![image: Pan/zoom tool](../../images/pan-zoom-tool.png) + ![image: Pan/zoom tool](../../_static/images/pan-zoom-tool.png) The default mode of the points layer supports panning and zooming, as in the image layer. This mode is represented by the magnifying glass in the layers @@ -127,7 +127,7 @@ layer: pan and zoom mode by pressing the `4` key when the points layer is selected. * **Transform** - ![image: Transform](../../images/transform-tool.png) + ![image: Transform](../../_static/images/transform-tool.png) Use this tool to rotate, scale, or translate the layer. Note: at present this feature is limited to 2D viewer display mode. To reset the transformation, @@ -197,8 +197,8 @@ layer: All layers can be rendered in both 2D and 3D. The `Toggle ndisplay` button at the bottom of the left panel toggles between these 2 modes. - When in 2D, the button looks like this: ![image: 2D/3D button](../../images/3D-button.png), ready to switch to 3D mode. - When in 3D, the button looks like this: ![image: 2D/3D button](../../images/2D-button.png), ready to switch to 2D mode. + When in 2D, the button looks like this: ![image: 2D/3D button](../../_static/images/3D-button.png), ready to switch to 3D mode. + When in 3D, the button looks like this: ![image: 2D/3D button](../../_static/images/2D-button.png), ready to switch to 2D mode. You can also switch modes by pressing `Ctrl+y`. Note that when entering 3D rendering mode the GUI `Add point`, diff --git a/docs/howtos/layers/shapes.md b/docs/howtos/layers/shapes.md index f995a36b7..fe4e8cb26 100644 --- a/docs/howtos/layers/shapes.md +++ b/docs/howtos/layers/shapes.md @@ -141,24 +141,24 @@ are used. i.e. You can't remove a vertex before you have created a shape. ### Buttons * **Remove vertex** - ![image: Remove vertex](../../images/shape_vertex_delete.png) + ![image: Remove vertex](../../_static/images/shape_vertex_delete.png) To remove a vertex, click this button and then click the vertex you want to remove. * **Insert vertex (Add vertex)** - ![image: Insert vertex](../../images/shape-vertex-insert.png) + ![image: Insert vertex](../../_static/images/shape-vertex-insert.png) Click this button and then click where you want to insert (add) a vertex. * **Delete selected shape** - ![image: Delete shape](../../images/shape-delete-shape.png) + ![image: Delete shape](../../_static/images/shape-delete-shape.png) Select the vertex to delete using the `select vertices` tool (below), then click this button, or hit the delete key on your keyboard. * **Select vertices** - ![image: Select vertices](../../images/shape-vertices-select.png) + ![image: Select vertices](../../_static/images/shape-vertices-select.png) Use this tool to select the vertex or vertices you want to move or delete. To select more than one vertex, select one, hold down the shift key and select @@ -166,13 +166,13 @@ are used. i.e. You can't remove a vertex before you have created a shape. location. * **Select shapes** - ![image: Select shapes](../../images/shape-select-shape.png) + ![image: Select shapes](../../_static/images/shape-select-shape.png) Use this tool to select the shape or shapes you want to delete. To select more than one shape, select one, hold down the shift key and select the rest. * **Pan/zoom** - ![image: Pan/zoom](../../images/pan-zoom-tool.png) + ![image: Pan/zoom](../../_static/images/pan-zoom-tool.png) Use this tool to pan around the layer or zoom in. Pan functionality is disabled when using the adding and editing tools; however, zoom using the mouse-wheel will typically continue to work. To activate the tool, @@ -181,26 +181,26 @@ are used. i.e. You can't remove a vertex before you have created a shape. layer as you edit it. * **Transform** - ![image: Transform](../../images/transform-tool.png) + ![image: Transform](../../_static/images/transform-tool.png) Use this tool to rotate, scale, or translate the layer. Note: at present this feature is limited to 2D viewer display mode. To activate the tool, you can press `7`. To reset the transformation, you can Option/Alt-click the transform button (a confirmation dialog will open to confirm the reset). * **Move to back** - ![image: Move to back](../../images/shape-move-to-back.png) + ![image: Move to back](../../_static/images/shape-move-to-back.png) Using the `select shapes` tool, select the shape to move behind other shapes and then click this button. * **Move to front** - ![image: Move to front](../../images/shape-move-to-front.png) + ![image: Move to front](../../_static/images/shape-move-to-front.png) Using the `select shapes` tool, select the shape to move in front of other shapes and then click this button. * **Add ellipses** - ![image: Add ellipses](../../images/shape-add-ellipses.png) + ![image: Add ellipses](../../_static/images/shape-add-ellipses.png) Use this tool to draw ovals or circles. Click the tool or press `e` (the default keybinding for this tool); next, click the point where you want the @@ -210,7 +210,7 @@ are used. i.e. You can't remove a vertex before you have created a shape. on that click. * **Add rectangles** - ![image: Add rectangles](../../images/shape-add-rectangles.png) + ![image: Add rectangles](../../_static/images/shape-add-rectangles.png) Select `Add rectangles` from the layer controls panel or by pressing the `r` key when the `shapes` layer is selected. Click and drag the rectangle to the @@ -219,7 +219,7 @@ are used. i.e. You can't remove a vertex before you have created a shape. centered on that click. * **Add polygons** - ![image: Add polygons](../../images/shape-add-polygons.png) + ![image: Add polygons](../../_static/images/shape-add-polygons.png) The `Add polygon` tool can be selected from the layer controls panel or by pressing the `p` key when the shapes layer is selected. When adding a polygon, @@ -228,7 +228,7 @@ are used. i.e. You can't remove a vertex before you have created a shape. position and completes the polygon. You can then add another polygon. * **Add polygons lasso** - ![image: Add polygons lasso](../../images/shape-add-lasso.png) + ![image: Add polygons lasso](../../_static/images/shape-add-lasso.png) `Polygons` can also be created with the polygon lasso creation tool, which can be found in the layer control panel or by pressing `shift+p`. The tool can be @@ -273,7 +273,7 @@ are used. i.e. You can't remove a vertex before you have created a shape. ::: * **Add lines** - ![image: Add lines](../../images/shape-add-lines.png) + ![image: Add lines](../../_static/images/shape-add-lines.png) Select the `Add lines` tool from the layer controls panel or by pressing the `l` key when the shapes layer is selected. `Lines` consist of two vertices @@ -283,7 +283,7 @@ are used. i.e. You can't remove a vertex before you have created a shape. of the second endpoint. Add other lines as needed. * **Add path** - ![image: Add path](../../images/shape-add-path.png) + ![image: Add path](../../_static/images/shape-add-path.png) Select the `Add path` tool from the layer controls panel or by pressing the `t` key when the shapes layer is selected. Click where you want the path to @@ -331,8 +331,8 @@ are used. i.e. You can't remove a vertex before you have created a shape. All layers can be rendered in both 2D and 3D. The `Toggle ndisplay` button at the bottom of the left panel toggles between these 2 modes. - When in 2D, the button looks like this: ![image: 2D/3D button](../../images/3D-button.png), ready to switch to 3D mode. - When in 3D, the button looks like this: ![image: 2D/3D button](../../images/2D-button.png), ready to switch to 2D mode. + When in 2D, the button looks like this: ![image: 2D/3D button](../../_static/images/3D-button.png), ready to switch to 3D mode. + When in 3D, the button looks like this: ![image: 2D/3D button](../../_static/images/2D-button.png), ready to switch to 2D mode. You can also switch modes by pressing `ctrl+y`. @@ -597,7 +597,7 @@ For paths that are defined by coordinates spanning more than two dimensions, it is possible to visualize them as 3D cylinders, see [](../../gallery/3D_paths) for examples. -![image: 3D paths](../../images/3D_paths.png) +![image: 3D paths](../../_static/images/3D_paths.png) ```{note} Right now, it is not possible to display 3D cuboids or 3D spheroids, but we will diff --git a/docs/howtos/layers/surface.md b/docs/howtos/layers/surface.md index 058f7c70a..be3275e74 100644 --- a/docs/howtos/layers/surface.md +++ b/docs/howtos/layers/surface.md @@ -78,10 +78,10 @@ Once you have created a `surface` layer programmatically, the following GUI controls are available in the viewer: * **Buttons** - * Pan/zoom - ![image: Pan/zoom tool](../../images/pan-zoom-tool.png) is the default + * Pan/zoom - ![image: Pan/zoom tool](../../_static/images/pan-zoom-tool.png) is the default mode of the layer and supports panning and zooming. Press the `1` key when the layer is selected to use this mode. - * Transform - ![image: Transform](../../images/transform-tool.png) enables you to + * Transform - ![image: Transform](../../_static/images/transform-tool.png) enables you to rotate, scale, or translate the layer. Note: at present this feature is limited to 2D viewer display mode. To reset the transformation, you can Option/Alt-click the transform button (a confirmation dialog will open to confirm the reset). Press the `2` key when the layer is selected to use this mode. @@ -125,8 +125,8 @@ list of values to associate with each vertex to use alongside a colormap. This All layers can be rendered in both 2D and 3D. One of the viewer buttons at the bottom of the left panel can toggle between these 2 modes. -When in 2D, the button looks like this: ![image: 2D/3D button](../../images/3D-button.png), ready to switch to 3D mode. -When in 3D, the button looks like this: ![image: 2D/3D button](../../images/2D-button.png), ready to switch to 2D mode. +When in 2D, the button looks like this: ![image: 2D/3D button](../../_static/images/3D-button.png), ready to switch to 3D mode. +When in 3D, the button looks like this: ![image: 2D/3D button](../../_static/images/2D-button.png), ready to switch to 2D mode. The number of dimensions sliders will be 2 or 3 less than the total number of dimensions of the layer, allowing you to browse volumetric timeseries data and diff --git a/docs/howtos/layers/tracks.md b/docs/howtos/layers/tracks.md index 3045a9ad9..c8beef8ea 100644 --- a/docs/howtos/layers/tracks.md +++ b/docs/howtos/layers/tracks.md @@ -93,10 +93,10 @@ napari.run() ## GUI controls for the `tracks` layer * **Buttons** - * Pan/zoom - ![image: Pan/zoom tool](../../images/pan-zoom-tool.png) is the default + * Pan/zoom - ![image: Pan/zoom tool](../../_static/images/pan-zoom-tool.png) is the default mode of the layer and supports panning and zooming. Press the `1` key when the layer is selected to use this mode. - * Transform - ![image: Transform](../../images/transform-tool.png) enables you to + * Transform - ![image: Transform](../../_static/images/transform-tool.png) enables you to rotate, scale, or translate the layer. Note: at present this feature is limited to 2D viewer display mode. To reset the transformation, you can Option/Alt-click the transform button (a confirmation dialog will open to confirm the reset). Press the `2` key when the layer is selected to use this mode. @@ -211,8 +211,8 @@ properties of the tracks (e.g., the track color). All layers can be rendered in both 2D and 3D. One of the viewer buttons at the bottom of the left panel can toggle between these 2 modes. -When in 2D, the button looks like this: ![image: 2D/3D button](../../images/3D-button.png), ready to switch to 3D mode. -When in 3D, the button looks like this: ![image: 2D/3D button](../../images/2D-button.png), ready to switch to 2D mode. +When in 2D, the button looks like this: ![image: 2D/3D button](../../_static/images/3D-button.png), ready to switch to 3D mode. +When in 3D, the button looks like this: ![image: 2D/3D button](../../_static/images/2D-button.png), ready to switch to 2D mode. The number of dimensions sliders will be 2 or 3 less than the total number of dimensions of the layer, allowing you to browse volumetric timeseries data and diff --git a/docs/howtos/layers/vectors.md b/docs/howtos/layers/vectors.md index e4c6a781d..8cee8c7bf 100644 --- a/docs/howtos/layers/vectors.md +++ b/docs/howtos/layers/vectors.md @@ -86,10 +86,10 @@ Please refer to [A simple example](#a-simple-example) to add a `vectors` layer first, then explore the editing options the GUI provides. * **Buttons** - * Pan/zoom - ![image: Pan/zoom tool](../../images/pan-zoom-tool.png) is the default + * Pan/zoom - ![image: Pan/zoom tool](../../_static/images/pan-zoom-tool.png) is the default mode of the layer and supports panning and zooming. Press the `1` key when the layer is selected to use this mode. - * Transform - ![image: Transform](../../images/transform-tool.png) enables you to + * Transform - ![image: Transform](../../_static/images/transform-tool.png) enables you to rotate, scale, or translate the layer. Note: at present this feature is limited to 2D viewer display mode. To reset the transformation, you can Option/Alt-click the transform button (a confirmation dialog will open to confirm the reset). Press the `2` key when the layer is selected to use this mode. @@ -128,8 +128,8 @@ you should use the `Lines` shape inside a `shapes` layer. All layers can be rendered in both 2D and 3D. One of the viewer buttons at the bottom of the left panel can toggle between these 2 modes. -When in 2D, the button looks like this: ![image: 2D/3D button](../../images/3D-button.png), ready to switch to 3D mode. -When in 3D, the button looks like this: ![image: 2D/3D button](../../images/2D-button.png), ready to switch to 2D mode. +When in 2D, the button looks like this: ![image: 2D/3D button](../../_static/images/3D-button.png), ready to switch to 3D mode. +When in 3D, the button looks like this: ![image: 2D/3D button](../../_static/images/2D-button.png), ready to switch to 2D mode. The number of dimensions sliders will be 2 or 3 less than the total number of dimensions of the layer, allowing you to browse volumetric timeseries data and @@ -183,7 +183,7 @@ you have one vector per grid. Here is an example from [](../../gallery/add_vectors_image) of a grid of vectors defined over a random image: -![image: add vectors overlaid on an image](../../images/add_vectors_image.png) +![image: add vectors overlaid on an image](../../_static/images/add_vectors_image.png) Regardless of how the data is passed, we convert it to the `Nx2xD` representation internally. This representation is accessible through the diff --git a/docs/images/3D-button.png b/docs/images/3D-button.png deleted file mode 100644 index 155dfbbcc1e38b4cefdf78f867015bc07bfd8881..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4756 zcmZ{n2Ut_fwtzP(f;5pL0t!fz9zYT41OieFB^2pBKxhGy&}dv;YuG2LMMp01&JI0R9*NSa=Ko zvaLCC3d24|i}VosE(rEo)g7t`HYVp2TRzsOyd)wG)mc6^te=5oyVJSsX*kDsT{# zP*QVyjD4)#+kUm?ixg@Vv9a1-4d|Scvhk39cR?|nPm_*qydyF$#$lX{vgP(^arkmmn_Ev=^5E9zmozQic(RxX6#=MhZoP8m2y)8)3k3T zTUzO~*Pzb~cpPzjC-QiHy+aS&Q(k7}%#Tr2JK$6jAh>-(4F+(S=J=`Jl_cF#&U}Mc zZJ>|V>AXJ}A~?RLBOg@;S5=+8a5>v0`gcqZTlNS^`>QW|5B4HXxT^zcZmD$YVW1TF zhkT6rC{O%}sdz8EPb{`a<*M4bZ@2uSx8F+&-!|&Zd9|0_Co~P+^2d>ueSL$N)$pIp zPi-brCuKpi*u^_ql>#e}iT~*Mg zWxm}pSUE}DWF2dJI!B<|O)lXi@A z-=h@46^`>(QL+Wei;`OeU0Gv`1=EH`@X=ED2BB|qwVW#pNqI~*O%|p&p>zEid7dJt z+Qk`V=WMz+RBv(HikR-M?o0DRXy!%SD)^{dbo1gq6_+TpVOY7ftq)CmsIj}~^-Ca} z-gurnn;AJWRB(c2mv;CZ(?Zqayktw7P~ z@x@n+3yN-B{w1ZjAiAer4O61NwP7txoh=SluQ(wvXL^B63|XQ%bJAi zuQ#zWFLiMdx=WfCB3y51wPT%N3$h~Ekd+cV?p?p(fI~HrPENWPRLxXTS7lVGnz0sB zN(QkuP7zsrC_l@{Gj!n{CSulxh!JZJYn5vuy9pOaaU%HmaqY-kk>sSI6!qYGM7?nR z?fPrFQH~HaPdJ@#gV`kSq=k(j@uJ7$d#W(r)W^f>iLdl~SztT`!RX-4$D4*=FxV2W zVjYaru`XB2tG^PaNpVDx)goYrD!VKdEX0N6Cfuq_BqWZ(_!w-XnRqgvs0^wVR-i(NhFwn`pNxmZew}#T$ zKXUK9eV|uiKx5FUGx`#%vsbqMn8Kpbs8KsCANB@T=&1z{3h$zvt_SBokh6q&3%Ghx4x&DuA(iQebk*Y%S;+7MbXerJ4W zyyPI!{z+mfWZwk?!qoYd`sMDMZ*{RyQ7gpViG#)2$K8K%4T|a@eIfOt<_^fQF1<*4 z$n~zb7jZfF1Hl<@GHWtn(pK(NUW|xyT5=?Fj47{l&gu&&Q2s^iRqyBjB~^6$oo3%w zH{)W`Qf7~Tr;csOwS`!XCf}yW%p{AKnGcW&7Wtzobx{G&0)hi_kGal2A?f27d^!Ab z#HvB(mwTploptSmKUdC`J~gY49dEwPhm=Nn#1f^a?5A$hW9Tc?Gu3NbmGz(_6-5=u<@S{-uYND@W&Z8s z?ZRc#WlI^Oduunmq&B5{ug^&pqg=cX7pIrGJ)GQGyzZj4(4!N>-}K?(Vv?euYAf^4 z=7!bj=)LL1=@&D8Ken_b1uO4VhPWxCptI|9s~Ixm#e`0ev8mBH{F>V4ZclEPUf0tp zt|;W|BxvO-fL)Rau-@Ef>U z*VG;Nx*lxL;j9krcbXBpeZF>X7sSAON_WcotNI`x7B|*R_R%Zg7$Z6l(MkVT-qWvJ z$aG)pmc7|_bV4hk%{L>ijir>O)D1|L3fjDHLNr~PGMOY2dx!^<_nG#Ehd;TC;>EK0 zvL7Y3=D=e_KtIjW>vn(8Ez)&9v5gvNNNEU(vb>j_&eG{fCxf`(Oa3dOChh2aTIvX?1U1HU1;ZY^K+YXySBnqB3?O*>kWFB9lInfFD@rY z^++`*@q_4vYm%HZYvgx~GXqDp+r-+c+lDr_)_+a!ytgVE_&{fp`mxOaIsR?EK}g|w zLv|x&lcyE4e!)<%F}|i;%-NK(obn+P4VG!m+&|GK@zooLjG<2>W43in0b|vp0Y}?g zW6{2i4>epg1T^Yg#@(vcLsl+7SBOPE7#*l?Mf4SSRCVNZjO1nJk$r#Gw*LKMMf*^% zekUJDB(M_G`m>FZhOwqHv7)tN%OG68!bNhp&i5c$0Ng*~L|AOPVIuRBuv_x9a^t7S zdvofVa_{8j0yHR_3Bk~>oJO_2FOe+K#+JJFv z2FiQ{TojVFIN@h}w3Z#JEP45W%?(lFG|;Dp6p}g@-x4o-B1N2A&BfmzN)StsIJDVp zi=X;9)dxmnSGiMB$|;GPPOywXx;+VSjc;X`R47t?dyN- z9RDlc())A3=e~ju3*j4aNogXIrZux(8Fe$hOUtffLrjDcf?2K1iQ7YOeQ%_;lC~x2 zz4yGue(kTF4}=6cqa)gblHJ7K+~{VL1m}R;2Sue_1qA&s$dmG0SG3uv+{r8sMUIZz ztS0on_eDE=>RJq64%ebNxIBifTiY9_B*v5`s|50$lukWgD6~A@+~4@Ew%juA+`2@R zWF2+-JaW=GVSeB^Fh8}!OlX#82>h|@Gfuyu*F2Zf)z#!#H~vLGK;q!{zVPnQH)1T& zL+pNi>UC0DG`_VJ_&k`<+2jFqcUPx>ba$%AWN=)R6ICDoLi}+k$FBwa*am2;uLnI| z0$koJH5>m>VDzUC)zz(K4O&^5SyJGHR#c{~t87E=KfOOSg@lrPO+L3)j>cl&d0`Ko zgF?udwT%2RM~aL9Vv z*-OJ9s(<09GdWI2G}>Jn1oHOw7V*92&5awnO|!gBnB@=9mx&#S6ZhDg3dG`F%ePF zf5OlR`~QNSY5v6i$m`E=vS-eu4N!1TWu&Vs+zl-0J4_t$aziq?L{#gXi+jt zcBvYzCd2ut%PAaDj(09(Q4y1_P4R$xY)ZPlYJLr7)cSO$X22^}JGI!a?*8r@Ox;^K ztQ+&LLj~yliXI}on`8-s$yi|S@WBf7xr4M~rg1rZbi9j@l%O$oMM9i^Q;?R22Q#W8 zJuCe6%#z(AL?e&RZNXAK}6+_OWFspWq@wVy*=?7$m z$*p#Y8u>%2ylE=c!;l#jlrb!K>L;Ujcd~|OF5?~OH%!~3Qja5Lax!HJlqA`lLaN!< z9}~IV6r@!K6yTLtPoI z={6vfsjj9y-ru&Ku#xaDZ~0xJA>&t~`|O$UD|pWL)pjc}k5{Gd%9F55DAfI;hsfeexiy3c=HYW*wVVYe8hRf_HjM%jn&a?smt)x9 z4ei_TZHlM2POlMfHN#OK{9ZFB9lmX`s}fjNOBt6$DHy~)m21juafLLj*Y&8sfow0o zhsr6{+^Qr9Ua&20>(_r6n)ikGc*brG_(qvw*fg89R!BV;HmVDpki^ahTU3|H+&DWC N)m5}0#Y$GV{{gKg-fRE> diff --git a/docs/naps/5-new-logo.md b/docs/naps/5-new-logo.md index c18c2f10c..e86056827 100644 --- a/docs/naps/5-new-logo.md +++ b/docs/naps/5-new-logo.md @@ -29,7 +29,7 @@ A few months later, Jeremy Freeman, then director of Computational Biology at CZI, and a bit of a design nerd, traced the island and gave us our current, stylised version of that image. -![napari-logo-2](../images/logo.png) +![napari-logo-2](../_static/images/logo.png) Being, the shape is very irregular — no one knows what it is — and the gradients, the border around the logo, and the slightly rounded corners on a @@ -55,7 +55,7 @@ smaller again by $\phi$ than the smaller circle, and one larger again than the bigger circle. In this way, the island is defined by four circles of increasing radius, with each increase a factor of $\phi$: -![napari-logo-3-with-guides](../images/napari-logo-3-with-guides.png) +![napari-logo-3-with-guides](../_static/images/napari-logo-3-with-guides.png) Additionally, the background of the logo is a [squircle](https://www.johndcook.com/blog/2018/02/13/squircle-curvature/) of @@ -73,11 +73,11 @@ background in biology would appreciate! Here is the proposed logo together with the old one: -![napari-logo-comparison](../images/napari-logo-old-new.png) +![napari-logo-comparison](../_static/images/napari-logo-old-new.png) The new logo at 100% scale: -![napari-logo-3](../images/napari-logo-3.png) +![napari-logo-3](../_static/images/napari-logo-3.png) ## Related Work diff --git a/docs/plugins/building_a_plugin/debug_plugins.md b/docs/plugins/building_a_plugin/debug_plugins.md index 9e7587f46..54af6814b 100644 --- a/docs/plugins/building_a_plugin/debug_plugins.md +++ b/docs/plugins/building_a_plugin/debug_plugins.md @@ -35,7 +35,7 @@ To quickly get started with debugging your plugin, you can do the following: 4. Run the created napari launch script in debug mode. For example, in VSCode, you can do this by opening the script in the editor, [selecting your napari virtual environment as the python interpreter](https://code.visualstudio.com/docs/python/environments) and then clicking the `Run and Debug` button in the left hand toolbar, selecting `Python: File` as the run configuration. 5. At a breakpoint or exception (in VSCode, tick the `Raised Exceptions` box in the bottom left under the `Breakpoints` menu to see exceptions) you can then step through the code, inspect variables, and see the state of the napari viewer and your plugin. When you are done done debugging hit the continue button and napari will resume normal execution. See the image below for an example of a napari plugin debugging session in VSCode paused on a breakpoint. -![debugging_in_vscode](../../images/vs_code_debug.png) +![debugging_in_vscode](../../_static/images/vs_code_debug.png) ## Debugging plugin start-up issues diff --git a/docs/plugins/start_using_plugins/finding_and_installing_plugins.md b/docs/plugins/start_using_plugins/finding_and_installing_plugins.md index ca9b39354..3ad27be9a 100644 --- a/docs/plugins/start_using_plugins/finding_and_installing_plugins.md +++ b/docs/plugins/start_using_plugins/finding_and_installing_plugins.md @@ -17,7 +17,7 @@ directly from within napari: Firstly, from the “Plugins” menu, select “Install/Uninstall Plugins...”. Then, in the plugin installer menu that opens, you can either: -![napari viewer's Plugins menu with Install/Uninstall Plugins as the first item.](/images/plugin-menu.png) +![napari viewer's Plugins menu with Install/Uninstall Plugins as the first item.](../../_static/images/plugin-menu.png) 1. Install plugins from the list: you can scroll through the list of “Available Plugins”, or filter plugins using the text box at the top of the dialog. From the list, @@ -33,7 +33,7 @@ Then, in the plugin installer menu that opens, you can either: the “Install” button next to the input bar. This method allows for more flexibility in the plugins you can install, but it is also a bit more advanced. - ![napari viewer's Plugin dialog. At the bottom of the dialog, there is a place to install by name, URL, or dropping in a file.](/images/plugin-install-dialog.png) + ![napari viewer's Plugin dialog. At the bottom of the dialog, there is a place to install by name, URL, or dropping in a file.](../../_static/images/plugin-install-dialog.png) ```{admonition} Example If you want to install `napari-svg` directly from the development branch on the [github repository](https://github.com/napari/napari-svg), enter `git+https://github.com/napari/napari-svg.git` in the text field. diff --git a/docs/plugins/testing_workshop_docs/3-readers-and-fixtures.md b/docs/plugins/testing_workshop_docs/3-readers-and-fixtures.md index 17096ed6e..626c8c9a1 100644 --- a/docs/plugins/testing_workshop_docs/3-readers-and-fixtures.md +++ b/docs/plugins/testing_workshop_docs/3-readers-and-fixtures.md @@ -24,12 +24,12 @@ The example plugin and all the tests discussed in this lesson are available in [ ## Introduction In this lesson, we discuss a napari plugin called [plugin_tests](https://github.com/DragaDoncila/plugin-tests/tree/main/src/plugin_tests), generated using the [napari plugin template](https://github.com/napari/napari-plugin-template), which has a reader and a widget. The reader is the template [NumPy `.npy` file](https://numpy.org/doc/stable/reference/generated/numpy.lib.format.html#npy-format) reader, `napari_get_reader`. It checks whether a path ends in `.npy`. If it doesn't, it returns `None`, and if it does, it returns the `reader_function`, which loads the data. -![napari_get_reader](../../images/napari_plugins_1st_napari_get_reader.png) +![napari_get_reader](../../_static/images/napari_plugins_1st_napari_get_reader.png) ## Reader The `napari_get_reader` function is the first thing to test. In the top-level directory under `src`, we have the `plugin_tests` module. Inside `plugin_tests` is the `_tests` directory. This is a typical structure when writing tests. There is also a `test_reader.py` file, which is empty. We will populate it with tests. -![reader_function](../../images/napari_plugins_2nd_reader_function.png) +![reader_function](../../_static/images/napari_plugins_2nd_reader_function.png) We are focused on testing the `napari_get_reader` function. Sometimes it returns `None`; sometimes it returns the `reader_function`. We want to ensure that if we pass in a path that ends with `.npy`, it gives us back a function we can call. We import `numpy` and `napari_get_reader`. `numpy` will be used later. @@ -64,7 +64,7 @@ def test_get_reader_returns_callable(tmp_path): Running the command `pytest .` in the root directory of the plugin, we discover all the functions recognized as tests. It should recognize `test_reader.py` because it's a test file, prefixed with the word test. `test_reader.py` was found and passed the test. -![pytest passed](../../images/napari_plugins_3rd_pytest_passed.png) +![pytest passed](../../_static/images/napari_plugins_3rd_pytest_passed.png) If the file did not end in `.npy` the test would fail because what was returned wasn't callable. This code has been modified to produce an error: ```python @@ -83,7 +83,7 @@ def test_get_reader_returns_callable(tmp_path): ``` Once we run `pytest` we can see that it traced back that the callable of `reader` is `False` and it has filled in the fact that `reader` at the time of the assertion was `None`. This is useful in debugging. -![test_get_reader_returns_callable Failed](../../images/napari_plugins_4th_test_get_reader_returns_callable-failed.png) +![test_get_reader_returns_callable Failed](../../_static/images/napari_plugins_4th_test_get_reader_returns_callable-failed.png) ## Custom fixtures and round-trip tests Next, we test to see if this function reads the data. This is a round-trip test. We will create a fixture to write the data to make things easier for ourselves. This fixture will be called [test_reader_round_trip](https://github.com/DragaDoncila/plugin-tests/blob/effb32d6e3b191ad83e69813b26ae8695210f5ad/src/plugin_tests/_tests/test_reader.py#L39). @@ -144,7 +144,7 @@ def test_reader_round_trip(write_im_to_file): ``` We run our tests again, and now two are collected, both passing. -![pytest - tests passed](../../images/napari_plugins_5th_tests_passed.png) +![pytest - tests passed](../../_static/images/napari_plugins_5th_tests_passed.png) ## Enclosed testing diff --git a/docs/plugins/testing_workshop_docs/4-test-coverage.md b/docs/plugins/testing_workshop_docs/4-test-coverage.md index dc0b9839d..c4728a458 100644 --- a/docs/plugins/testing_workshop_docs/4-test-coverage.md +++ b/docs/plugins/testing_workshop_docs/4-test-coverage.md @@ -66,13 +66,13 @@ There is a large folder (`htmlcov`) in the directory where the tests were run (` If we open the `index.html` file from the list of files in the left panel (to the left of line 32) in a browser, we can see the coverage report. -![htmlcov directory](../../images/test_coverage_htmlcov_directory.png) +![htmlcov directory](../../_static/images/test_coverage_htmlcov_directory.png) -![Coverage Report](../../images/coverage_report.png) +![Coverage Report](../../_static/images/coverage_report.png) We are interested in `_reader.py`. The file containing the reader code has 86% coverage (see below). Clicking ok on the `2 missing` box below highlights the lines that were never run at all. They are highlighted in red (lines 22 and 26): -![Lines not run highlighted in red](../../images/lines_not_run_highlighted_in_red.png) +![Lines not run highlighted in red](../../_static/images/lines_not_run_highlighted_in_red.png) Because we never provided a list of paths, we don't know what will happen in that case. We also never ran code that tests not returning a reader. In other words, we never tested the failed cases. We can and should add those tests. The first one is `test_get_reader_pass`. We'll call it with a file that doesn't end in `.npy` and assert that it returned `None`. Then we'll create a second test to call with a list of paths. @@ -96,7 +96,7 @@ If we re-run `pytest`, the coverage report is also updated and coverage should i The coverage report goes to the same folder, `htmlcov`, so we should be able to refresh the page without opening the file again. We've now got 100% coverage of `_reader.py` now. See below. -![second coverage report](../../images/second_coverage_report.png) +![second coverage report](../../_static/images/second_coverage_report.png) There could be other, more complicated cases that we have not tested, but at the very least, we are executing all lines of code. diff --git a/docs/release/release_0_5_0.md b/docs/release/release_0_5_0.md index 8efe3e05e..ba83c898a 100644 --- a/docs/release/release_0_5_0.md +++ b/docs/release/release_0_5_0.md @@ -51,7 +51,7 @@ between layers ([#6864](https://github.com/napari/napari/pull/6864)). You'll also note a new little button on layer controls, including images: -```{image} ../images/transform-icon.svg +```{image} ../_static/images/transform-icon.svg :alt: transform layer icon :width: 100px :align: center diff --git a/docs/tutorials/annotation/annotate_points.md b/docs/tutorials/annotation/annotate_points.md index 0a2afbc25..2b5f45573 100644 --- a/docs/tutorials/annotation/annotate_points.md +++ b/docs/tutorials/annotation/annotate_points.md @@ -435,7 +435,7 @@ Once we are happy with the annotations, we can save them to a CSV file using the To do so, first, select the "Points" layer in the layer list and then click "Save Selected layer(s)" in the "File" menu or press control+S (cmd+S on Mac OS) to bring up the file save dialog. From here you can enter the file path and save the annotation coordinates as a CSV. -![Viewer with green box around a points layer in layer list. Label in green says "1. Select Points layer in the layer list". Dialog in the middle of the viewer has options to add save file name and choose save location, with Cancel and Save buttons in the bottom right.](../assets/tutorials/points_save_dialog.png) +![Viewer with green box around a points layer in layer list. Label in green says "1. Select Points layer in the layer list". Dialog in the middle of the viewer has options to add save file name and choose save location, with Cancel and Save buttons in the bottom right.](../../_static/images/points_save_dialog.png) Alternatively, we can use the `points_layer.save()` method to save the coordinates from the points layer to a CSV file. We can enter the command either in the script (e.g., bind a save function to a hot key) or the napari terminal. diff --git a/docs/tutorials/fundamentals/getting_started.md b/docs/tutorials/fundamentals/getting_started.md index 95e761345..0780cfb6f 100644 --- a/docs/tutorials/fundamentals/getting_started.md +++ b/docs/tutorials/fundamentals/getting_started.md @@ -31,7 +31,7 @@ napari This command will launch an empty viewer: -![image: an empty napari viewer](../assets/tutorials/launch_cli_empty.png) +![image: an empty napari viewer](../../_static/images/launch_cli_empty.png) Once you have the viewer open you can add images through the `File -> Open` dropdown menu or by dragging and dropping images directly on the viewer. We currently only support files that can be read with [`skimage.io.imread`](https://scikit-image.org/docs/dev/api/skimage.io.html#skimage.io.imread), @@ -45,7 +45,7 @@ napari my_image.png If the image is `RGB` or `RGBA` use the `-r` or `--rgb` flag. -![image: napari viewer displaying an image layer](../assets/tutorials/launch_cli_image.png) +![image: napari viewer displaying an image layer](../../_static/images/launch_cli_image.png) Launching `napari` directly from the command line is the simplest and fastest way to open the viewer, but it doesn't allow you to preprocess your images before opening them. @@ -109,7 +109,7 @@ python my_example_script.py The [examples gallery](../../gallery) consists of code examples which can be downloaded as `.py` (and `.ipynb` files) and run as above. -![image: napari launched from a python script](../assets/tutorials/launch_script.png) +![image: napari launched from a python script](../../_static/images/launch_script.png) An advantage of launching `napari` from a python script is that you can preprocess your images and add multiple layers before displaying the viewer. @@ -139,7 +139,7 @@ viewer, image_layer = napari.imshow(cells3d()) loop](https://ipython.readthedocs.io/en/stable/config/eventloops.html#integrating-with-gui-event-loops) from IPython -![image: napari launched from ipython](../assets/tutorials/launch_ipython.png) +![image: napari launched from ipython](../../_static/images/launch_ipython.png) An advantage of launching napari from an IPython console is that the you can continue to programmatically interact with the viewer from the IPython console, @@ -156,7 +156,7 @@ You can also launch `napari` from a Jupyter notebook. The Below, we launch the [notebook example](https://github.com/napari/napari/tree/main/examples/notebook.ipynb) from a Jupyter notebook. -![image: napari launched from a Jupyter notebook](../assets/tutorials/launch_jupyter.png) +![image: napari launched from a Jupyter notebook](../../_static/images/launch_jupyter.png) Similar to launching from the IPython console, an advantage of launching `napari` from a Jupyter notebook diff --git a/docs/tutorials/fundamentals/installation.md b/docs/tutorials/fundamentals/installation.md index aec5d0400..284a243d9 100644 --- a/docs/tutorials/fundamentals/installation.md +++ b/docs/tutorials/fundamentals/installation.md @@ -153,7 +153,7 @@ napari An empty napari viewer should appear as follows: -![macOS desktop with a napari viewer window without any image opened in the foreground, and a terminal in the background with the appropriate conda environment activated (if applicable) and the command to open napari entered.](../assets/tutorials/launch_cli_empty.png) +![macOS desktop with a napari viewer window without any image opened in the foreground, and a terminal in the background with the appropriate conda environment activated (if applicable) and the command to open napari entered.](../../_static/images/launch_cli_empty.png) ````{note} On some platforms, particularly macOS and Windows, there may be a ~30 second diff --git a/docs/tutorials/fundamentals/installation_bundle_conda.md b/docs/tutorials/fundamentals/installation_bundle_conda.md index 6a51cf064..dde12a7e4 100644 --- a/docs/tutorials/fundamentals/installation_bundle_conda.md +++ b/docs/tutorials/fundamentals/installation_bundle_conda.md @@ -33,7 +33,7 @@ To start, visit the [latest napari release page](https://github.com/napari/napar - For Apple processors, download the `*-macOS-arm64.pkg` installer. - Linux users will need to choose the `*-Linux-x86_64.sh` installer. -![Cropped screenshot of the GitHub Releases page for napari version 0.4.15. The expanded assets tab shows a number of installers available for different operating systems and architectures. Yellow rectangles highlight the files that correspond to the conda-based installers described in this tutorial.](../assets/tutorials/installation/bundle_02.png) +![Cropped screenshot of the GitHub Releases page for napari version 0.4.15. The expanded assets tab shows a number of installers available for different operating systems and architectures. Yellow rectangles highlight the files that correspond to the conda-based installers described in this tutorial.](../../_static/images/bundle_02.png) ```{note} If you are interested in an earlier version of napari, you may access those files by scrolling below the latest release on the [napari release page](https://github.com/napari/napari/releases). The instructions below will work for napari versions 0.4.15 and above. @@ -47,19 +47,19 @@ This installation method does not have any prerequisites. Once you have downloaded the appropriate macOS package file, you will have a file with a name like `napari-0.5.0-macOS-x86_64.pkg`. Double click this file to open the installer. -![Cropped screenshot of macOS desktop UI showing the icon of the PKG installer file, and an arrow pointing to the Welcome page in the opened PKG installer.](../assets/tutorials/installation/bundle_04.png) +![Cropped screenshot of macOS desktop UI showing the icon of the PKG installer file, and an arrow pointing to the Welcome page in the opened PKG installer.](../../_static/images/bundle_04.png) Click 'Continue' to open the Software License Agreement. -![Cropped screenshot of the License page in an opened PKG installer, showing the BSD 3-Clause License text and four buttons: Print, Save, Go Back and Continue.](../assets/tutorials/installation/bundle_06.png) +![Cropped screenshot of the License page in an opened PKG installer, showing the BSD 3-Clause License text and four buttons: Print, Save, Go Back and Continue.](../../_static/images/bundle_06.png) After reading this agreement, click 'Continue' to be prompted to agree to the Software License Agreement in order to proceed with installation. -![Cropped screenshot of the License page prompting the user to agree to the napari Software License Agreement. The dialog contains three buttons: Read License, Disagree and Agree.](../assets/tutorials/installation/bundle_07.png) +![Cropped screenshot of the License page prompting the user to agree to the napari Software License Agreement. The dialog contains three buttons: Read License, Disagree and Agree.](../../_static/images/bundle_07.png) Click on 'Agree'. On the following page, you will be shown how much space the installation will use and can begin the standard installation by clicking 'Install.' -![Cropped screenshot of the Installation Type page on the PKG installer. It reports the estimated space the installation will use (2.45 GB in this example) and shows four buttons: Change Install Location, Customize, Go Back and Install.](../assets/tutorials/installation/bundle_09.png) +![Cropped screenshot of the Installation Type page on the PKG installer. It reports the estimated space the installation will use (2.45 GB in this example) and shows four buttons: Change Install Location, Customize, Go Back and Install.](../../_static/images/bundle_09.png) However, if you would like to change the default location for the installation, you may specify a different location by clicking 'Change Install Location…' and following the subsequent prompts before starting the installation. @@ -67,7 +67,7 @@ You can also optionally click on 'Customize' to disable or enable some aspects o The installation progress can be monitored on the following window. Some notifications will appear in the top right corner of your display with further details. -![Cropped screenshot of the Installation page of the PKG installer. This page displays a progress bar at a 10%. In the top right corner, an example of a system notification with the text 'Installing packages. This might take a few minutes' is shown](../assets/tutorials/installation/bundle_10.png) +![Cropped screenshot of the Installation page of the PKG installer. This page displays a progress bar at a 10%. In the top right corner, an example of a system notification with the text 'Installing packages. This might take a few minutes' is shown](../../_static/images/bundle_10.png) ```{note} If an error ocurred during the installation, do not close the installer immediately. Before doing so, please inspect the logs by clicking on Window > Installer log or pressing + L. In the Detail Level dropdown, choose 'Show All Logs' and click on Save to keep a copy of the contents in a text file. This will be useful if you want to [submit an issue](https://github.com/napari/napari/issues/new/choose). @@ -75,11 +75,11 @@ If an error ocurred during the installation, do not close the installer immediat After finishing with no errors, a new page with the text "The installation was successful" will appear, as shown below. -![Cropped screenshot of the final page of the PKG installer, Summary, reporting "The installation was successful" with a green check mark icon. A blue Close button is available.](../assets/tutorials/installation/bundle_11.png) +![Cropped screenshot of the final page of the PKG installer, Summary, reporting "The installation was successful" with a green check mark icon. A blue Close button is available.](../../_static/images/bundle_11.png) Click Close to finish. You can now get started using napari! Use Launchpad to open the application. -![Montage of two cropped screenshots. On the left, the macOS finder icon and the Launchpad icon, highlighted with a red circle. On the right, the opened launchpad UI showing a 4x4 grid of applications icon, with napari appearing in the bottom right corner.](../assets/tutorials/installation/bundle_13.png) +![Montage of two cropped screenshots. On the left, the macOS finder icon and the Launchpad icon, highlighted with a red circle. On the right, the opened launchpad UI showing a 4x4 grid of applications icon, with napari appearing in the bottom right corner.](../../_static/images/bundle_13.png) ```{note} The first time you open napari you must use the Launchpad, but in subsequent uses, the napari application should show up in Spotlight search ( + spacebar). The application shortcut will also be available in Finder, under 🏠 [User directory] > Applications. @@ -93,27 +93,27 @@ Next check out our [tutorial on the viewer](viewer.md) or explore any of the pag Once you have downloaded the Windows executable file, you will have a file with a name like `napari-0.5.0-Windows-x86_64.exe`. Double click this file to open the napari Setup. -![Montage of the napari EXE installer icon with an arrow pointing to the Welcome page of the napari EXE installer on Windows.](../assets/tutorials/installation/bundle_17.png) +![Montage of the napari EXE installer icon with an arrow pointing to the Welcome page of the napari EXE installer on Windows.](../../_static/images/bundle_17.png) Click Next to continue and go to the License page. Read the contents and, if you agree, continue by clicking 'I Agree'. -![Cropped screenshot of the License Agreement page of the napari EXE installer. A scrollable text area displays the legal text. Three buttons are available: Back, I Agree, and Cancel.](../assets/tutorials/installation/bundle_18.png) +![Cropped screenshot of the License Agreement page of the napari EXE installer. A scrollable text area displays the legal text. Three buttons are available: Back, I Agree, and Cancel.](../../_static/images/bundle_18.png) The recommended installation method is to install napari just for the current user ("Just Me"): -![Cropped screenshot of the Setup Instalation Type page of the napari EXE installer. Two options are available: Just Me (recommended), and All Users (requires admin privileges). At the bottom, three buttons Back, Next and Cancel are displayed.](../assets/tutorials/installation/bundle_19.png) +![Cropped screenshot of the Setup Instalation Type page of the napari EXE installer. Two options are available: Just Me (recommended), and All Users (requires admin privileges). At the bottom, three buttons Back, Next and Cancel are displayed.](../../_static/images/bundle_19.png) On the next page you will be shown how much space will be used by the installation and the default destination folder, which can be changed by using the 'Browse' button. Click 'Next' to continue. -![Cropped screenshot of the Choose Install Location page of the napari EXE installer. A text field next to a Browse button shows the default installation path. Additional text below reports the required space for the installation (2.6 GB) and the total space available on disk (61.1 GB). The three buttons at the bottom read Back, Next and Cancel.](../assets/tutorials/installation/bundle_20.png) +![Cropped screenshot of the Choose Install Location page of the napari EXE installer. A text field next to a Browse button shows the default installation path. Additional text below reports the required space for the installation (2.6 GB) and the total space available on disk (61.1 GB). The three buttons at the bottom read Back, Next and Cancel.](../../_static/images/bundle_20.png) On the next page, click 'Install' to start the installation process. Installation progress can be monitored on the following page. By clicking on 'Show details', you can obtain more information on the ongoing tasks. You can right-click on this new text area to copy the contents to the clipboard if needed. -![Cropped screenshot of the Installation process page of the napari EXE installer. A progress bar at around 95% reads "Setting up the package cache...". A button with the text "Show details" is available below. At the bottom of the dialog, three grayed out buttons read Back, Next, and Cancel.](../assets/tutorials/installation/bundle_22.png) +![Cropped screenshot of the Installation process page of the napari EXE installer. A progress bar at around 95% reads "Setting up the package cache...". A button with the text "Show details" is available below. At the bottom of the dialog, three grayed out buttons read Back, Next, and Cancel.](../../_static/images/bundle_22.png) Once installation is complete, you will see the page below. Click 'Finish' to close the installation wizard. -![Cropped screenshot of the final page of the napari EXE installer. It reports that the installation has finished successfully and that the dialog can be closed by clicking on the Finish button at the bottom.](../assets/tutorials/installation/bundle_24.png) +![Cropped screenshot of the final page of the napari EXE installer. It reports that the installation has finished successfully and that the dialog can be closed by clicking on the Finish button at the bottom.](../../_static/images/bundle_24.png) You can now get started using napari! A shortcut to launch napari can be found in the Windows Start menu. @@ -125,31 +125,31 @@ Next check out our [tutorial on the viewer](viewer.md) or explore any of the pag Once you have downloaded the Linux SH file, you will have a file with a name like `napari-0.5.0-Linux-x86_64.sh`. Open a new terminal window, navigate to the downloads folder (usually `cd ~/Downloads`) and run the command `bash napari-*-Linux-x86_64.sh`. -![Montage of the SH installer icon on Ubuntu, with an arrow pointing to an open terminal instance with a pre-typed command that reads 'bash napari-0.4.14.dev73-Linux-x86_64.sh'.](../assets/tutorials/installation/bundle_28.png) +![Montage of the SH installer icon on Ubuntu, with an arrow pointing to an open terminal instance with a pre-typed command that reads 'bash napari-0.4.14.dev73-Linux-x86_64.sh'.](../../_static/images/bundle_28.png) Press Enter to display the License Agreement. -![Cropped screenshot of the default Ubuntu terminal displaying the welcome paragraphs of the text-based installer of napari for Linux systems.](../assets/tutorials/installation/bundle_29.png) +![Cropped screenshot of the default Ubuntu terminal displaying the welcome paragraphs of the text-based installer of napari for Linux systems.](../../_static/images/bundle_29.png) Read through the agreement shown below. You must agree to the terms by typing out `yes` and pressing Enter to continue. -![Cropped screenshot of the default Ubuntu terminal displaying the first paragraphs of a BSD-3 Clause License text.](../assets/tutorials/installation/bundle_30.png) +![Cropped screenshot of the default Ubuntu terminal displaying the first paragraphs of a BSD-3 Clause License text.](../../_static/images/bundle_30.png) -![Cropped screenshot of the default Ubuntu terminal displaying the last paragraphs of a BSD-3 Clause License text, plus a prompt asking 'Do you accept the license terms?', to which the user must respond 'yes' or 'no'.](../assets/tutorials/installation/bundle_31.png) +![Cropped screenshot of the default Ubuntu terminal displaying the last paragraphs of a BSD-3 Clause License text, plus a prompt asking 'Do you accept the license terms?', to which the user must respond 'yes' or 'no'.](../../_static/images/bundle_31.png) Next you will be shown the default location for the installation. You may confirm this location by pressing Enter. Alternatively, specify a different location by typing out its absolute path. If it does not exist, it will be created. The terminal will then begin the installation process. -![Montage of two instances of the default Ubuntu terminal showing the default installation path, followed by the first extraction steps of the installation process.](../assets/tutorials/installation/bundle_32.png) +![Montage of two instances of the default Ubuntu terminal showing the default installation path, followed by the first extraction steps of the installation process.](../../_static/images/bundle_32.png) If the installation is successful, the terminal will display a message with the text 'Installation finished'. -![Cropped screenshot of the default Ubuntu terminal displaying the last steps of the installation process. The last line of text reads 'installation finished'.](../assets/tutorials/installation/bundle_33.png) +![Cropped screenshot of the default Ubuntu terminal displaying the last steps of the installation process. The last line of text reads 'installation finished'.](../../_static/images/bundle_33.png) You can now get started using napari! A shortcut to launch napari should appear on your desktop or application menu. Under some Linux desktop environments, you can also search for 'napari' using the desktop search bar. -![Full screenshot of the application menu in the Ubuntu desktop environment. A 6x4 grid of application icons includes the napari icon on the third row, third column, highlighted with a red circle.](../assets/tutorials/installation/bundle_34.png) +![Full screenshot of the application menu in the Ubuntu desktop environment. A 6x4 grid of application icons includes the napari icon on the third row, third column, highlighted with a red circle.](../../_static/images/bundle_34.png) -![Full screenshot of the Ubuntu search menu, with the query 'napari', displaying some results which include the application icon for the installed napari.](../assets/tutorials/installation/bundle_35.png) +![Full screenshot of the Ubuntu search menu, with the query 'napari', displaying some results which include the application icon for the installed napari.](../../_static/images/bundle_35.png) napari comes installed with sample images from scikit-image. Use the dropdown menu File > Open Sample > napari to open a sample image, or open one of your own images using File > Open or dragging and dropping your image onto the canvas. diff --git a/docs/tutorials/fundamentals/quick_start.md b/docs/tutorials/fundamentals/quick_start.md index 0050923b4..671e07524 100644 --- a/docs/tutorials/fundamentals/quick_start.md +++ b/docs/tutorials/fundamentals/quick_start.md @@ -109,7 +109,7 @@ For demo purpose, we will use a sample image that comes with napari. (1) Open napari IPython console -![IPython console](../../images/IPython.png) +![IPython console](../../_static/images/IPython.png) (2) Type @@ -206,7 +206,7 @@ viewer.close_all() ### Next steps - napari provides the flexibility to handle multi-dimensional data. Try opening 3D or higher dimensional images, and switch to 3D view. -![ndisplay](../../images/ndisplay.png) +![ndisplay](../../_static/images/ndisplay.png) - Test some [examples](https://github.com/napari/napari/tree/main/examples) to see how to add different layer types and add your own widgets to napari. diff --git a/docs/tutorials/fundamentals/viewer.md b/docs/tutorials/fundamentals/viewer.md index 0210fb21b..43aeba64c 100644 --- a/docs/tutorials/fundamentals/viewer.md +++ b/docs/tutorials/fundamentals/viewer.md @@ -100,7 +100,7 @@ The viewer is organized into a few key areas which are explained in the next sec The image below has the areas of the viewer labeled: -![image: viewer layout](../assets/tutorials/Viewer-with-arrows.png) +![image: viewer layout](../../_static/images/Viewer-with-arrows.png) We'll go through each of these in the next sections. @@ -347,7 +347,7 @@ Below the **layer list** is a row containing these buttons: * Grid display * Home -![image: Viewer buttons](../assets/tutorials/viewer-buttons.png) +![image: Viewer buttons](../../_static/images/viewer-buttons.png) Each one is explained below. @@ -362,7 +362,7 @@ The console (when available) appears at the bottom of the viewer as shown below: +++ -![image: console within napari](../assets/tutorials/console.png) +![image: console within napari](../../_static/images/console.png) +++ @@ -389,7 +389,7 @@ viewer.add_labels(labeled, name='blob ID') then, by clicking the 2D/3D button, you can switch to viewing the 3D rendering. Note that the icon will change to the following, to indicate 3D mode: -![image: 3D_button](../assets/tutorials/3D_button.png) +![image: 3D_button](../../_static/images/3D-button.png) This mode can be entered programmatically using: ```python @@ -427,7 +427,7 @@ will then show you the `ZY` slice. You can also right-click this button to pop-u a widget that allows you to re-order the dimensions by drag-and-drop or lock a dimension, by clicking on the padlock icon: -![image: roll dimensions widget with padlock icons](../assets/tutorials/dims_roll_lock_widget.png){ w=200px } +![image: roll dimensions widget with padlock icons](../../_static/images/dims_roll_lock_widget.png){ w=200px } Locking prevents a dimension from being rolled (reordered). This can be particularly useful, for example, with a `3D+time` dataset where you may want to fix the time dimension, diff --git a/docs/tutorials/processing/dask.md b/docs/tutorials/processing/dask.md index f5318418b..92b57c1d3 100644 --- a/docs/tutorials/processing/dask.md +++ b/docs/tutorials/processing/dask.md @@ -91,7 +91,7 @@ stack.shape # (nfiles, nz, ny, nx) stack ``` -![HTML representation of a Dask array as seen in Jupyter notebook. The image is split into two main regions: a table showing the bytes, shape, count and data type attributes of the array and of each chunk, and a visual representation of the shape of the chunks that make up the array (a rectangle of 1200x1) and each individual chunk (a 65*256*256 cube).](../assets/tutorials/dask_repr.png) +![HTML representation of a Dask array as seen in Jupyter notebook. The image is split into two main regions: a table showing the bytes, shape, count and data type attributes of the array and of each chunk, and a visual representation of the shape of the chunks that make up the array (a rectangle of 1200x1) and each individual chunk (a 65*256*256 cube).](../../_static/images/dask_repr.png) *No data has been read from disk yet!* diff --git a/docs/tutorials/segmentation/annotate_segmentation.md b/docs/tutorials/segmentation/annotate_segmentation.md index 2aae181fb..2a225170e 100644 --- a/docs/tutorials/segmentation/annotate_segmentation.md +++ b/docs/tutorials/segmentation/annotate_segmentation.md @@ -2,7 +2,7 @@ In this tutorial, we will use napari to view and annotate a segmentation with bounding boxes and text labels. Here we perform a segmentation by setting an intensity threshold with Otsu's method, but this same approach could also be used to visualize the results of other image processing algorithms such as [object detection with neural networks](https://www.tensorflow.org/lite/examples/object_detection/overview). -![napari viewer showing eight roughly circular shapes. The shapes are classified according to circularity and have bounding boxes automatically generated around them showing a circularity parameter and an integer for a label.](../assets/tutorials/annotated_bbox.png) +![napari viewer showing eight roughly circular shapes. The shapes are classified according to circularity and have bounding boxes automatically generated around them showing a circularity parameter and an integer for a label.](../../_static/images/annotated_bbox.png) The completed code is shown below and also can be found in the napari examples directory ([`annotate_segmentation_with_text.py`](https://github.com/napari/napari/blob/main/examples/annotate_segmentation_with_text.py)). @@ -186,7 +186,7 @@ label_layer = viewer.add_labels(label_image, name='segmentation') napari.run() ``` -![napari viewer showing eight roughly circular shapes, each colored differently. In the left sidebar, the segmentation layer is highlighted.](../assets/tutorials/segmentation_labels.png) +![napari viewer showing eight roughly circular shapes, each colored differently. In the left sidebar, the segmentation layer is highlighted.](../../_static/images/segmentation_labels.png) ## Analyzing the segmentation @@ -315,7 +315,7 @@ Next, we will use the Shapes layer to overlay the bounding boxes for each detect ) ``` -![napari viewer showing eight roughly circular shapes, each colored differently. Each shape has a bounding box automatically generated around it.](../assets/tutorials/segmentation_bbox.png) +![napari viewer showing eight roughly circular shapes, each colored differently. Each shape has a bounding box automatically generated around it.](../../_static/images/segmentation_bbox.png) The first positional argument (`bbox_rects`) contains the bounding boxes we created above. We specified that the face of each bounding box has no color (`face_color='transparent'`) and the edges of the bounding box are green (`edge_color='green'`). Finally, the name of the layer displayed in the layer list in the napari GUI is `bounding box` (`name='bounding box'`). @@ -405,4 +405,4 @@ napari.run() ## Summary In this tutorial, we have used napari to view and annotate segmentation results. -![napari viewer showing eight roughly circular shapes. The shapes are classified according to circularity and have bounding boxes automatically generated around them showing a circularity parameter and an integer for a label.](../assets/tutorials/annotated_bbox.png) +![napari viewer showing eight roughly circular shapes. The shapes are classified according to circularity and have bounding boxes automatically generated around them showing a circularity parameter and an integer for a label.](../../_static/images/annotated_bbox.png) diff --git a/docs/tutorials/tracking/cell_tracking.md b/docs/tutorials/tracking/cell_tracking.md index 6706f7608..e6df01d54 100644 --- a/docs/tutorials/tracking/cell_tracking.md +++ b/docs/tutorials/tracking/cell_tracking.md @@ -238,7 +238,7 @@ viewer.add_tracks(data, features=features, graph=graph) napari.run() ``` -![napari viewer with three layers: an image layer with cells, a points layer with detected cells and a tracks layer with the btrack results. The dimension slider under the canvas is close to the end of the stack, showing the tracks corresponding to each point colored by generation.](../assets/tutorials/tracks_btrack.png) +![napari viewer with three layers: an image layer with cells, a points layer with detected cells and a tracks layer with the btrack results. The dimension slider under the canvas is close to the end of the stack, showing the tracks corresponding to each point colored by generation.](../../_static/images/tracks_btrack.png) A notebook for this example can be found in the btrack examples directory ([`napari_btrack.ipynb`](https://github.com/quantumjot/BayesianTracker/blob/caa56fa82330e4b16b5d28150f9b60ed963165c7/examples/napari_btrack.ipynb)) From 033347161df321a853bcf19ca04db79b169d1c95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Weber=20Mendon=C3=A7a?= Date: Thu, 26 Sep 2024 20:43:25 -0300 Subject: [PATCH 2/8] Add note about questions in landing page (#498) # References and relevant issues Closes #66 # Description Adds a note about asking questions to the landing page to make it more visible. --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 87204600d..f4a44fccd 100644 --- a/docs/index.md +++ b/docs/index.md @@ -103,7 +103,7 @@ Get started with napari. :link: community :link-type: ref -Forums, web chat, video chat, and more! Join us! +Forums, web chat, video chat, where to ask questions and more! Join us! ::: :::{grid-item-card} Governance From 67391681da6140f4572a44e8b8ca809d2c375d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Althviz=20Mor=C3=A9?= <16781833+dalthviz@users.noreply.github.com> Date: Thu, 26 Sep 2024 19:24:23 -0500 Subject: [PATCH 3/8] Use `get_qapp` or `get_app_model` instead of `get_app` (#495) # References and relevant issues Part of https://github.com/napari/napari/issues/6054 # Description Use `get_qapp` instead of `get_app` (being deprecated over PR https://github.com/napari/napari/pull/7269) --------- Co-authored-by: Grzegorz Bokota --- docs/_scripts/update_preference_docs.py | 4 ++-- docs/conf.py | 2 +- docs/developers/architecture/app_model.md | 20 ++++++++++---------- docs/guides/event_loop.md | 2 +- docs/naps/8-telemetry.md | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/_scripts/update_preference_docs.py b/docs/_scripts/update_preference_docs.py index 086302320..ef60c7fef 100644 --- a/docs/_scripts/update_preference_docs.py +++ b/docs/_scripts/update_preference_docs.py @@ -6,7 +6,7 @@ from qtpy.QtWidgets import QMessageBox from napari._qt.dialogs.preferences_dialog import PreferencesDialog -from napari._qt.qt_event_loop import get_app +from napari._qt.qt_event_loop import get_qapp from napari._qt.qt_resources import get_stylesheet from napari.settings import NapariSettings @@ -99,7 +99,7 @@ def generate_images(): section of the docs. """ - app = get_app() + app = get_qapp() pref = PreferencesDialog() pref.setStyleSheet(get_stylesheet("dark")) pref.show() diff --git a/docs/conf.py b/docs/conf.py index db609c0ac..2647b4723 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -276,7 +276,7 @@ def napari_scraper(block, block_vars, gallery_conf): """ imgpath_iter = block_vars['image_path_iterator'] - if app := napari.qt.get_app(): + if app := napari.qt.get_qapp(): app.processEvents() else: return "" diff --git a/docs/developers/architecture/app_model.md b/docs/developers/architecture/app_model.md index 4f5cdb534..b03230e66 100644 --- a/docs/developers/architecture/app_model.md +++ b/docs/developers/architecture/app_model.md @@ -28,7 +28,7 @@ The {class}`~napari._app_model._app.NapariApplication` (`app`) is the top level object that stores information about the commands, keybindings and menus that make up the application. It is a subclass of {class}`app_model.Application` and is a global application -singleton. It can be retrieved with `napari._app_model.get_app`. +singleton. It can be retrieved with `napari._app_model.get_app_model`. Currently, the primary purpose of the `app` is to compose the following {mod}`app_model.registries` into a single name-spaced object: @@ -106,10 +106,10 @@ The code below shows how to register the `action` defined above with the napari singleton `app`: ```python -from napari._app_model import get_app +from napari._app_model import get_app_model -get_app().register_action(action) +get_app_model().register_action(action) ``` ````{note} @@ -395,7 +395,7 @@ current viewer, if one present (returning `None` if not). It is registered in the `app.injection_store` via `app.injection_store.register_provider`. Processors can be registered in the same way. ```python -from napari._app_model import get_app +from napari._app_model import get_app_model # return annotation indicates what this provider provides def provide_points() -> Optional['Points']: @@ -409,7 +409,7 @@ def provide_points() -> Optional['Points']: None ) -get_app().injection_store.register_provider(provide_points) +get_app_model().injection_store.register_provider(provide_points) ``` This allows both internal and external functions to be injected with these @@ -418,7 +418,7 @@ This is particularly important in a GUI context, where a user can't always be providing arguments: ```python ->>> injected_func = get_app().injection_store.inject(process_points) +>>> injected_func = get_app_model().injection_store.inject(process_points) ``` Note: injection doesn't *inherently* mean that it's always safe to call an @@ -502,11 +502,11 @@ On `napari` start up, `app-model` initialization occurs in the following order: 1. Initialize {class}`~napari.viewer.Viewer`, which calls `napari.plugins._initialize_plugins`, which registers discovered plugins and all their actions (non-Qt first, followed immedidately by Qt actions). - This also results in the first call to `napari._app_model.get_app`. + This also results in the first call to `napari._app_model.get_app_model`. i. Instantiation of the `app-model` app results in registration of all non-GUI internal `napari` actions (and associated submenus). Note that the - `napari._app_model.get_app` call creates the `app` only when *first* + `napari._app_model.get_app_model` call creates the `app` only when *first* called. It simply returns the existing app on all subsequent calls. 2. {class}`~napari._qt.qt_main_window.Window` instantiation, followed by @@ -532,8 +532,8 @@ singleton `app` may keep a reference to an object, e.g., a since been cleaned up at the end of a previous test. Thus, we mock the `app` in a `_mock_app` fixture, and explicitly use it in {ref}`make_napari_viewer` as well as in all tests that -use the `get_app` function. This way, a new instance of `app` is returned -every time `napari._app_model.get_app` +use the `get_app_model` function. This way, a new instance of `app` is returned +every time `napari._app_model.get_app_model` is used inside a test. This 'test' `app` is available for use throughout the test's duration and will get cleaned up at the end. diff --git a/docs/guides/event_loop.md b/docs/guides/event_loop.md index bfb646c87..1d325b72e 100644 --- a/docs/guides/event_loop.md +++ b/docs/guides/event_loop.md @@ -139,7 +139,7 @@ If you would like to create your own widgets in napari see {ref}`creating-widget ### napari's `QApplication` In napari, the initial step of creating the `QApplication` is handled by -{func}`napari.qt.get_app`. (Note however, that napari will do this for you +{func}`napari.qt.get_qapp`. (Note however, that napari will do this for you automatically behind the scenes when you create a viewer with {class}`napari.Viewer()`) diff --git a/docs/naps/8-telemetry.md b/docs/naps/8-telemetry.md index f87db52ee..998230376 100644 --- a/docs/naps/8-telemetry.md +++ b/docs/naps/8-telemetry.md @@ -190,7 +190,7 @@ from npe2 import plugin_manager from napari.utils.info import _sys_name from napari.plugins.npe2api import plugin_summaries from napari.plugins.utils import normalized_name -from napari._app_model import get_app +from napari._app_model import get_app_model def get_computer_identifier(): @@ -353,7 +353,7 @@ def get_full_information(): data_collector = DataSizeTypeCollector.get_collector( Path(appdirs.user_config_dir("napari")) / "data_size_info.json" ) - # app_model = get_app() - there is a need to add a collection of data to app_model + # app_model = get_app_model() - there is a need to add a collection of data to app_model return { **middle_info, "data_size_info": data_collector.data, From 2a7e0239aadf8443d1ccdb08c9e39e17579248df Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Fri, 27 Sep 2024 11:08:08 +1000 Subject: [PATCH 4/8] Add 0.5.4 release notes (#496) --- docs/_toc.yml | 1 + docs/release/release_0_5_4.md | 139 ++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 docs/release/release_0_5_4.md diff --git a/docs/_toc.yml b/docs/_toc.yml index 7fbe59b01..def47b479 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -78,6 +78,7 @@ subtrees: - file: release/index subtrees: - entries: + - file: release/release_0_5_4 - file: release/release_0_5_3 - file: release/release_0_5_2 - file: release/release_0_5_1 diff --git a/docs/release/release_0_5_4.md b/docs/release/release_0_5_4.md new file mode 100644 index 000000000..8813cbc97 --- /dev/null +++ b/docs/release/release_0_5_4.md @@ -0,0 +1,139 @@ +# napari 0.5.4 + +*Friday, Sep 27, 2024* + +We’re happy to announce the release of napari 0.5.4! + +napari is a fast, interactive, multi-dimensional image viewer for Python. It’s designed for exploring, annotating, and analyzing multi-dimensional images. It’s built on Qt (for the GUI), VisPy (for performant GPU-based rendering), and the scientific Python stack (NumPy, SciPy, and friends). + +For more information, examples, and documentation, please visit our website: https://napari.org/ + +## Highlights + +Another release with a lot of bug fixes, but also some (more!) improvements to +Shapes layer performance ([#7144](https://github.com/napari/napari/pull/7144), +[#7256](https://github.com/napari/napari/pull/7256)), and a few nice +usability/quality of life features! + +- you can now follow the value under the cursor around in images in 3D view as + well as 2D ([#7126](https://github.com/napari/napari/pull/7126)) +- Use standard keyboard shortcuts to zoom in and out ({kbd}`Command/Ctrl+=`, + {kbd}`Command/Ctrl+-`) and to zoom-to-fit ({kbd}`Command/Ctrl+0`) + ([#7200](https://github.com/napari/napari/pull/7200)) +- you can now save tiff files larger than 4GB + ([#7242](https://github.com/napari/napari/pull/7242)) + +Finally, we're starting some work on tweaking the UI to make it more +self-consistent, with the ultimate goal of adding functionality such as showing +common controls when multiple layers are selected, so that, for example, you +can select multiple layers and adjust all their opacity settings together. As +the first step for this, the *layer blending* controls have been moved directly +under the opacity control, so that all per-layer controls are next to each +other in the UI ([#7202](https://github.com/napari/napari/pull/7202)) + +Read on for all the changes in this version! + + +## New Features + +- enable get_value_3d for image layers ([#7126](https://github.com/napari/napari/pull/7126)) +- Preserve area of dock widgets between sessions ([#7247](https://github.com/napari/napari/pull/7247)) + +## Improvements + +- Speed up `get_status` for Shapes layer by using bounding boxes ([#7144](https://github.com/napari/napari/pull/7144)) +- Enh: Add zoom options and keybindings to View menu ([#7200](https://github.com/napari/napari/pull/7200)) +- [ux/ui] Put blending controls under opacity slider in layer controls ([#7202](https://github.com/napari/napari/pull/7202)) +- Enable conflicts detection with layer keybindings when changing viewer ones and add group info to conflicts popup ([#7231](https://github.com/napari/napari/pull/7231)) +- Speedup `_is_convex` by avoid calling `np.roll` ([#7256](https://github.com/napari/napari/pull/7256)) +- Sort plugin manifests in alphabetical order for registration ([#7266](https://github.com/napari/napari/pull/7266)) + +## Performance + +- Speed up `get_status` for Shapes layer by using bounding boxes ([#7144](https://github.com/napari/napari/pull/7144)) +- Speedup `_is_convex` by avoid calling `np.roll` ([#7256](https://github.com/napari/napari/pull/7256)) + +## Bug Fixes + +- start/stop status thread on show/hide main window ([#7240](https://github.com/napari/napari/pull/7240)) +- Added support for saving tiff files > 4GB :) ([#7242](https://github.com/napari/napari/pull/7242)) +- Accept any Mapping as output of a plugin widget ([#7250](https://github.com/napari/napari/pull/7250)) +- Eliminate nearly all Qt widget leaks by using qtbot ([#7251](https://github.com/napari/napari/pull/7251)) +- Enforce minimum side length when guessing if image is RGB ([#7273](https://github.com/napari/napari/pull/7273)) +- Fix color shuffling for bool labels ([#7294](https://github.com/napari/napari/pull/7294)) +- Fix cursor dimensionality race condition ([#7295](https://github.com/napari/napari/pull/7295)) +- Fix overflow error in shuffle colormap for signed integer labels ([#7296](https://github.com/napari/napari/pull/7296)) + +## Documentation + +- Add beanli161514 to citation file ([#7272](https://github.com/napari/napari/pull/7272)) +- Doc/metadata: add jni's ORCID to the CITATION.cff file ([#7275](https://github.com/napari/napari/pull/7275)) +- Style fix: use recommended capitalization for "GitHub" in README ([#7284](https://github.com/napari/napari/pull/7284)) +- Add psygnal and pydantic to napari --info ([#7285](https://github.com/napari/napari/pull/7285)) +- Move images to _static folder ([docs#483](https://github.com/napari/docs/pull/483)) +- Update version switcher to add 0.5.3 ([docs#488](https://github.com/napari/docs/pull/488)) +- Move release notes to be under Usage ([docs#489](https://github.com/napari/docs/pull/489)) +- Update release guide ([docs#491](https://github.com/napari/docs/pull/491)) +- Use `get_qapp` or `get_app_model` instead of `get_app` ([docs#495](https://github.com/napari/docs/pull/495)) +- Add 0.5.4 release notes ([docs#496](https://github.com/napari/docs/pull/496)) +- Add note about questions in landing page ([docs#498](https://github.com/napari/docs/pull/498)) + +## Other Pull Requests + +- Update script for vendored modules ([#5779](https://github.com/napari/napari/pull/5779)) +- Update `certifi`, `dask`, `hypothesis`, `ipython`, `numpy`, `qtconsole`, `rich`, `scipy`, `tifffile` ([#7212](https://github.com/napari/napari/pull/7212)) +- Block zarr 3.0.0a1 and 3.0.0a2 in pre-release tests ([#7217](https://github.com/napari/napari/pull/7217)) +- Add autouse fixture that clears cached property `Action.injected` ([#7224](https://github.com/napari/napari/pull/7224)) +- Update `tifffile` ([#7235](https://github.com/napari/napari/pull/7235)) +- CI benchmark run comment will now include results table ([#7237](https://github.com/napari/napari/pull/7237)) +- [pre-commit.ci] pre-commit autoupdate ([#7239](https://github.com/napari/napari/pull/7239)) +- Fix coverage and debug artifacts upload ([#7241](https://github.com/napari/napari/pull/7241)) +- Replaced broken link to the "Translations" page :) ([#7243](https://github.com/napari/napari/pull/7243)) +- Alow to call benchmark that do not have params ([#7252](https://github.com/napari/napari/pull/7252)) +- Block zarr=3.0.0a3 to fix pre-release tests ([#7254](https://github.com/napari/napari/pull/7254)) +- Change type of layer Metadata from dict to Mapping ([#7257](https://github.com/napari/napari/pull/7257)) +- Update `fsspec`, `hypothesis`, `pydantic`, `tensorstore`, `virtualenv`, `zarr` ([#7258](https://github.com/napari/napari/pull/7258)) +- Deprecate usage of `get_app` functions to get `QApplication` or `NapariApplication` instances ([#7269](https://github.com/napari/napari/pull/7269)) +- Block `zarr==3.0.0a4` ([#7271](https://github.com/napari/napari/pull/7271)) +- Update `dask`, `hypothesis`, `napari-plugin-manager`, `pandas`, `pydantic`, `pytest`, `rich`, `tifffile`, `virtualenv`, `xarray` ([#7274](https://github.com/napari/napari/pull/7274)) +- [pre-commit.ci] pre-commit autoupdate ([#7276](https://github.com/napari/napari/pull/7276)) +- Fix `test_windows_grouping_overwrite` skip condition and asserts ([#7281](https://github.com/napari/napari/pull/7281)) +- Update menu sorting tests still using `mock_app` and `get_app` instead of `mock_app_model` and `get_app_model` ([#7283](https://github.com/napari/napari/pull/7283)) +- Remove obsolete self from layout argument ([#7291](https://github.com/napari/napari/pull/7291)) + + +## 11 authors added to this release (alphabetical) + +(+) denotes first-time contributors 🥳 + +- [BeanLi](https://github.com/napari/napari/commits?author=beanli161514) - @beanli161514 +- [Daniel Althviz Moré](https://github.com/napari/napari/commits?author=dalthviz) ([docs](https://github.com/napari/docs/commits?author=dalthviz)) - @dalthviz +- [Draga Doncila Pop](https://github.com/napari/napari/commits?author=DragaDoncila) - @DragaDoncila +- [Grzegorz Bokota](https://github.com/napari/napari/commits?author=Czaki) - @Czaki +- [Ikko Eltociear Ashimine](https://github.com/napari/napari/commits?author=eltociear) - @eltociear + +- [Juan Nunez-Iglesias](https://github.com/napari/napari/commits?author=jni) ([docs](https://github.com/napari/docs/commits?author=jni)) - @jni +- [Lorenzo Gaifas](https://github.com/napari/napari/commits?author=brisvag) - @brisvag +- [Lucy Liu](https://github.com/napari/napari/commits?author=lucyleeow) - @lucyleeow +- [Melissa Weber Mendonça](https://github.com/napari/docs/commits?author=melissawm) - @melissawm +- [Peter Sobolewski](https://github.com/napari/napari/commits?author=psobolewskiPhD) - @psobolewskiPhD +- [Sammy Hansali](https://github.com/napari/napari/commits?author=sammyhansali) - @sammyhansali + + + +## 13 reviewers added to this release (alphabetical) + +(+) denotes first-time contributors 🥳 + +- [andrew sweet](https://github.com/napari/docs/commits?author=andy-sweet) - @andy-sweet +- [Ashley Anderson](https://github.com/napari/docs/commits?author=aganders3) - @aganders3 +- [Daniel Althviz Moré](https://github.com/napari/napari/commits?author=dalthviz) ([docs](https://github.com/napari/docs/commits?author=dalthviz)) - @dalthviz +- [Draga Doncila Pop](https://github.com/napari/napari/commits?author=DragaDoncila) - @DragaDoncila +- [Grzegorz Bokota](https://github.com/napari/napari/commits?author=Czaki) - @Czaki +- [jaime rodriguez-guerra](https://github.com/napari/docs/commits?author=jaimergp) - @jaimergp +- [Juan Nunez-Iglesias](https://github.com/napari/napari/commits?author=jni) ([docs](https://github.com/napari/docs/commits?author=jni)) - @jni +- [kyle i. s. harrington](https://github.com/napari/docs/commits?author=kephale) - @kephale +- [Lorenzo Gaifas](https://github.com/napari/napari/commits?author=brisvag) - @brisvag +- [Lucy Liu](https://github.com/napari/napari/commits?author=lucyleeow) - @lucyleeow +- [Melissa Weber Mendonça](https://github.com/napari/docs/commits?author=melissawm) - @melissawm +- [Peter Sobolewski](https://github.com/napari/napari/commits?author=psobolewskiPhD) - @psobolewskiPhD +- [Wouter-Michiel Vierdag](https://github.com/napari/docs/commits?author=melonora) - @melonora + From a85389e9078f77f05a3e5a1db71d83409b210a22 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Mon, 30 Sep 2024 17:09:49 +1000 Subject: [PATCH 5/8] Add further fixes to release notes (#499) --- docs/release/release_0_5_4.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/release/release_0_5_4.md b/docs/release/release_0_5_4.md index 8813cbc97..e86612fb3 100644 --- a/docs/release/release_0_5_4.md +++ b/docs/release/release_0_5_4.md @@ -1,6 +1,6 @@ # napari 0.5.4 -*Friday, Sep 27, 2024* +*Monday, Sep 30, 2024* We’re happy to announce the release of napari 0.5.4! @@ -60,9 +60,11 @@ Read on for all the changes in this version! - Accept any Mapping as output of a plugin widget ([#7250](https://github.com/napari/napari/pull/7250)) - Eliminate nearly all Qt widget leaks by using qtbot ([#7251](https://github.com/napari/napari/pull/7251)) - Enforce minimum side length when guessing if image is RGB ([#7273](https://github.com/napari/napari/pull/7273)) +- Remove skip conditions for PySide2/6 over plugins menu tests and bump `napari-plugin-manager` minimum version (>=0.1.3) ([#7293](https://github.com/napari/napari/pull/7293)) - Fix color shuffling for bool labels ([#7294](https://github.com/napari/napari/pull/7294)) - Fix cursor dimensionality race condition ([#7295](https://github.com/napari/napari/pull/7295)) - Fix overflow error in shuffle colormap for signed integer labels ([#7296](https://github.com/napari/napari/pull/7296)) +- When calculating view directions, check ndim, not just ndisplay ([#7301](https://github.com/napari/napari/pull/7301)) ## Documentation @@ -77,6 +79,7 @@ Read on for all the changes in this version! - Use `get_qapp` or `get_app_model` instead of `get_app` ([docs#495](https://github.com/napari/docs/pull/495)) - Add 0.5.4 release notes ([docs#496](https://github.com/napari/docs/pull/496)) - Add note about questions in landing page ([docs#498](https://github.com/napari/docs/pull/498)) +- Add further fixes to release notes ([docs#499](Add further fixes to release notes)) ## Other Pull Requests From 918fb72dac406e5f243b34181466a1e3cc6924a8 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Tue, 8 Oct 2024 11:56:38 +1100 Subject: [PATCH 6/8] Add 0.5.4 to the version switcher (#500) --- docs/_static/version_switcher.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/_static/version_switcher.json b/docs/_static/version_switcher.json index ce675ef7f..b6372bbf6 100644 --- a/docs/_static/version_switcher.json +++ b/docs/_static/version_switcher.json @@ -5,11 +5,16 @@ "url": "https://napari.org/dev/" }, { - "name": "stable (0.5.3)", - "version": "0.5.3", + "name": "stable (0.5.4)", + "version": "0.5.4", "preferred": true, "url": "https://napari.org/stable/" }, + { + "name": "0.5.3", + "version": "0.5.3", + "url": "https://napari.org/0.5.3/" + }, { "name": "0.5.2", "version": "0.5.2", From 4043d7fda515b0f19de7868f15525b60d826251c Mon Sep 17 00:00:00 2001 From: jaimergp Date: Fri, 18 Oct 2024 16:33:24 +0200 Subject: [PATCH 7/8] Document the SPEC-0 rule for bundled Python (#501) # Description Document the decision of using SPEC-0 to dictate which Python version should be bundled in each installer release. See https://github.com/napari/packaging/pull/189 and https://napari.zulipchat.com/#narrow/channel/309872-plugins/topic/Bundled.20Python.20will.20be.20bumped.20to.203.2E11/near/476977691. --- docs/developers/coredev/packaging.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/developers/coredev/packaging.md b/docs/developers/coredev/packaging.md index 2451d8c9f..885300881 100644 --- a/docs/developers/coredev/packaging.md +++ b/docs/developers/coredev/packaging.md @@ -173,6 +173,10 @@ The main OS-agnostic keys are: Then, depending on the operating systems and the installer format, we customize the configuration a bit more. +The bundled Python version in the installers follows the Python version installed in the CI +`make_bundle_conda.yml` workflow at `napari/packaging`. Update the CI matrix configuration to bump +the bundled Python. We use the oldest version supported by the [SPEC-0][SPEC0] recommendations. + #### Default installation path This depends on each OS. Our general strategy is to put the general installation under @@ -259,3 +263,4 @@ Generating a `conda`-based installer requires several components in place: [21]: https://anaconda.org/conda-forge/napari [22]: https://github.com/conda/constructor/blob/764ba8a/constructor/nsis/_nsis.py [nap-2]: https://napari.org/dev/naps/2-conda-based-packaging.html +[SPEC0]: https://scientific-python.org/specs/spec-0000/ From 0bea5f0cc566cc5bd19fdf2e11a45b44356671e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Weber=20Mendon=C3=A7a?= Date: Tue, 22 Oct 2024 14:17:54 -0300 Subject: [PATCH 8/8] Add a release action (#23) * Add a release action This action will build and deploy docs for a new release, copying the built docs artifacts to both the dev and the {version} folders in napari.github.io. It will also update the stable symlink to point to the new version folder. This action will be triggered by a new release tag pushed to the repo or by manually trigerring the action with an input specifying the new version (any input different from the default dev will trigger the action.) * Fix release action execution condition * Add condition to filter out release candidates from release action * Add script to update version switcher * WIP: Testing on fork --- .circleci/config.yml | 4 +- .github/workflows/build_and_deploy.yml | 55 ++++++++++++++++++++++++-- docs/_scripts/update_switcher.py | 34 ++++++++++++++++ 3 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 docs/_scripts/update_switcher.py diff --git a/.circleci/config.yml b/.circleci/config.yml index f808dcd58..6500834e9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,12 +6,12 @@ version: 2.1 # Orbs are reusable packages of CircleCI configuration that you may share across projects. # See: https://circleci.com/docs/2.1/orb-intro/ orbs: - python: circleci/python@1.5.0 + python: circleci/python@2.1.1 jobs: build-docs: docker: # A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python - - image: cimg/python:3.10.13 + - image: cimg/python:3.10 steps: - checkout: path: docs diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index fdcfd13e1..1d33e83a1 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -69,11 +69,18 @@ jobs: python -c 'import napari.layers; print(napari.layers.__doc__)' - name: Create fallback videos + # Only needed for deployment, so should **NOT** be in + # napari/napari/.github/workflows/build_docs.yml run: | sudo apt-get update && sudo apt-get install -y ffmpeg cd docs make fallback-videos + - name: Update version switcher (on new tag) + if: ((github.event_name == 'release' && !contains(github.event.release.tag_name, 'rc')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev')) + run: | + python docs/_scripts/update_version_switcher.py ${{ github.event.inputs.target_directory || github.event.release.tag_name }} + - name: Build Docs uses: aganders3/headless-gui@v2 env: @@ -109,13 +116,55 @@ jobs: # Downloads to '/home/runner/work/docs/docs/html' path: html - - name: Deploy Docs + - name: Deploy Dev Docs if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && (startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/main')) uses: peaceiris/actions-gh-pages@v3 with: + # Note that GITHUB_TOKEN has no permission to access to external repositories. + # When you use deploy_key, set your private key to the repository which + # includes this action as a secret, and set your public key to your external repository. deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} - external_repository: napari/napari.github.io + external_repository: melissawm/napari.github.io publish_dir: ./html publish_branch: gh-pages destination_dir: ${{ github.event.inputs.target_directory || 'dev' }} - cname: napari.org + #cname: napari.org + keep_files: true + + # Because we are using two deploy actions, we need to reset the ssh-agent + # to avoid the following error: + # unix_listener: cannot bind to path /tmp/ssh-auth.sock: Address already in use + # See https://github.com/peaceiris/actions-gh-pages/issues/909 + - name: Reset ssh agent + if: ((github.event_name == 'release' && !contains(github.event.release.tag_name, 'rc')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev')) + run: killall ssh-agent + + # Because the actions-gh-pages triggers a pages deployment, it can be some + # time before the repo is updated. We need to wait for the deployment to + # complete before we can create a second deployment, or we will have a git + # conflict. The 5m sleep is completely arbitrary. + - name: Wait for first deployment + if: ((github.event_name == 'release' && !contains(github.event.release.tag_name, 'rc')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev')) + run: sleep 5m + + - name: Deploy Release Docs + if: ((github.event_name == 'release' && !contains(github.event.release.tag_name, 'rc')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev')) + uses: peaceiris/actions-gh-pages@v3 + with: + deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} + external_repository: melissawm/napari.github.io + publish_dir: ./html + publish_branch: gh-pages + destination_dir: ${{ github.event.inputs.target_directory || github.event.release.tag_name }} + #cname: napari.org + keep_files: true + + - name: Set up stable symlink + if: ((github.event_name == 'release' && !contains(github.event.release.tag_name, 'rc')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_directory != 'dev')) + uses: convictional/trigger-workflow-and-wait@v1.6.5 + with: + owner: melissawm + repo: napari.github.io + github_token: ${{ secrets.WORKFLOW_PAT }} + workflow_file_name: symlink-stable.yml + client_payload: '{"target_directory": "${{ github.event.inputs.target_directory || github.event.release.tag_name }}"}' diff --git a/docs/_scripts/update_switcher.py b/docs/_scripts/update_switcher.py new file mode 100644 index 000000000..b7d934ba6 --- /dev/null +++ b/docs/_scripts/update_switcher.py @@ -0,0 +1,34 @@ +import sys +import json + + +def update_version_switcher(new_version): + """Update version_switcher.json after a new release.""" + with open("docs/_static/version_switcher.json", "r") as f: + switcher = json.load(f) + oldstable = switcher[1] + + newstable = oldstable.copy() + newstable["version"] = new_version + newstable["name"] = f"stable ({new_version})" + + oldstable["name"] = f"{oldstable['version']}" + del oldstable["preferred"] + oldstable["url"] = oldstable["url"].replace("stable", oldstable["version"]) + + switcher[1] = oldstable + switcher.insert(1, newstable) + with open("docs/_static/version_switcher.json", "w") as f: + json.dump(switcher, f, indent=4) + + print(f"Version switcher updated to {new_version}") + print(f"Old stable version: {switcher[2]}") + print(f"New stable version: {switcher[1]}") + + +if __name__ == "__main__": + if len(sys.argv) != 2: + print("Usage: python update_switcher.py ") + sys.exit() + new_version = sys.argv[1] + update_version_switcher(new_version)