pyfigures 0.2.2__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. {pyfigures-0.2.2/pyfigures.egg-info → pyfigures-0.2.4}/PKG-INFO +4 -4
  2. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/categorized_mcp.py +16 -9
  3. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/existing_tools.py +44 -5
  4. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/figure_state.py +16 -3
  5. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/gui_selection.py +1 -1
  6. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/launch.py +2 -1
  7. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/live_mcp.py +19 -4
  8. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/partner_gui.py +30 -2
  9. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/session.py +111 -7
  10. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/annotation_editor.py +38 -12
  11. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/autolettering_widget.py +42 -1
  12. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/drag_sketch.py +23 -4
  13. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/editable_export.py +2 -0
  14. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/ezfig.py +143 -6
  15. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/pfgui.py +134 -4
  16. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/qc_reports.py +7 -0
  17. pyfigures-0.2.4/pyfigures/gui/row_letters.py +134 -0
  18. pyfigures-0.2.4/pyfigures/gui/show_me_where.py +353 -0
  19. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_control.py +5 -0
  20. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/annotations.py +138 -5
  21. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/content.py +1536 -1514
  22. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/core.py +18 -0
  23. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/export.py +73 -3
  24. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/qc.py +16 -5
  25. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/structure.py +9 -0
  26. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/workflow.py +3 -0
  27. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/recipe.py +20 -1
  28. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/version.py +1 -1
  29. {pyfigures-0.2.2 → pyfigures-0.2.4/pyfigures.egg-info}/PKG-INFO +4 -4
  30. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures.egg-info/SOURCES.txt +8 -0
  31. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures.egg-info/requires.txt +3 -3
  32. {pyfigures-0.2.2 → pyfigures-0.2.4}/setup.py +3 -3
  33. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_assistant_live.py +19 -2
  34. pyfigures-0.2.4/tests/test_channels_property_20261105.py +54 -0
  35. pyfigures-0.2.4/tests/test_editor_rotate_and_tool_20261105.py +84 -0
  36. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_gui_e2e_menus.py +8 -0
  37. pyfigures-0.2.4/tests/test_lut_remove_20261105.py +111 -0
  38. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_missing_images_gui.py +29 -0
  39. pyfigures-0.2.4/tests/test_row_letters_gui.py +414 -0
  40. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_self_test.py +6 -2
  41. pyfigures-0.2.4/tests/test_show_me_where_20261105.py +213 -0
  42. pyfigures-0.2.4/tests/test_uneven_rows_20261105.py +156 -0
  43. {pyfigures-0.2.2 → pyfigures-0.2.4}/LICENSE +0 -0
  44. {pyfigures-0.2.2 → pyfigures-0.2.4}/README.md +0 -0
  45. {pyfigures-0.2.2 → pyfigures-0.2.4}/images/__init__.py +0 -0
  46. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/__init__.py +0 -0
  47. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/__main__.py +0 -0
  48. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/album/__init__.py +0 -0
  49. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/album/__main__.py +0 -0
  50. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/arrowheads.py +0 -0
  51. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/__init__.py +0 -0
  52. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/advanced_annotations.py +0 -0
  53. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/assistant_actions.py +0 -0
  54. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/letter_sequence.py +0 -0
  55. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/live_structure.py +0 -0
  56. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/manual_help.py +0 -0
  57. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/manual_help_verified.json +0 -0
  58. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/native_gui.py +0 -0
  59. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/original_registry.py +0 -0
  60. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/plot_lifecycle.py +0 -0
  61. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/pointer_context.py +0 -0
  62. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/readability.py +0 -0
  63. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/recovery.py +0 -0
  64. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/result_evidence.py +0 -0
  65. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/assistant/submission_review.py +0 -0
  66. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/atomic_io.py +0 -0
  67. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/burned_text.py +0 -0
  68. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/colorbar_script.py +0 -0
  69. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/constant_panels.py +0 -0
  70. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/cvd.py +0 -0
  71. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/equations.py +0 -0
  72. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/extras.py +0 -0
  73. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/flip.py +0 -0
  74. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/__init__.py +0 -0
  75. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/about_dialog_pzf.py +0 -0
  76. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/asingleoraspanel.py +0 -0
  77. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/bg_color_selection.py +0 -0
  78. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/bug_recorder.py +0 -0
  79. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/caption_dialog.py +0 -0
  80. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/colorassistant.py +0 -0
  81. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/ctrl_key.py +0 -0
  82. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/deckcraft_blank.json +0 -0
  83. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/dimchooser.py +0 -0
  84. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/drop_sketch.py +0 -0
  85. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/editor_interaction.py +0 -0
  86. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/emptyimagedialog.py +0 -0
  87. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/equation_dialog.py +0 -0
  88. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/fonts/README.md +0 -0
  89. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/fontselectorgui.py +0 -0
  90. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/group_builder_GUI.py +0 -0
  91. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/headless_ops.py +0 -0
  92. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/integrity_ops.py +0 -0
  93. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/journal_style_editor.py +0 -0
  94. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/keep_tst_images_for_pzf.py +0 -0
  95. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/label_rows.py +0 -0
  96. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/latex_code_dialog.py +0 -0
  97. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/latex_support.py +0 -0
  98. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/lutmultiselector.py +0 -0
  99. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/mcp_server_dialog.py +0 -0
  100. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/pagelimitswidget.py +0 -0
  101. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/panelcreationwidget.py +0 -0
  102. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/pdf_support.py +0 -0
  103. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/portable_fonts.py +0 -0
  104. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/region_picker.py +0 -0
  105. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/render_headless.py +0 -0
  106. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/review/__init__.py +0 -0
  107. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/review/_template.py +0 -0
  108. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/review/dialog.py +0 -0
  109. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/review/html_export.py +0 -0
  110. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/review/send.py +0 -0
  111. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/scalebareditor.py +0 -0
  112. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/scrollableEZFIG.py +0 -0
  113. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/show_me_how.py +0 -0
  114. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/simple_text_editor.py +0 -0
  115. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/spaceselector.py +0 -0
  116. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/style_text_headless.py +0 -0
  117. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/svg_painter.py +0 -0
  118. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/textEditWatcher.py +0 -0
  119. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/theme.py +0 -0
  120. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/tipdialog.py +0 -0
  121. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/tutorial.py +0 -0
  122. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/user_extra_translation.py +0 -0
  123. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/user_prefs.py +0 -0
  124. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/video_support.py +0 -0
  125. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/widget_for_inset.py +0 -0
  126. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/gui/zoom_links.py +0 -0
  127. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/guides.py +0 -0
  128. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/history.py +0 -0
  129. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/icons/__init__.py +0 -0
  130. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/icons/pyfigures.png +0 -0
  131. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/icons/pyfigures_album.png +0 -0
  132. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/icons/pyfigures_poster.png +0 -0
  133. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/image_search.py +0 -0
  134. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/journal_styles.py +0 -0
  135. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/latex_document.py +0 -0
  136. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/layout_formula.py +0 -0
  137. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/layout_picture.py +0 -0
  138. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_server.py +0 -0
  139. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/__init__.py +0 -0
  140. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/app.py +0 -0
  141. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/guidance.py +0 -0
  142. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/image_search.py +0 -0
  143. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/journal.py +0 -0
  144. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/overlays.py +0 -0
  145. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/poster.py +0 -0
  146. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/stacks.py +0 -0
  147. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/mcp_tools/upkeep.py +0 -0
  148. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/office_math.py +0 -0
  149. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/offscreen.py +0 -0
  150. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/panel_source_preview.py +0 -0
  151. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/path_resolution.py +0 -0
  152. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/__init__.py +0 -0
  153. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/__main__.py +0 -0
  154. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/page_presets.py +0 -0
  155. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/poster_align.py +0 -0
  156. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/poster_canvas.py +0 -0
  157. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/poster_headless.py +0 -0
  158. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/poster_layout_dialog.py +0 -0
  159. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/poster_layouts.py +0 -0
  160. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/poster_recipe.py +0 -0
  161. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/poster_shapes.py +0 -0
  162. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/poster_source_data.py +0 -0
  163. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/poster_templates.py +0 -0
  164. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/poster_text_dialog.py +0 -0
  165. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/poster_web_export.py +0 -0
  166. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/poster_window.py +0 -0
  167. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/poster/serialization.py +0 -0
  168. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/qt_exit.py +0 -0
  169. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/script_helpers.py +0 -0
  170. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/self_test.py +0 -0
  171. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/source_snapshot.py +0 -0
  172. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/stack_info.py +0 -0
  173. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures/zoom_geometry.py +0 -0
  174. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures.egg-info/dependency_links.txt +0 -0
  175. {pyfigures-0.2.2 → pyfigures-0.2.4}/pyfigures.egg-info/top_level.txt +0 -0
  176. {pyfigures-0.2.2 → pyfigures-0.2.4}/setup.cfg +0 -0
  177. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_advanced_edit_tools.py +0 -0
  178. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_arrow_tip.py +0 -0
  179. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_arrowheads.py +0 -0
  180. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_atomic_io.py +0 -0
  181. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_audit_fixes.py +0 -0
  182. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_audit_fixes_20261008.py +0 -0
  183. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_backgrounds.py +0 -0
  184. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_bug_recorder.py +0 -0
  185. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_bugs_found_by_gui_e2e.py +0 -0
  186. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_canvas_context_menu.py +0 -0
  187. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_canvas_keyboard_and_clicks.py +0 -0
  188. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_codex_trial_findings.py +0 -0
  189. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_colour_bar_gui.py +0 -0
  190. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_consolidate_download.py +0 -0
  191. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_constant_panels.py +0 -0
  192. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_data_plots_and_stats.py +0 -0
  193. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_deserialization.py +0 -0
  194. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_dnd_canvas_more.py +0 -0
  195. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_dnd_combine_with_target.py +0 -0
  196. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_dnd_main_editor.py +0 -0
  197. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_draft_figure.py +0 -0
  198. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_drop_sketches.py +0 -0
  199. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_editable_export.py +0 -0
  200. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_editable_plot_text.py +0 -0
  201. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_editor_interaction.py +0 -0
  202. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_equations.py +0 -0
  203. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_exception_handler.py +0 -0
  204. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_export_waits_for_images.py +0 -0
  205. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_fig_rect_cache.py +0 -0
  206. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_figure_colors.py +0 -0
  207. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_figure_diff.py +0 -0
  208. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_fiji_formats.py +0 -0
  209. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_file_io_encoding.py +0 -0
  210. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_file_state_tracking.py +0 -0
  211. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_flip.py +0 -0
  212. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_folder_drag_and_drop.py +0 -0
  213. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_fonts_available.py +0 -0
  214. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_forbidden_files.py +0 -0
  215. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_gui_e2e_context_menu.py +0 -0
  216. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_gui_e2e_coverage.py +0 -0
  217. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_gui_e2e_dnd.py +0 -0
  218. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_gui_e2e_image_editor.py +0 -0
  219. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_gui_e2e_monkey.py +0 -0
  220. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_gui_e2e_tutorials.py +0 -0
  221. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_gui_e2e_visual.py +0 -0
  222. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_gui_menus_and_toolbar.py +0 -0
  223. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_gui_more_actions.py +0 -0
  224. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_gui_workflow_actions.py +0 -0
  225. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_guide_routing.py +0 -0
  226. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_image_opacity_reload.py +0 -0
  227. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_image_search.py +0 -0
  228. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_integrity_and_stats.py +0 -0
  229. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_interactive_tools.py +0 -0
  230. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_internal_dnd_group_placement.py +0 -0
  231. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_inverted_luts.py +0 -0
  232. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_journal_styles.py +0 -0
  233. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_latex_code.py +0 -0
  234. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_latex_documents.py +0 -0
  235. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_latex_extras.py +0 -0
  236. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_latex_full.py +0 -0
  237. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_latex_stress_findings.py +0 -0
  238. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_launchers.py +0 -0
  239. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_layout_canvas_geometry.py +0 -0
  240. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_layout_formula.py +0 -0
  241. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_layout_stability_gui.py +0 -0
  242. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_lazy_reflow.py +0 -0
  243. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_lettering_restore.py +0 -0
  244. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_licensing.py +0 -0
  245. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_lif_series_reading.py +0 -0
  246. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_llm_feedback_20261020.py +0 -0
  247. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_max_height.py +0 -0
  248. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_mcp_audit_findings.py +0 -0
  249. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_mcp_control.py +0 -0
  250. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_mcp_history.py +0 -0
  251. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_mcp_server.py +0 -0
  252. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_mcp_stdio_protocol.py +0 -0
  253. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_mcp_text_arguments.py +0 -0
  254. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_normalization.py +0 -0
  255. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_offscreen_env.py +0 -0
  256. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_ome_zarr.py +0 -0
  257. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_omero.py +0 -0
  258. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_open_perf.py +0 -0
  259. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_panel_editor.py +0 -0
  260. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_panel_editor_more.py +0 -0
  261. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_panel_preview.py +0 -0
  262. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_parity_mcp.py +0 -0
  263. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_path_resolution.py +0 -0
  264. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_pdf_panels.py +0 -0
  265. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_placeholder_grid.py +0 -0
  266. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_portability.py +0 -0
  267. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_poster_files_and_recipe.py +0 -0
  268. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_poster_gui.py +0 -0
  269. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_poster_mcp.py +0 -0
  270. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_poster_stress_findings.py +0 -0
  271. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_poster_vector_figures.py +0 -0
  272. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_property_setters_validate.py +0 -0
  273. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_pyf_loader_thread_deadlock.py +0 -0
  274. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_pyf_loading.py +0 -0
  275. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_pymupdf_offer.py +0 -0
  276. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_qc_gui.py +0 -0
  277. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_qc_mcp_tools.py +0 -0
  278. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_qc_reports.py +0 -0
  279. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_qt_exit.py +0 -0
  280. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_recipe.py +0 -0
  281. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_recipe_checks_bundles.py +0 -0
  282. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_recipe_extra_keys.py +0 -0
  283. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_recipe_for_llms.py +0 -0
  284. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_recipe_more_keys.py +0 -0
  285. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_recordings.py +0 -0
  286. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_render_export.py +0 -0
  287. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_restyle_texts.py +0 -0
  288. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_review_and_library.py +0 -0
  289. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_ruler_labels.py +0 -0
  290. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_save_reminder.py +0 -0
  291. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_scale_bar_calibration.py +0 -0
  292. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_scale_consistency.py +0 -0
  293. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_schema_sweep_findings.py +0 -0
  294. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_send_to_poster.py +0 -0
  295. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_shapes.py +0 -0
  296. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_show_me_how.py +0 -0
  297. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_source_data.py +0 -0
  298. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_stack_tools.py +0 -0
  299. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_stack_tools_gui.py +0 -0
  300. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_stack_with_image.py +0 -0
  301. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_stress_findings.py +0 -0
  302. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_stress_findings_20261028.py +0 -0
  303. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_stress_findings_20261029.py +0 -0
  304. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_style_audit_calbar.py +0 -0
  305. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_svg_clipping_and_pdf_pages.py +0 -0
  306. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_svg_empty_glyph.py +0 -0
  307. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_tex_install.py +0 -0
  308. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_text_editor_and_widgets.py +0 -0
  309. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_tutorial_controller.py +0 -0
  310. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_tutorials.py +0 -0
  311. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_typography_tidy.py +0 -0
  312. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_user_chat_findings_20261104.py +0 -0
  313. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_user_findings_20261022.py +0 -0
  314. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_user_gui_findings_20261021.py +0 -0
  315. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_user_guide_menus.py +0 -0
  316. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_video_support.py +0 -0
  317. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_zarr_stress_findings.py +0 -0
  318. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_zoom_callout_gui.py +0 -0
  319. {pyfigures-0.2.2 → pyfigures-0.2.4}/tests/test_zoom_callout_lut.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyfigures
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: PyFigures will assist you assemble publication ready scientific figures in no time.
5
5
  Home-page: https://github.com/baigouy/PyFigures
6
6
  Author: Benoit Aigouy
@@ -46,7 +46,7 @@ Requires-Dist: latex2mathml
46
46
  Requires-Dist: mathml2omml
47
47
  Requires-Dist: pylatexenc
48
48
  Requires-Dist: pypdfium2
49
- Requires-Dist: qtpy-ai-sidecar>=0.1.1
49
+ Requires-Dist: qtpy-ai-sidecar>=0.1.3
50
50
  Requires-Dist: mcp<2,>=1.12
51
51
  Provides-Extra: ai
52
52
  Requires-Dist: mcp<2,>=1.12; extra == "ai"
@@ -63,10 +63,10 @@ Provides-Extra: omero
63
63
  Requires-Dist: omero-py; extra == "omero"
64
64
  Provides-Extra: chat
65
65
  Requires-Dist: mcp<2,>=1.12; extra == "chat"
66
- Requires-Dist: qtpy-ai-sidecar>=0.1.1; extra == "chat"
66
+ Requires-Dist: qtpy-ai-sidecar>=0.1.3; extra == "chat"
67
67
  Provides-Extra: all
68
68
  Requires-Dist: mcp<2,>=1.12; extra == "all"
69
- Requires-Dist: qtpy-ai-sidecar>=0.1.1; extra == "all"
69
+ Requires-Dist: qtpy-ai-sidecar>=0.1.3; extra == "all"
70
70
  Requires-Dist: av; extra == "all"
71
71
  Requires-Dist: opencv-python-headless; extra == "all"
72
72
  Requires-Dist: pyimagej; extra == "all"
@@ -51,7 +51,7 @@ def category_for(name):
51
51
  return 'images'
52
52
  if name in ('open_annotation_editor', 'roi_to_inset'):
53
53
  return 'annotations'
54
- if name in ('list_how_to_guides', 'explain_how', 'show_me_how', 'guidance_status', 'close_guidance'):
54
+ if name in ('list_how_to_guides', 'explain_how', 'show_me_how', 'show_me_where', 'guidance_status', 'close_guidance'):
55
55
  return 'help'
56
56
  if 'scale_bar' in name:
57
57
  return 'scale_bars'
@@ -90,7 +90,7 @@ def build_server(full_server, send):
90
90
  from .original_registry import registry
91
91
  originals = set(registry())
92
92
  names = originals | {'arrange_live_images', 'set_panel_letter_position', 'edit_live_label',
93
- 'edit_panel_letters', 'inspect_panel_letters', 'swap_live_panels', 'swap_rows', 'select_live_objects', 'open_annotation_editor', 'roi_to_inset', 'preview_panel', 'explain_live_interaction', 'save_live_figure',
93
+ 'edit_panel_letters', 'inspect_panel_letters', 'swap_live_panels', 'swap_rows', 'select_live_objects', 'open_annotation_editor', 'show_me_where', 'roi_to_inset', 'preview_panel', 'explain_live_interaction', 'save_live_figure',
94
94
  'list_recovery_snapshots', 'restore_recovery_snapshot', 'remove_scale_bar_all', 'ungroup_all_images', 'delete_last_rows', 'reverse_selected_row'}
95
95
  names.discard('preview_panel_source') # the live preview_panel shows the open figure's panel
96
96
  names.update({'open_annotation_properties','inspect_annotation_objects','edit_annotation_properties','review_submission_readiness','inspect_native_gui','use_native_gui','open_native_menu','native_gui_keys','native_gui_gesture','native_gui_drop_files'})
@@ -129,8 +129,10 @@ def build_server(full_server, send):
129
129
  'A successful tool call is not task success. Report verified after-state; if counts show zero letters, '
130
130
  'say letters are absent, never claim a lettering swap succeeded. '
131
131
  'When the human supplies annotation content, such as write a text note on a named panel, create the ordinary annotation with add_annotation. Merely opening an editor does not fulfill a request to write the supplied content. Offer/open the editor for unspecified content or an explicit editor request. '
132
+ 'Whenever you list choices for a change (and always for a HELP request such as "help me change the channel colours of e"), add one more choice: "show me where to click", which teaches the GUI. On that choice call show_me_where with EVERY route that does it (menu bar, right-click menu of the object at the right level: image or whole row, or the panel editor tab + buttons): all are outlined at once and cleared when it worked. Say what the yellow selection outline surrounds and what to click first. Open menus for the user (open_menus=true) only when they explicitly ask to be shown the menu; never click for them in that mode. '
133
+ 'End every answer that tells how to do something in the GUI with: "Should I **highlight where to click**, or **open it for me**?". Highlight = show_me_where with every route of that answer; open it for me = the same call with open_menus=true (menus opened down to the entry to click, or where=editor: the panel editor opened on its tab, buttons outlined). Never perform the edit itself. '
132
134
  'When no dedicated operation covers a GUI feature, discover native_gui: inspect actual native menu/dialog controls, invoke their exact IDs, complete or cancel the dialog, then verify jobs and document state. Queued is not success. Never substitute code for a normal manual how-to request. '
133
- 'For rearranging EXISTING images into regular rows/columns, prefer arrange_live_images once. Derive columns from current image count when a row count is requested; ask if equal rows are impossible. Do not rebuild existing rows with per-image move loops. '
135
+ 'For rearranging EXISTING images into regular rows/columns, prefer arrange_live_images once. Derive columns from current image count when a row count is requested; when equal rows are impossible, ask which split the human wants, then pass it as row_counts (e.g. 9 images in 4 rows: row_counts=[3, 2, 2, 2]) in that ONE call. Reading order and letters are kept. Do not rebuild existing rows with per-image move loops. '
134
136
  'To construct NEW rows/columns, call add_group and use its returned path before adding images/plots. Requested row numbers are not existing group paths. On a missing-container error inspect/create the intended container; never fall back into an unrelated existing row. '
135
137
  'Discover relevant operations with find_pyfigures_tools; its results include exact '
136
138
  'argument schemas. Execute the selected operation with use_pyfigures_tool. '
@@ -157,6 +159,7 @@ def build_server(full_server, send):
157
159
  'Is a font available? Use list_fonts(query=the_font), answer from font_check. '
158
160
  'Fake, dummy or placeholder images, or a layout before the images exist ("3 rows of 2 panels"): add_placeholder_grid in one call, never invented scripted images; the user fills the grey slots later (fill_template or drag and drop). '
159
161
  'figure_summary in the state answers "what is in the figure?". When it says empty=true, reply at once from its answer and how_to_add_content, without calling tools or previewing. '
162
+ 'PyFigures cannot reorder channels, but every channel colour can be set on its own, which gives the same picture. For "swap channels 3->1, 1->2, 2->3" say so, then offer: do it now (set_lut with the channel_colours of the panel permuted: what each channel shows now, its LUT or else the own colour of the file; [RED, GREEN, BLUE] swapped 1<->2 is luts=["GREEN", "RED", "BLUE"]), or how to do it yourself in the GUI (right-click the image > Appearance > Set LUT(s); double-click it > File Infos + Scale tab > Set LUTs; Annotations > Figure colours… for every image), with a chat example such as "make channel 1 blue, channel 2 red, channel 3 green". The channels property is only show/hide. '
160
163
  'Colours named without a target ("use magenta and green"): on a figure whose only coloured things are multichannel images they mean the CHANNEL colours (set_figure_colors, one per channel in channel order). If it also has coloured ROIs, arrows or text, or the colours could fit several things, ASK which ones the user means before changing anything. Which colour names work? list_colors(query=the_colour), answer from color_check. '
161
164
  'Which LUTs/colour tables exist, or is a LUT available? Use list_luts(query=the_name), answer from lut_check and pass its exact_key to set_lut. In set_lut, null keeps a channel unchanged. '
162
165
  'Column headers or a heading above/below a row: add_label_row(group_path=[row index], labels=[one per image] or one string). A label left/right of a row: add_side_label. add_annotation writes text INSIDE an image, not beside a row. '
@@ -218,8 +221,12 @@ def build_server(full_server, send):
218
221
  """Find operations and retrieve their exact arguments before executing. Search natural words (e.g. spacing, panel letter position, scale bar), optionally within a category. Default at most six schemas; use offset for more. No GUI edits. Leave compact unset: the client sets it when its context is filling."""
219
222
  if category and category not in CATEGORIES:
220
223
  raise ValueError('Unknown category. Use list_pyfigures_categories.')
221
- if not 1 <= limit <= 12 or offset < 0:
222
- raise ValueError('limit must be 1-12 and offset nonnegative')
224
+ # a model asked for limit=20 and lost a step to the error: clamp instead
225
+ limit = min(max(int(limit or 6), 1), 12)
226
+ offset = max(int(offset or 0), 0)
227
+ # operations named exactly ('move_image schema') come first, with no how-to guides:
228
+ # a model searched move_image ~20 times and got scale-bar guides each time
229
+ named = {n for n in available if re.search(r'(?<![a-z0-9_])' + re.escape(n.lower()) + r'(?![a-z0-9_])', query.lower())}
223
230
  words = re.findall(r'[a-z0-9]+', query.lower())
224
231
  aliases = {'gaps': 'spacing', 'gap': 'spacing', 'letters': 'letter',
225
232
  'labels': 'label', 'rows': 'row', 'images': 'image', 'fonts': 'font',
@@ -233,7 +240,7 @@ def build_server(full_server, send):
233
240
  title = name.replace('_', ' ')
234
241
  help_text = tool.description.lower()
235
242
  score = sum(5 * (w in title) + (w in help_text) for w in words)
236
- if query.strip().lower()==name.lower():score+=1000
243
+ if query.strip().lower()==name.lower() or name in named:score+=1000
237
244
  # Concrete output/metadata intent must outrank generic figure inspection.
238
245
  if name=='export_figure' and any(w in ('export','png','svg','pdf','tiff','jpeg') for w in words):score+=320
239
246
  if name in ('set_figure_caption','get_figure_caption') and 'caption' in words:
@@ -334,7 +341,7 @@ def build_server(full_server, send):
334
341
  mode = os.environ.get('PYFIGURES_COMPACT_DISCOVERY', 'auto')
335
342
  compact = mode == '1' or (mode != '0' and bool(compact))
336
343
  for rank, (_, n, t, c) in enumerate(ranked[offset:offset + limit]):
337
- if compact and rank >= FULL_SCHEMAS and query.strip().lower() != n.lower():
344
+ if compact and rank >= FULL_SCHEMAS and query.strip().lower() != n.lower() and n not in named:
338
345
  summary = re.split(r'(?<=[.!?])\s', t.description.strip(), maxsplit=1)[0][:160]
339
346
  found.append({'name': n, 'category': c, 'summary': summary,
340
347
  'schema': 'not included: call find_pyfigures_tools(query="' + n + '") for it, or call the operation; a wrong argument returns its exact schema'})
@@ -347,7 +354,7 @@ def build_server(full_server, send):
347
354
  found.append({'name': n, 'callable_directly': n in server._tool_manager._tools, 'dispatcher': 'use_pyfigures_tool', 'category': c, 'description': t.description,
348
355
  'arguments_schema': schema})
349
356
  manual_guides=None
350
- if query:
357
+ if query and not named:
351
358
  from .manual_help import explain
352
359
  candidate=explain(query)
353
360
  if candidate.get('status') in ('explained','source_reviewed'):
@@ -359,7 +366,7 @@ def build_server(full_server, send):
359
366
  manual_guides={'status':'ambiguous','operation_executed':False,
360
367
  'guides':[g for g in close if g.get('status')=='explained'],
361
368
  'answer_style':'Pick the guide matching the question; human GUI steps, no tool commands.'}
362
- if manual_guides is None and any(w in ('keyboard','shortcut','shortcuts','drag','drop','dnd','split','channel','channels') for w in words):
369
+ if manual_guides is None and not named and any(w in ('keyboard','shortcut','shortcuts','drag','drop','dnd','split','channel','channels') for w in words):
363
370
  from .manual_help import explain
364
371
  topic='split' if any(w in ('split','channel','channels') for w in words) else ('drag_and_drop' if any(w in ('drag','drop','dnd') for w in words) else 'shortcuts')
365
372
  manual_guides=explain(topic)
@@ -1,5 +1,6 @@
1
1
  """Adapters over existing PyFigures file tools; originals are imported, never edited."""
2
2
  import inspect
3
+ import re
3
4
  import xml.etree.ElementTree as ET
4
5
  from pyfigures.mcp_tools import structure as tools
5
6
  from .original_registry import registry, live_parameter, encode
@@ -57,7 +58,38 @@ def run(path, calls, read_only=False):
57
58
  raise ValueError(str(exc)) from exc
58
59
 
59
60
 
60
- def arrange_rows(path, columns, width, spacing):
61
+ def parse_row_counts(value):
62
+ """Images per row: 3, "3", [3, 2, 2, 2] or "3-2-2-2" (also "3,2,2,2" / "3 2 2 2").
63
+
64
+ Returns (columns, row_counts): an equal split keeps row_counts None.
65
+ """
66
+ if isinstance(value, bool):
67
+ raise ValueError('images per row must be a number such as 3 or one number per row such as 3-2-2-2')
68
+ if isinstance(value, int):
69
+ return value, None
70
+ if isinstance(value, str):
71
+ # 'x' separates only two numbers ("3x2"); "3-x" is not a number per row
72
+ parts = [p for p in re.split(r'(?<=\d)\s*[x×]\s*(?=\d)|[\s,;/+-]+', value.strip()) if p]
73
+ if not parts or not all(p.isdigit() for p in parts):
74
+ raise ValueError(f'"{value}" is not a number of images per row (e.g. 3) or one number per row (e.g. 3-2-2-2)')
75
+ value = [int(p) for p in parts]
76
+ if isinstance(value, (list, tuple)):
77
+ if not value or not all(type(n) is int for n in value):
78
+ raise ValueError('row_counts must be a list of whole numbers, one per row, e.g. [3, 2, 2, 2]')
79
+ if len(value) == 1:
80
+ return value[0], None
81
+ return max(value), list(value)
82
+ raise ValueError('images per row must be a number such as 3 or one number per row such as 3-2-2-2')
83
+
84
+
85
+ def arrange_rows(path, columns, width, spacing, row_counts=None):
86
+ """Regroup every image panel into rows, in reading order: `columns` per row
87
+ (the last row may be shorter) or exactly `row_counts` (e.g. [3, 2, 2, 2])."""
88
+ if row_counts is not None:
89
+ if (not isinstance(row_counts, (list, tuple)) or not row_counts or len(row_counts) > 100
90
+ or not all(type(n) is int and 1 <= n <= 100 for n in row_counts)):
91
+ raise ValueError('row_counts must list 1 to 100 rows of 1 to 100 images each, e.g. [3, 2, 2, 2]')
92
+ columns = max(row_counts)
61
93
  if type(columns) is not int or not 1 <= columns <= 100:
62
94
  raise ValueError('columns must be an integer from 1 to 100')
63
95
  if type(width) is not int or not 32 <= width <= 20000:
@@ -86,21 +118,28 @@ def arrange_rows(path, columns, width, spacing):
86
118
  root.remove(node)
87
119
  if not images:
88
120
  raise ValueError('No image panels to arrange')
89
- for row, start in enumerate(range(0, len(images), columns)):
121
+ if row_counts is not None and sum(row_counts) != len(images):
122
+ raise ValueError(f'row_counts {"-".join(map(str, row_counts))} places {sum(row_counts)} images but the figure '
123
+ f'has {len(images)}; give one number per row adding up to {len(images)}. Nothing was changed.')
124
+ counts = list(row_counts) if row_counts is not None else [
125
+ min(columns, len(images) - start) for start in range(0, len(images), columns)]
126
+ start = 0
127
+ for row, count in enumerate(counts):
90
128
  group = _new_group_elem('X', spacing, row + 1)
91
129
  group.find('size').text = str(float(width))
92
- group.find('content').extend(images[start:start + columns])
130
+ group.find('content').extend(images[start:start + count])
93
131
  root.insert(row, group)
132
+ start += count
94
133
  # Preserve standalone labels after the rows; their exact old position may change.
95
134
  for offset, label in enumerate(labels):
96
- root.insert((len(images) + columns - 1) // columns + offset, label)
135
+ root.insert(len(counts) + offset, label)
97
136
  checked(tools.write_xml(path, ET.tostring(root, encoding='unicode')))
98
137
  from pathlib import Path
99
138
  before_layout = Path(path).read_bytes()
100
139
  checked(tools.recompute_layout(path))
101
140
  from .partner_gui import carry_policies
102
141
  Path(path).write_bytes(carry_policies(before_layout, Path(path).read_bytes()))
103
- return {'image_count': len(images), 'rows': (len(images) + columns - 1) // columns,
142
+ return {'image_count': len(images), 'rows': len(counts), 'images_per_row': counts,
104
143
  'columns': columns, 'preserved_labels': len(labels),
105
144
  'note': 'Existing group structure replaced; image traversal order and panel annotations retained. Standalone labels placed after image rows.'}
106
145
 
@@ -1,5 +1,6 @@
1
1
  """Small verified figure memory and strict property-preservation checks."""
2
2
  FIELDS = ('text', 'placement', 'font_family', 'font_size', 'color', 'background', 'opacity', 'bold', 'italic', 'underline')
3
+ MOVE_HINT = 'To regroup images into rows (equal or uneven, e.g. 3-2-2-2) use arrange_live_images with columns or row_counts in ONE call; it keeps reading order and letters. To move single images, move them so the reading order stays the same.'
3
4
  REQUEST_FIELDS = {'placement': 'placement', 'font_family': 'font_family', 'font_size': 'font_size',
4
5
  'color_value': 'color', 'background': 'background'}
5
6
 
@@ -10,10 +11,22 @@ def specification(state):
10
11
  for field in FIELDS[1:]:
11
12
  values = [a.get(field) for a in letters]
12
13
  uniform[field] = values[0] if values and all(v == values[0] for v in values) else 'mixed' if values else None
13
- return {'image_panels': len(state['panels']), 'visible_letters': len(letters),
14
+ spec = {'image_panels': len(state['panels']), 'visible_letters': len(letters),
14
15
  'duplicate_letter_references':state.get('duplicate_letter_references',{}),
15
16
  'uniform_letter_style': uniform, 'unlettered_panel_ids': state['unlettered_panel_ids'],
17
+ 'letter_layout': state.get('letter_layout', 'panel'),
16
18
  'source': 'Actual GUI readback; preserve unspecified properties on follow-up edits.'}
19
+ if spec['letter_layout'] == 'row':
20
+ # one letter per ROW, outside the rows on the left (drawn by the canvas):
21
+ # the panels carry none on purpose
22
+ row_letters = state.get('row_letters') or []
23
+ spec.update(visible_letters=len(row_letters),
24
+ row_letters=[r['text'] for r in row_letters],
25
+ row_letter_align=state.get('row_letter_align', 'top'),
26
+ letter_layout_note='One letter per row, outside the rows on the left; change it '
27
+ 'with set_panel_letter_layout (letter_layout="panel" puts a '
28
+ 'letter back in each panel).')
29
+ return spec
17
30
 
18
31
 
19
32
  def changes(before, after):
@@ -44,7 +57,7 @@ def movement_changes(before, after):
44
57
  texts = [a['text'] for a in panel['letters']]
45
58
  candidates = [p for p in candidates if [a['text'] for a in p['letters']] == texts]
46
59
  if len(candidates) != 1:
47
- raise ValueError('MOVE_VERIFICATION_FAILED: Cannot uniquely match image identity; edit rolled back. Use atomic ungroup_all_images for all images.')
60
+ raise ValueError('MOVE_VERIFICATION_FAILED: Cannot uniquely match image identity; edit rolled back. ' + MOVE_HINT)
48
61
  matched = candidates[0]
49
62
  known[panel['filename']].remove(matched)
50
63
  aligned.append({**matched, 'panel_id': panel['panel_id']})
@@ -52,7 +65,7 @@ def movement_changes(before, after):
52
65
  raise ValueError('MOVE_VERIFICATION_FAILED: Image count changed; edit rolled back.')
53
66
  deltas = changes({**before, 'panels': aligned}, after)
54
67
  if deltas:
55
- raise ValueError('MOVE_VERIFICATION_FAILED: Actual image lettering changed; edit rolled back. Use atomic ungroup_all_images for all images.')
68
+ raise ValueError('MOVE_VERIFICATION_FAILED: this move changes the panel letters (their reading order); edit rolled back. ' + MOVE_HINT)
56
69
  return deltas
57
70
 
58
71
 
@@ -102,7 +102,7 @@ def open_editor(session, panel_ref=None, tab=None):
102
102
  if not any(p is panel for _, _, p in panels(canvas.shapes_to_draw)):
103
103
  raise ValueError('Panel changed before editor opened')
104
104
  session._annotation_editor_status = 'open'
105
- canvas.update_image_annotations(image2d=panel, tab=title)
105
+ canvas.update_image_annotations(image2d=panel, tab=title, draw_tool=False)
106
106
  current = resolve_panel(window, panel_id)
107
107
  if current is not panel and policy is not None and not getattr(current, POLICY, None):
108
108
  # Native clone drops prototype-only extension metadata.
@@ -202,8 +202,9 @@ def sidecar_config(descriptor=None):
202
202
  config.provider, config.base_url, config.model = 'compatible', LM_STUDIO_URL, model
203
203
  config.adapter ={**(config.adapter or {}), 'type': 'pyfigures', 'descriptor': descriptor}
204
204
  config.servers = {**(config.servers or {}), 'pyfigures': mcp_server_entry()}
205
- from pyfigures.mcp_control import MODEL_WARNING
205
+ from pyfigures.mcp_control import MODEL_WARNING, REMOTE_MODEL_WARNING
206
206
  config.notice = MODEL_WARNING # the line always shown under the chat
207
+ config.remote_notice = REMOTE_MODEL_WARNING # added only for an online provider
207
208
  return config
208
209
 
209
210
 
@@ -101,10 +101,12 @@ def preview_live_figure(session_id: str, expected_revision: int) -> Image:
101
101
 
102
102
  @mcp.tool()
103
103
  def arrange_live_images(session_id: str, expected_revision: int, request_id: str,
104
- columns: int = 4, row_width_px: int = 0, spacing_px: int = 3) -> dict:
105
- """Regroup ALL image panels into horizontal rows of columns images, in current traversal order. Final row may be shorter. Preserve panel annotations/crops/insets; replace previous group structure. Standalone labels follow rows; nested text rows are rejected. Uses existing PyFigures XML/layout tools on a temporary snapshot. One undo step; no save. row_width_px=0 keeps GUI width."""
104
+ columns: int = 4, row_width_px: int = 0, spacing_px: int = 3,
105
+ row_counts: list[int] | None = None) -> dict:
106
+ """Regroup ALL image panels into horizontal rows, in current reading order (letters keep their order): columns images per row (final row may be shorter), OR row_counts = images in each row for uneven rows, e.g. [3, 2, 2, 2] for 9 images in 4 rows (must add up to the image count). Preserve panel annotations/crops/insets; replace previous group structure. Standalone labels follow rows; nested text rows are rejected. Uses existing PyFigures XML/layout tools on a temporary snapshot. One undo step; no save. row_width_px=0 keeps GUI width."""
106
107
  return request('arrange_rows', session_id, expected_revision,
107
- dict(columns=columns, row_width_px=row_width_px, spacing_px=spacing_px), request_id)
108
+ dict(columns=columns, row_width_px=row_width_px, spacing_px=spacing_px,
109
+ row_counts=row_counts), request_id)
108
110
 
109
111
 
110
112
  @mcp.tool()
@@ -236,10 +238,23 @@ def select_live_objects(panel_refs: list[str] | None = None, group_paths: list[l
236
238
 
237
239
  @mcp.tool()
238
240
  def open_annotation_editor(panel_ref: str | None = None, tab: str | None = None) -> dict:
239
- """Select a named panel and open its NATIVE annotation editor, just like GUI double-click, FOR THE USER to work in. tab: the tab it opens on, matching what the user wants to do there: 'crop' or 'rotate' (Rotate + Crop), 'text' (Texts), 'scale' (File Infos + Scale, pixel size), 'script', 'export' (Export style), 'layers'; default 'annotations' (drawing ROIs, arrows). Only when the user asks for the editor: it blocks every other tool until the user presses OK/Cancel, and no tool can close it. Never open it to make an edit yourself (inset where the user clicked: roi_to_inset; ROIs, arrows, text: their tools). Omit panel_ref only when one panel is already selected. Does not invent/add annotations; human uses native OK/Cancel. Result scheduled means opening requested, not annotation completed. For a vague annotate-panel request first ask what annotation to add or offer this editor. Never add placeholder text like Panel o."""
241
+ """Select a named panel and open its NATIVE annotation editor, just like GUI double-click, FOR THE USER to work in. tab: the tab it opens on, matching what the user wants to do there: 'crop' or 'rotate' (Rotate + Crop), 'text' (Texts), 'scale' (File Infos + Scale: pixel size, channels and their colours / LUTs, Reset all LUTs), 'script', 'export' (Export style), 'layers'; default 'annotations' (drawing ROIs, arrows). Only when the user asks for the editor: it blocks every other tool until the user presses OK/Cancel, and no tool can close it. Never open it to make an edit yourself (inset where the user clicked: roi_to_inset; ROIs, arrows, text: their tools). Omit panel_ref only when one panel is already selected. Does not invent/add annotations; human uses native OK/Cancel. Result scheduled means opening requested, not annotation completed. For a vague annotate-panel request first ask what annotation to add or offer this editor. Never add placeholder text like Panel o."""
240
242
  return call_live('open_annotation_editor', dict(panel_ref=panel_ref, tab=tab))
241
243
 
242
244
 
245
+ @mcp.tool()
246
+ def show_me_where(routes: list[list[str]] | None = None, where: str = 'menu', panel_ref: str | None = None,
247
+ level: str = 'image', editor_tab: str | None = None, controls: list[str] | None = None,
248
+ note: str | None = None, open_menus: bool = False, stop: bool = False) -> dict:
249
+ """TEACH the user where to click instead of doing it: outlines in orange EVERY entry on the given routes at once, so the user can follow whichever route they like and try things; every highlight disappears as soon as the figure changes (it worked). Nothing is clicked or edited and the mouse pointer never moves.
250
+ routes: one list of entry titles per possible route, e.g. [["Edit", "Arrange all images in rows…"]] (where='menu', the menu bar, checked against the real menus: a wrong title returns what that level offers), or [["Crop & size", "Reset crop only"], ["Crop & size", "Reset crop and rotation"]] (where='context', the right-click menu of the object panel_ref selects at *level*: 'image' or its whole 'row'; the yellow outline shows it). where='editor': the panel editor's editor_tab (e.g. 'File Infos + Scale') and controls (button titles, e.g. ['Reset all LUTs']) are outlined when the user opens the editor (double-click the panel).
251
+ open_menus=True opens the menus for the user down to where the routes split (where='editor': opens the panel editor of panel_ref on editor_tab, its buttons outlined): ONLY when the user explicitly asks ("show me the right-click menu", "open it for me"). stop=True removes the highlights. Offer this as a choice whenever you list options for a change; the user learns the GUI.
252
+ Follow-ups to a how-to answer: "highlight where to click" = every route, open_menus=False; "open it for me" = the same routes with open_menus=True. Never perform the edit itself."""
253
+ return call_live('show_me_where', dict(routes=routes or [], where=where, panel_ref=panel_ref, level=level,
254
+ editor_tab=editor_tab, controls=controls, note=note,
255
+ open_menus=open_menus, stop=stop))
256
+
257
+
243
258
  @mcp.tool()
244
259
  def preview_panel(panel_ref: str, brighten: bool = True) -> list:
245
260
  """See ONE panel's whole source image, uncropped, with pixel rulers and its current crop as a dashed yellow box. Use it BEFORE transform_image crops ("crop to the nuclei", "zoom on the cells"): read the region's pixel coordinates off the rulers, then crop once (crop_left=x0, crop_top=y0, crop_right=width-x1, crop_bottom=height-y1). Never remove a crop just to look at the whole image: this shows it. brighten stretches the contrast of this preview only (dim fluorescence); the figure is unchanged. Read-only."""
@@ -164,10 +164,20 @@ def state(window):
164
164
  for annotation in entry['letters']:
165
165
  references.setdefault(annotation['text'].casefold(),[]).append(entry['panel_id'])
166
166
  duplicates={text:ids for text,ids in references.items() if len(ids)>1}
167
- return {'duplicate_letter_references':duplicates,'visible_letter_count': sum(len(p['letters']) for p in entries),
168
- 'unlettered_panel_ids': [p['panel_id'] for p in entries if not p['letters']],
167
+ canvas = window.paint.EZFIG_panel
168
+ from pyfigures.gui.row_letters import normalise_layout, normalise_align
169
+ layout = normalise_layout(getattr(canvas, 'letter_layout', None))
170
+ # one letter per row, outside the rows (drawn by the canvas, not on a panel)
171
+ row_letters = [{'row': k, 'text': t.getPlainText()}
172
+ for k, t in enumerate(canvas.row_letter_items())] if layout == 'row' else []
173
+ return {'duplicate_letter_references':duplicates,
174
+ 'visible_letter_count': sum(len(p['letters']) for p in entries) + len(row_letters),
175
+ 'unlettered_panel_ids': [p['panel_id'] for p in entries if not p['letters']] if layout != 'row' else [],
169
176
  'auto_lettering': window.auto_lettering_checkbox.isChecked(),
170
177
  'first_letter': window.letter_line_edit.text(),
178
+ 'letter_layout': layout,
179
+ 'row_letter_align': normalise_align(getattr(canvas, 'row_letter_align', None)),
180
+ 'row_letters': row_letters,
171
181
  'default_position': str(window.serializable_font.placement), 'panels': entries}
172
182
 
173
183
 
@@ -413,6 +423,24 @@ class PartnerGUI(BaseGUI):
413
423
  raise ValueError('CLARIFICATION_REQUIRED: This canvas is not a flat list of horizontal rows')
414
424
  if validate_only:
415
425
  return
426
+ from pyfigures.gui.row_letters import normalise_layout
427
+ if normalise_layout(getattr(canvas, 'letter_layout', None)) == 'row':
428
+ # one letter per row, outside the rows: the letters follow the row
429
+ # order by themselves and the panels carry none (recording "no
430
+ # letter" policies on them hid their letters for good once the
431
+ # figure went back to a letter in each panel)
432
+ a, b = first_row - 1, second_row - 1
433
+ roots[a], roots[b] = roots[b], roots[a]
434
+ canvas.update()
435
+ canvas.repack_all()
436
+ canvas.update_letters_required.emit()
437
+ canvas.update_text_rows.emit()
438
+ canvas.update_size()
439
+ canvas.repaint()
440
+ return dict(action='swap_rows', changed=int(a != b), matched_panel_ids=[], changed_panel_ids=[],
441
+ first_row=first_row, second_row=second_row, completion_verified=True,
442
+ lettering_mode='row_letters',
443
+ row_letters=[t.getPlainText() for t in canvas.row_letter_items()])
416
444
  automatic = self.auto_lettering_checkbox.isChecked() and bool(self.letter_line_edit.text())
417
445
  before = state(self)
418
446
  original = [p for _, _, p in panels(roots)]
@@ -89,7 +89,10 @@ class Session:
89
89
  # answers "is c calibrated?", "any scale bars?", "which colours?" without another tool
90
90
  'pixel_size': getattr(p, 'px_to_unit_conversion_factor', None) or None, # 0 = not set
91
91
  'scale_bars': sum(type(a).__name__ == 'ScaleBar' for a in (p.annotations or [])),
92
- 'luts': [str(l) if l is not None else None for l in (getattr(p, 'LUTs', None) or [])] or None}
92
+ 'luts': [str(l) if l is not None else None for l in (getattr(p, 'LUTs', None) or [])] or None,
93
+ # what each channel really shows (its LUT, else the file's own colour):
94
+ # "swap channels 1 and 2" permutes these (user chat 2026-11-05)
95
+ 'channel_colours': channel_colours(p)}
93
96
  for gp, ix, p in panels(self.window.paint.EZFIG_panel.shapes_to_draw)]
94
97
  from .advanced_annotations import describe, text_inspection_record
95
98
  annotations = [text_inspection_record(a, '/'.join(map(str, (*gp, ix))), gp, ix,
@@ -101,12 +104,14 @@ class Session:
101
104
  for index,a in enumerate(p.annotations or [])
102
105
  if type(a).__name__ in ('Rectangle2D','Rect2D','Ellipse2D','Circle2D','Square2D','Line2D','Polygon2D','PolyLine2D','Freehand2D')]
103
106
  objects = self.window.paint.EZFIG_panel.shapes_to_draw
104
- return {'figure_summary': figure_summary(objects, references, missing | unreadable),
107
+ letter_state = lettering_state(self.window)
108
+ return {'figure_summary': figure_summary(objects, references, missing | unreadable,
109
+ row_letters=[r['text'] for r in letter_state.get('row_letters') or []]),
105
110
  'session_id': self.id, 'revision': self.revision,
106
111
  'text_annotations': annotations,
107
112
  'roi_annotations': rois,
108
113
  'selection': selection_state(self.window),
109
- 'verified_letter_specification': specification(lettering_state(self.window)),
114
+ 'verified_letter_specification': specification(letter_state),
110
115
  'panel_references': references,
111
116
  **({'missing_source_files': {
112
117
  'not_found': sorted(missing), 'could_not_be_read': sorted(unreadable),
@@ -128,6 +133,10 @@ class Session:
128
133
  'recovery_error': self.recovery.error},
129
134
  'lettering': {'automatic': self.window.auto_lettering_checkbox.isChecked(),
130
135
  'default_position': str(self.window.serializable_font.placement),
136
+ # 'row': one letter per row, outside the rows on the left
137
+ 'layout': getattr(self.window.paint.EZFIG_panel, 'letter_layout', 'panel'),
138
+ 'row_letter_align': getattr(self.window.paint.EZFIG_panel, 'row_letter_align', 'top'),
139
+ 'layout_operation': 'set_panel_letter_layout',
131
140
  'bulk_operation': 'edit_panel_letters'},
132
141
  'objects': [{'id': str(i), 'type': type(obj).__name__,
133
142
  'image_count': count_images(obj),
@@ -264,7 +273,7 @@ class Session:
264
273
  elif op == 'arrange_rows':
265
274
  response = arrange_rows(path, args.get('columns', 4),
266
275
  args.get('row_width_px') or int(w.size_spinbox.value()),
267
- args.get('spacing_px', 3))
276
+ args.get('spacing_px', 3), args.get('row_counts') or None)
268
277
  else:
269
278
  response = run(path, args['calls'])
270
279
  # Original tools only touched a temporary snapshot so far.
@@ -295,6 +304,43 @@ class Session:
295
304
  if not panel.grab().save(str(output)):
296
305
  raise RuntimeError('Could not capture canvas')
297
306
  result = {'path': str(output), 'revision': self.revision}
307
+ elif op == 'show_me_where':
308
+ # teach, never click: highlight every route, clear on success
309
+ from ..gui.show_me_where import ClickGuide
310
+ if getattr(self, 'click_guide', None) is None:
311
+ self.click_guide = ClickGuide(w)
312
+ if args.get('stop'):
313
+ self.click_guide.stop()
314
+ result = self.click_guide.status()
315
+ else:
316
+ ref, level = args.get('panel_ref'), args.get('level') or 'image'
317
+ if level not in ('image', 'row'):
318
+ raise ValueError("level must be 'image' or 'row'")
319
+ if ref:
320
+ from .gui_selection import resolve_panel
321
+ target = resolve_panel(w, ref)
322
+ if level == 'row':
323
+ target = next((top for top in panel.shapes_to_draw
324
+ if top is target or _contains(top, target)), target)
325
+ panel.set_current_selection(target)
326
+ panel.update()
327
+ where = args.get('where') or 'menu'
328
+ open_menus = bool(args.get('open_menus', False))
329
+ tab = args.get('editor_tab')
330
+ if where == 'editor' and tab:
331
+ from .gui_selection import editor_tab
332
+ tab = editor_tab(tab) # 'scale' -> 'File Infos + Scale', the title to outline
333
+ result = self.click_guide.start(args.get('routes') or [], where=where,
334
+ controls=args.get('controls'), editor_tab=tab,
335
+ note=args.get('note'), open_menus=open_menus)
336
+ if where == 'editor' and open_menus and result.get('status') == 'guidance_shown':
337
+ # "open it for me": the editor opens on its tab, the buttons stay outlined
338
+ from .gui_selection import open_editor
339
+ opened = open_editor(self, panel_ref=ref, tab=tab)
340
+ result = {**result, 'editor': opened['status'], 'tab': opened['tab']}
341
+ elif op == 'show_me_where_status':
342
+ guide = getattr(self, 'click_guide', None)
343
+ result = guide.status() if guide is not None else {'status': 'idle', 'operation_executed': False}
298
344
  elif op == 'panel_source':
299
345
  # one panel's whole source with pixel rulers, to choose crop values
300
346
  from .gui_selection import resolve_panel
@@ -547,7 +593,10 @@ class Session:
547
593
  if annotation.findtext('is_letter') == 'True':
548
594
  annotation.find('is_letter').text = 'False'
549
595
  settings = root.find('SerializableGUIparameters')
550
- if settings is not None:
596
+ # row letters (one per row, outside) are drawn from the figure
597
+ # settings, never from panel annotations: lettering stays on
598
+ per_row = settings is not None and (settings.findtext('letter_layout') or '').strip().strip('"') == 'row'
599
+ if settings is not None and not per_row:
551
600
  field = settings.find('auto_lettering')
552
601
  if field is None:
553
602
  field = ET.SubElement(settings, 'auto_lettering')
@@ -695,6 +744,58 @@ _SOURCE_KEYS = ('path', 'paths', 'file', 'files', 'filename', 'filenames', 'csv'
695
744
  _OUTPUT_WORDS = ('out', 'save', 'export', 'dest')
696
745
 
697
746
 
747
+ _PLAIN_COLOURS = {'RED': (1, 0, 0), 'GREEN': (0, 1, 0), 'BLUE': (0, 0, 1), 'GRAY': (1, 1, 1),
748
+ 'MAGENTA': (1, 0, 1), 'CYAN': (0, 1, 1), 'YELLOW': (1, 1, 0)}
749
+
750
+
751
+ def lut_colour_name(lut):
752
+ """The plain LUT name a file's own colour table matches (its brightest
753
+ colour: an LSM 'green' channel -> GREEN), or 'custom'."""
754
+ import numpy as np
755
+ try:
756
+ a = np.asarray(lut, dtype=float)
757
+ end = a[:, -1] if a.shape[0] == 3 else a[-1, :3]
758
+ top = end.max()
759
+ if top <= 0:
760
+ return 'custom'
761
+ end = end / top
762
+ name, dist = min(((n, float(np.abs(end - c).sum())) for n, c in _PLAIN_COLOURS.items()), key=lambda x: x[1])
763
+ return name if dist < 0.6 else 'custom'
764
+ except Exception:
765
+ return 'custom'
766
+
767
+
768
+ def channel_colours(panel):
769
+ """Per channel, the colour it is shown in: its LUT when set, else the
770
+ image file's own LUT (named by lut_colour_name). None when unknown
771
+ (image not loaded or single channel without a LUT)."""
772
+ set_luts = list(getattr(panel, 'LUTs', None) or [])
773
+ img = getattr(panel, 'img', None)
774
+ meta = getattr(img, 'metadata', None) or {}
775
+ file_luts = list(meta.get('LUTs') or []) if isinstance(meta, dict) else []
776
+ n = max(len(set_luts), len(file_luts))
777
+ if n < 1:
778
+ return None
779
+ out = []
780
+ for i in range(n):
781
+ mine = set_luts[i] if i < len(set_luts) else None
782
+ if isinstance(mine, str) and mine.strip():
783
+ out.append(mine.upper())
784
+ elif i < len(file_luts) and file_luts[i] is not None:
785
+ out.append(file_luts[i].upper() if isinstance(file_luts[i], str) else lut_colour_name(file_luts[i]))
786
+ else:
787
+ out.append(None)
788
+ return out if any(out) else None
789
+
790
+
791
+ def _contains(group, target):
792
+ """True when *target* is somewhere inside *group* (a row, column or panel)."""
793
+ for child in getattr(group, 'content', None) or []:
794
+ if child is target or _contains(child, target):
795
+ return True
796
+ return False
797
+
798
+
698
799
  def resolve_relative_sources(window, arguments, skip=None):
699
800
  """A bare file name from a model ("kidney.tif") was opened from whatever
700
801
  folder PyFigures was started in (Figure 3 chat runs, 2026-11-02). Look for
@@ -743,14 +844,17 @@ ADD_CONTENT = ('Ask for images to be added (tool add_image with each file\'s ful
743
844
  'or File > Open a saved .pyf figure.')
744
845
 
745
846
 
746
- def figure_summary(objects, references, missing=()):
847
+ def figure_summary(objects, references, missing=(), row_letters=()):
747
848
  if not objects:
748
849
  return {'empty': True,
749
850
  'answer': 'The figure is empty: no images, plots or text yet. Nothing to preview or describe.',
750
851
  'how_to_add_content': ADD_CONTENT}
751
852
  letters = [l for r in references for l in r['letters'] if l]
752
853
  text = f"{len(references)} image panel(s) in {len(objects)} top-level object(s)"
753
- if letters:
854
+ if row_letters:
855
+ # one letter per row, drawn outside the rows: the panels carry none
856
+ text += ', one letter per row (outside, on the left): ' + ', '.join(row_letters)
857
+ elif letters:
754
858
  text += ', letters ' + ', '.join(letters)
755
859
  if missing:
756
860
  text += f'; {len(missing)} image file(s) missing (see missing_source_files)'