pyfigures 0.2.4__tar.gz → 0.2.5__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 (323) hide show
  1. {pyfigures-0.2.4/pyfigures.egg-info → pyfigures-0.2.5}/PKG-INFO +5 -5
  2. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/advanced_annotations.py +3 -1
  3. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/categorized_mcp.py +2 -1
  4. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/live_mcp.py +2 -2
  5. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/partner_gui.py +38 -5
  6. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/session.py +2 -1
  7. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/pfgui.py +21 -0
  8. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/zoom_links.py +25 -4
  9. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/annotations.py +6 -0
  10. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/overlays.py +14 -1
  11. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/version.py +1 -1
  12. {pyfigures-0.2.4 → pyfigures-0.2.5/pyfigures.egg-info}/PKG-INFO +5 -5
  13. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures.egg-info/SOURCES.txt +4 -0
  14. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures.egg-info/requires.txt +4 -4
  15. {pyfigures-0.2.4 → pyfigures-0.2.5}/setup.py +4 -4
  16. pyfigures-0.2.5/tests/test_empty_inset_roi_20261106.py +62 -0
  17. pyfigures-0.2.5/tests/test_inset_crop_margins_20261106.py +51 -0
  18. pyfigures-0.2.5/tests/test_lazy_loading_placeholder_20261106.py +79 -0
  19. pyfigures-0.2.5/tests/test_row_letters_chat_style_20261106.py +80 -0
  20. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_user_findings_20261022.py +1 -1
  21. {pyfigures-0.2.4 → pyfigures-0.2.5}/LICENSE +0 -0
  22. {pyfigures-0.2.4 → pyfigures-0.2.5}/README.md +0 -0
  23. {pyfigures-0.2.4 → pyfigures-0.2.5}/images/__init__.py +0 -0
  24. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/__init__.py +0 -0
  25. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/__main__.py +0 -0
  26. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/album/__init__.py +0 -0
  27. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/album/__main__.py +0 -0
  28. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/arrowheads.py +0 -0
  29. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/__init__.py +0 -0
  30. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/assistant_actions.py +0 -0
  31. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/existing_tools.py +0 -0
  32. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/figure_state.py +0 -0
  33. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/gui_selection.py +0 -0
  34. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/launch.py +0 -0
  35. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/letter_sequence.py +0 -0
  36. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/live_structure.py +0 -0
  37. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/manual_help.py +0 -0
  38. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/manual_help_verified.json +0 -0
  39. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/native_gui.py +0 -0
  40. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/original_registry.py +0 -0
  41. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/plot_lifecycle.py +0 -0
  42. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/pointer_context.py +0 -0
  43. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/readability.py +0 -0
  44. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/recovery.py +0 -0
  45. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/result_evidence.py +0 -0
  46. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/assistant/submission_review.py +0 -0
  47. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/atomic_io.py +0 -0
  48. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/burned_text.py +0 -0
  49. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/colorbar_script.py +0 -0
  50. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/constant_panels.py +0 -0
  51. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/cvd.py +0 -0
  52. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/equations.py +0 -0
  53. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/extras.py +0 -0
  54. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/flip.py +0 -0
  55. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/__init__.py +0 -0
  56. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/about_dialog_pzf.py +0 -0
  57. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/annotation_editor.py +0 -0
  58. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/asingleoraspanel.py +0 -0
  59. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/autolettering_widget.py +0 -0
  60. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/bg_color_selection.py +0 -0
  61. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/bug_recorder.py +0 -0
  62. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/caption_dialog.py +0 -0
  63. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/colorassistant.py +0 -0
  64. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/ctrl_key.py +0 -0
  65. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/deckcraft_blank.json +0 -0
  66. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/dimchooser.py +0 -0
  67. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/drag_sketch.py +0 -0
  68. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/drop_sketch.py +0 -0
  69. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/editable_export.py +0 -0
  70. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/editor_interaction.py +0 -0
  71. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/emptyimagedialog.py +0 -0
  72. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/equation_dialog.py +0 -0
  73. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/ezfig.py +0 -0
  74. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/fonts/README.md +0 -0
  75. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/fontselectorgui.py +0 -0
  76. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/group_builder_GUI.py +0 -0
  77. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/headless_ops.py +0 -0
  78. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/integrity_ops.py +0 -0
  79. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/journal_style_editor.py +0 -0
  80. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/keep_tst_images_for_pzf.py +0 -0
  81. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/label_rows.py +0 -0
  82. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/latex_code_dialog.py +0 -0
  83. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/latex_support.py +0 -0
  84. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/lutmultiselector.py +0 -0
  85. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/mcp_server_dialog.py +0 -0
  86. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/pagelimitswidget.py +0 -0
  87. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/panelcreationwidget.py +0 -0
  88. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/pdf_support.py +0 -0
  89. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/portable_fonts.py +0 -0
  90. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/qc_reports.py +0 -0
  91. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/region_picker.py +0 -0
  92. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/render_headless.py +0 -0
  93. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/review/__init__.py +0 -0
  94. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/review/_template.py +0 -0
  95. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/review/dialog.py +0 -0
  96. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/review/html_export.py +0 -0
  97. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/review/send.py +0 -0
  98. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/row_letters.py +0 -0
  99. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/scalebareditor.py +0 -0
  100. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/scrollableEZFIG.py +0 -0
  101. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/show_me_how.py +0 -0
  102. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/show_me_where.py +0 -0
  103. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/simple_text_editor.py +0 -0
  104. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/spaceselector.py +0 -0
  105. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/style_text_headless.py +0 -0
  106. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/svg_painter.py +0 -0
  107. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/textEditWatcher.py +0 -0
  108. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/theme.py +0 -0
  109. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/tipdialog.py +0 -0
  110. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/tutorial.py +0 -0
  111. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/user_extra_translation.py +0 -0
  112. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/user_prefs.py +0 -0
  113. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/video_support.py +0 -0
  114. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/gui/widget_for_inset.py +0 -0
  115. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/guides.py +0 -0
  116. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/history.py +0 -0
  117. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/icons/__init__.py +0 -0
  118. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/icons/pyfigures.png +0 -0
  119. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/icons/pyfigures_album.png +0 -0
  120. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/icons/pyfigures_poster.png +0 -0
  121. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/image_search.py +0 -0
  122. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/journal_styles.py +0 -0
  123. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/latex_document.py +0 -0
  124. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/layout_formula.py +0 -0
  125. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/layout_picture.py +0 -0
  126. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_control.py +0 -0
  127. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_server.py +0 -0
  128. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/__init__.py +0 -0
  129. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/app.py +0 -0
  130. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/content.py +0 -0
  131. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/core.py +0 -0
  132. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/export.py +0 -0
  133. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/guidance.py +0 -0
  134. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/image_search.py +0 -0
  135. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/journal.py +0 -0
  136. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/poster.py +0 -0
  137. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/qc.py +0 -0
  138. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/stacks.py +0 -0
  139. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/structure.py +0 -0
  140. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/upkeep.py +0 -0
  141. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/mcp_tools/workflow.py +0 -0
  142. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/office_math.py +0 -0
  143. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/offscreen.py +0 -0
  144. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/panel_source_preview.py +0 -0
  145. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/path_resolution.py +0 -0
  146. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/__init__.py +0 -0
  147. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/__main__.py +0 -0
  148. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/page_presets.py +0 -0
  149. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/poster_align.py +0 -0
  150. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/poster_canvas.py +0 -0
  151. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/poster_headless.py +0 -0
  152. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/poster_layout_dialog.py +0 -0
  153. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/poster_layouts.py +0 -0
  154. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/poster_recipe.py +0 -0
  155. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/poster_shapes.py +0 -0
  156. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/poster_source_data.py +0 -0
  157. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/poster_templates.py +0 -0
  158. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/poster_text_dialog.py +0 -0
  159. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/poster_web_export.py +0 -0
  160. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/poster_window.py +0 -0
  161. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/poster/serialization.py +0 -0
  162. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/qt_exit.py +0 -0
  163. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/recipe.py +0 -0
  164. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/script_helpers.py +0 -0
  165. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/self_test.py +0 -0
  166. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/source_snapshot.py +0 -0
  167. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/stack_info.py +0 -0
  168. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures/zoom_geometry.py +0 -0
  169. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures.egg-info/dependency_links.txt +0 -0
  170. {pyfigures-0.2.4 → pyfigures-0.2.5}/pyfigures.egg-info/top_level.txt +0 -0
  171. {pyfigures-0.2.4 → pyfigures-0.2.5}/setup.cfg +0 -0
  172. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_advanced_edit_tools.py +0 -0
  173. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_arrow_tip.py +0 -0
  174. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_arrowheads.py +0 -0
  175. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_assistant_live.py +0 -0
  176. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_atomic_io.py +0 -0
  177. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_audit_fixes.py +0 -0
  178. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_audit_fixes_20261008.py +0 -0
  179. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_backgrounds.py +0 -0
  180. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_bug_recorder.py +0 -0
  181. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_bugs_found_by_gui_e2e.py +0 -0
  182. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_canvas_context_menu.py +0 -0
  183. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_canvas_keyboard_and_clicks.py +0 -0
  184. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_channels_property_20261105.py +0 -0
  185. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_codex_trial_findings.py +0 -0
  186. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_colour_bar_gui.py +0 -0
  187. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_consolidate_download.py +0 -0
  188. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_constant_panels.py +0 -0
  189. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_data_plots_and_stats.py +0 -0
  190. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_deserialization.py +0 -0
  191. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_dnd_canvas_more.py +0 -0
  192. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_dnd_combine_with_target.py +0 -0
  193. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_dnd_main_editor.py +0 -0
  194. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_draft_figure.py +0 -0
  195. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_drop_sketches.py +0 -0
  196. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_editable_export.py +0 -0
  197. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_editable_plot_text.py +0 -0
  198. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_editor_interaction.py +0 -0
  199. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_editor_rotate_and_tool_20261105.py +0 -0
  200. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_equations.py +0 -0
  201. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_exception_handler.py +0 -0
  202. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_export_waits_for_images.py +0 -0
  203. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_fig_rect_cache.py +0 -0
  204. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_figure_colors.py +0 -0
  205. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_figure_diff.py +0 -0
  206. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_fiji_formats.py +0 -0
  207. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_file_io_encoding.py +0 -0
  208. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_file_state_tracking.py +0 -0
  209. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_flip.py +0 -0
  210. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_folder_drag_and_drop.py +0 -0
  211. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_fonts_available.py +0 -0
  212. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_forbidden_files.py +0 -0
  213. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_gui_e2e_context_menu.py +0 -0
  214. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_gui_e2e_coverage.py +0 -0
  215. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_gui_e2e_dnd.py +0 -0
  216. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_gui_e2e_image_editor.py +0 -0
  217. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_gui_e2e_menus.py +0 -0
  218. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_gui_e2e_monkey.py +0 -0
  219. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_gui_e2e_tutorials.py +0 -0
  220. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_gui_e2e_visual.py +0 -0
  221. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_gui_menus_and_toolbar.py +0 -0
  222. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_gui_more_actions.py +0 -0
  223. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_gui_workflow_actions.py +0 -0
  224. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_guide_routing.py +0 -0
  225. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_image_opacity_reload.py +0 -0
  226. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_image_search.py +0 -0
  227. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_integrity_and_stats.py +0 -0
  228. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_interactive_tools.py +0 -0
  229. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_internal_dnd_group_placement.py +0 -0
  230. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_inverted_luts.py +0 -0
  231. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_journal_styles.py +0 -0
  232. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_latex_code.py +0 -0
  233. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_latex_documents.py +0 -0
  234. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_latex_extras.py +0 -0
  235. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_latex_full.py +0 -0
  236. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_latex_stress_findings.py +0 -0
  237. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_launchers.py +0 -0
  238. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_layout_canvas_geometry.py +0 -0
  239. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_layout_formula.py +0 -0
  240. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_layout_stability_gui.py +0 -0
  241. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_lazy_reflow.py +0 -0
  242. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_lettering_restore.py +0 -0
  243. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_licensing.py +0 -0
  244. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_lif_series_reading.py +0 -0
  245. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_llm_feedback_20261020.py +0 -0
  246. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_lut_remove_20261105.py +0 -0
  247. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_max_height.py +0 -0
  248. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_mcp_audit_findings.py +0 -0
  249. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_mcp_control.py +0 -0
  250. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_mcp_history.py +0 -0
  251. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_mcp_server.py +0 -0
  252. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_mcp_stdio_protocol.py +0 -0
  253. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_mcp_text_arguments.py +0 -0
  254. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_missing_images_gui.py +0 -0
  255. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_normalization.py +0 -0
  256. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_offscreen_env.py +0 -0
  257. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_ome_zarr.py +0 -0
  258. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_omero.py +0 -0
  259. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_open_perf.py +0 -0
  260. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_panel_editor.py +0 -0
  261. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_panel_editor_more.py +0 -0
  262. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_panel_preview.py +0 -0
  263. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_parity_mcp.py +0 -0
  264. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_path_resolution.py +0 -0
  265. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_pdf_panels.py +0 -0
  266. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_placeholder_grid.py +0 -0
  267. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_portability.py +0 -0
  268. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_poster_files_and_recipe.py +0 -0
  269. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_poster_gui.py +0 -0
  270. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_poster_mcp.py +0 -0
  271. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_poster_stress_findings.py +0 -0
  272. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_poster_vector_figures.py +0 -0
  273. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_property_setters_validate.py +0 -0
  274. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_pyf_loader_thread_deadlock.py +0 -0
  275. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_pyf_loading.py +0 -0
  276. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_pymupdf_offer.py +0 -0
  277. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_qc_gui.py +0 -0
  278. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_qc_mcp_tools.py +0 -0
  279. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_qc_reports.py +0 -0
  280. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_qt_exit.py +0 -0
  281. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_recipe.py +0 -0
  282. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_recipe_checks_bundles.py +0 -0
  283. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_recipe_extra_keys.py +0 -0
  284. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_recipe_for_llms.py +0 -0
  285. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_recipe_more_keys.py +0 -0
  286. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_recordings.py +0 -0
  287. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_render_export.py +0 -0
  288. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_restyle_texts.py +0 -0
  289. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_review_and_library.py +0 -0
  290. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_row_letters_gui.py +0 -0
  291. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_ruler_labels.py +0 -0
  292. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_save_reminder.py +0 -0
  293. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_scale_bar_calibration.py +0 -0
  294. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_scale_consistency.py +0 -0
  295. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_schema_sweep_findings.py +0 -0
  296. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_self_test.py +0 -0
  297. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_send_to_poster.py +0 -0
  298. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_shapes.py +0 -0
  299. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_show_me_how.py +0 -0
  300. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_show_me_where_20261105.py +0 -0
  301. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_source_data.py +0 -0
  302. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_stack_tools.py +0 -0
  303. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_stack_tools_gui.py +0 -0
  304. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_stack_with_image.py +0 -0
  305. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_stress_findings.py +0 -0
  306. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_stress_findings_20261028.py +0 -0
  307. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_stress_findings_20261029.py +0 -0
  308. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_style_audit_calbar.py +0 -0
  309. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_svg_clipping_and_pdf_pages.py +0 -0
  310. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_svg_empty_glyph.py +0 -0
  311. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_tex_install.py +0 -0
  312. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_text_editor_and_widgets.py +0 -0
  313. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_tutorial_controller.py +0 -0
  314. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_tutorials.py +0 -0
  315. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_typography_tidy.py +0 -0
  316. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_uneven_rows_20261105.py +0 -0
  317. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_user_chat_findings_20261104.py +0 -0
  318. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_user_gui_findings_20261021.py +0 -0
  319. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_user_guide_menus.py +0 -0
  320. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_video_support.py +0 -0
  321. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_zarr_stress_findings.py +0 -0
  322. {pyfigures-0.2.4 → pyfigures-0.2.5}/tests/test_zoom_callout_gui.py +0 -0
  323. {pyfigures-0.2.4 → pyfigures-0.2.5}/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.4
3
+ Version: 0.2.5
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
@@ -36,7 +36,7 @@ Requires-Dist: QtPy>=2.1.0
36
36
  Requires-Dist: Deprecated
37
37
  Requires-Dist: Requests
38
38
  Requires-Dist: batoolset>=0.2.0
39
- Requires-Dist: batoolset-gui>=0.2.0
39
+ Requires-Dist: batoolset-gui>=0.2.4
40
40
  Requires-Dist: staplot>=0.1.0
41
41
  Requires-Dist: pyautogui
42
42
  Requires-Dist: imagecodecs
@@ -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.3
49
+ Requires-Dist: qtpy-ai-sidecar>=0.1.4
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.3; extra == "chat"
66
+ Requires-Dist: qtpy-ai-sidecar>=0.1.4; 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.3; extra == "all"
69
+ Requires-Dist: qtpy-ai-sidecar>=0.1.4; 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"
@@ -219,7 +219,9 @@ def prepare_inset(obj, changes):
219
219
  allowed={'size_fraction',INSET_SIZE,'border_size','border_color'}
220
220
  if not changes or set(changes)-allowed:
221
221
  raise ValueError('Inset changes: size_fraction (width as a share of the panel width, 0-1; '
222
- '"larger" = a bigger fraction than the current one), border_size, border_color')
222
+ '"larger" = a bigger fraction than the current one), border_size, border_color. '
223
+ 'The region an inset shows comes from its ROI: edit the ROI geometry, then '
224
+ 'remove_inset and roi_to_inset again (crops are margins per edge, not coordinates).')
223
225
  plan={}
224
226
  for key,v in changes.items():
225
227
  if key in ('size_fraction',INSET_SIZE):
@@ -16,7 +16,8 @@ COMMON_CONTRACTS = ('edit_panel_letters', 'swap_live_panels', 'remove_annotation
16
16
  CONTRACT_SCOPE = {
17
17
  'swap_rows': 'exchanges WHOLE rows; to reorder panels inside one row use reorder_children',
18
18
  'reorder_children': 'reorders the panels WITHIN one row/group, e.g. reversing a row',
19
- 'set_panel_letter_position': 'GLOBAL default letter placement for every panel, not one selected panel letter',
19
+ 'set_panel_letter_position': 'GLOBAL default letter placement for every panel (a corner INSIDE it), not one '
20
+ 'selected panel letter; letters OUTSIDE the panels = set_panel_letter_layout row',
20
21
  'delete_last_rows': 'removes WHOLE rows from the end; only on an explicit removal request',
21
22
  'swap_live_panels': 'exchanges two panels, keeping their letters in place',
22
23
  }
@@ -126,7 +126,7 @@ def run_live_pyfigures_tools(session_id: str, expected_revision: int, request_id
126
126
 
127
127
  @mcp.tool()
128
128
  def set_panel_letter_position(placement: str = 'top left') -> dict:
129
- """Move the existing automatic PANEL LETTERS (A, B, C...) to a corner of every image. Updates the figure's global lettering position so GUI auto-lettering preserves it on refresh. Use top left, top right, bottom left or bottom right. Preserve letters, font, size, colors and other annotations. One GUI undo step; no source save. For moving panel letters use this instead of deleting them or adding ordinary corner labels, which auto-lettering can replace."""
129
+ """Move the existing automatic PANEL LETTERS (A, B, C...) to a corner of every image. Updates the figure's global lettering position so GUI auto-lettering preserves it on refresh. Use top left, top right, bottom left or bottom right. Preserve letters, font, size, colors and other annotations. One GUI undo step; no source save. For moving panel letters use this instead of deleting them or adding ordinary corner labels, which auto-lettering can replace. Letters OUTSIDE the panels (one per row, in a left margin) are set_panel_letter_layout(letter_layout="row"), not a placement."""
130
130
  return call_live('bulk_letters', {'action': 'style', 'placement': placement})
131
131
 
132
132
 
@@ -143,7 +143,7 @@ def edit_panel_letters(action: Literal['style','remove','restore','renumber'] =
143
143
  color: str | int | None = None, background: str | int | None = None,
144
144
  start_letter: str | None = None, replace_overrides: bool = False,
145
145
  removal_request: str | None = None) -> dict:
146
- """Scope rules: use scope=all for all panel letters and omit panel_ids/group_path. scope=panels requires a nonempty panel_ids list; scope=selection uses the current selection. Pass ONLY changed fields, never the full letter_styles readback: opacity/bold/italic/underline are not accepted. For italic/bold/underline, call restyle_texts(target=letters) directly; do not call this operation first. Preferred ONE-CALL bulk operation for panel-letter placement, font family/size, color/background, removal and restoration. For bold/italic/underline use restyle_texts(target=letters); those are not fields of this function. placement accepts center/centre/middle or a corner. action=style preserves existing text; renumber scope=all creates a complete unique sequence for a newly constructed figure when asked to letter the panels; partial restore preserves existing IDs and is not a whole-figure renumber; remove requires removal_request quoting an explicit user request to remove/hide letters (never a swap), and hides panel letters persistently without deleting captions/scale bars; restore without start_letter preserves an existing or hidden panel text and otherwise uses its automatic position; explicit start_letter sets a new sequence; renumber changes sequence. scope=auto infers panels from panel_ids, group from group_path, otherwise all; explicit panels/group/selection/all are supported. Supplying panel_ids can never broaden to all panels. For WHITE Arial 12 with NO background use color="white", font_family="Arial", font_size=12, background="none". Black is a color, NOT transparent. Unspecified appearance is preserved. Per-panel overrides survive whole-figure style changes unless replace_overrides=true. One undo step. Returns actual styles, changed/skipped counts, and recovery status. Do not loop over individual annotations for figure/group requests."""
146
+ """Scope rules: use scope=all for all panel letters and omit panel_ids/group_path. scope=panels requires a nonempty panel_ids list; scope=selection uses the current selection. Pass ONLY changed fields, never the full letter_styles readback: opacity/bold/italic/underline are not accepted. For italic/bold/underline, call restyle_texts(target=letters) directly; do not call this operation first. Preferred ONE-CALL bulk operation for panel-letter placement, font family/size, color/background, removal and restoration. For bold/italic/underline use restyle_texts(target=letters); those are not fields of this function. placement accepts center/centre/middle or a corner (inside the panel); letters OUTSIDE the panels = set_panel_letter_layout(letter_layout="row"). action=style preserves existing text; renumber scope=all creates a complete unique sequence for a newly constructed figure when asked to letter the panels; partial restore preserves existing IDs and is not a whole-figure renumber; remove requires removal_request quoting an explicit user request to remove/hide letters (never a swap), and hides panel letters persistently without deleting captions/scale bars; restore without start_letter preserves an existing or hidden panel text and otherwise uses its automatic position; explicit start_letter sets a new sequence; renumber changes sequence. scope=auto infers panels from panel_ids, group from group_path, otherwise all; explicit panels/group/selection/all are supported. Supplying panel_ids can never broaden to all panels. For WHITE Arial 12 with NO background use color="white", font_family="Arial", font_size=12, background="none". Black is a color, NOT transparent. Unspecified appearance is preserved. Per-panel overrides survive whole-figure style changes unless replace_overrides=true. One undo step. Returns actual styles, changed/skipped counts, and recovery status. Do not loop over individual annotations for figure/group requests. With one letter per row (letter_layout row) the row letters share the figure letter style: action=style scope=all restyles them (font, size, color, background; row_letters_restyled lists them, outcome VERIFIED_CHANGE)."""
147
147
  if scope == 'panels' and not panel_ids:
148
148
  raise ValueError('scope=panels requires a nonempty panel_ids list. For an explicit all-panel lettering request use scope=all and omit panel_ids; otherwise inspect and provide the intended panel IDs. No edit was submitted.')
149
149
  if panel_ids and scope in ('auto', 'all'):
@@ -695,6 +695,21 @@ class PartnerGUI(BaseGUI):
695
695
  raise ValueError('group_path is required for group scope')
696
696
  if scope == 'panels' and not panel_ids:
697
697
  raise ValueError('panel_ids from inspect_panel_letters are required')
698
+ from pyfigures.gui.row_letters import normalise_layout
699
+ row_mode = normalise_layout(getattr(self.paint.EZFIG_panel, 'letter_layout', None)) == 'row'
700
+ if row_mode and action == 'style' and scope != 'all':
701
+ raise ValueError('The figure has one letter per row (outside the rows): those letters share one '
702
+ 'style, so style them with scope="all".')
703
+ if placement is not None and re.search(r'\b(outside|outer|margin|per row|beside)\b', str(placement).lower()):
704
+ # "put letters outside": a model passed placement="outside", got
705
+ # "Use a corner", undid the row letters it had just set and searched
706
+ # until stopped (2026-11-06)
707
+ if row_mode:
708
+ raise ValueError('ALREADY_DONE: the letters are already outside the panels (one per row, in a '
709
+ 'margin on the left). Nothing to change; report that to the user.')
710
+ raise ValueError('Letters outside the panels: call set_panel_letter_layout(letter_layout="row") '
711
+ '(one letter per row, in a margin left of the row). Letters of single panels '
712
+ 'always sit in a corner inside the panel; placement takes a corner.')
698
713
  if placement is not None:
699
714
  placement = ' '.join(placement.lower().replace('-', ' ').split())
700
715
  placement = placement.replace('upper', 'top').replace('lower', 'bottom')
@@ -744,13 +759,15 @@ class PartnerGUI(BaseGUI):
744
759
  return {'matched': len(candidates)}
745
760
  changed, skipped = [], []
746
761
  before_states = {pid: [letter_info(a) for a in letters(panel)] for pid, panel in candidates}
762
+ row_style_before = self._row_letter_style() if row_mode else None
747
763
  for pid, panel in candidates:
748
764
  existing = letters(panel)
749
765
  policy = json.loads(getattr(panel, POLICY, '{}'))
750
766
  if not policy.get('base') and existing:
751
767
  policy['base'] = letter_info(existing[0])
752
768
  if action == 'style' and not existing:
753
- skipped.append({'panel_id': pid, 'reason': 'No panel letter; use restore to add it'})
769
+ if not row_mode: # lettered per row: no letter in a panel is expected
770
+ skipped.append({'panel_id': pid, 'reason': 'No panel letter; use restore to add it'})
754
771
  continue
755
772
  local = set(policy.get('local_fields', []))
756
773
  if replace_overrides and scope == 'all':
@@ -811,10 +828,26 @@ class PartnerGUI(BaseGUI):
811
828
  self.serializable_font.background = None if fill is None else int(fill[1:], 16)
812
829
  self.update_letters()
813
830
  changed = [pid for pid, panel in candidates if before_states[pid] != [letter_info(a) for a in letters(panel)]]
814
- return {'matched': len(candidates), 'matched_panel_ids': [pid for pid, _ in candidates],
815
- 'changed': len(changed), 'changed_panel_ids': changed,
816
- 'skipped': skipped, 'scope': scope, 'action': action,
817
- 'warnings': ['Explicit colors are honored; white on bright image content may be hard to see.'] if foreground == '#ffffff' and fill is None else []}
831
+ report = {'matched': len(candidates), 'matched_panel_ids': [pid for pid, _ in candidates],
832
+ 'changed': len(changed), 'changed_panel_ids': changed,
833
+ 'skipped': skipped, 'scope': scope, 'action': action,
834
+ 'warnings': ['Explicit colors are honored; white on bright image content may be hard to see.'] if foreground == '#ffffff' and fill is None else []}
835
+ if row_mode:
836
+ # the row letters are drawn from the figure letter font set above:
837
+ # report them, or "0 changed" sent the chat looking for another
838
+ # tool for a minute although the edit was done (2026-11-06)
839
+ restyled = self._row_letter_style() != row_style_before
840
+ report['letter_layout'] = 'row'
841
+ report['row_letters_restyled'] = (
842
+ [t.getPlainText() for _, t in self.paint.EZFIG_panel._row_letter_texts()] if restyled else [])
843
+ if placement is not None:
844
+ report['warnings'].append('Row letters always sit outside the rows on the left; placement '
845
+ 'only applies to letters inside panels.')
846
+ return report
847
+
848
+ def _row_letter_style(self):
849
+ f = self.serializable_font
850
+ return (f.toString(), getattr(f, 'foreground', None), getattr(f, 'background', None))
818
851
 
819
852
  def swap_panels(self, first, second, target='images', validate_only=False):
820
853
  if target not in ('images', 'letters'):
@@ -450,7 +450,8 @@ class Session:
450
450
  report['visible_letter_count_after'] = verified['visible_letter_count']
451
451
  report['unlettered_panel_ids'] = verified['unlettered_panel_ids']
452
452
  report['outcome'] = ('LETTERS_REMOVED' if report['action'] == 'remove' else
453
- 'NO_VISIBLE_CHANGE' if not report['changed'] else 'VERIFIED_CHANGE')
453
+ 'NO_VISIBLE_CHANGE' if not report['changed'] and not report.get('row_letters_restyled')
454
+ else 'VERIFIED_CHANGE')
454
455
  if ungroup:
455
456
  report['outcome'] = ('LAYOUT_REFRESHED' if report.get('layout_changed') else 'ALREADY_UNGROUPED') if report['already_ungrouped'] else 'VERIFIED_STRUCTURE_CHANGE'
456
457
  affected = set(report['changed_panel_ids'])
@@ -244,6 +244,20 @@ def _has_empty_group(shapes):
244
244
  return False
245
245
 
246
246
 
247
+ def _pixels_pending(img2d, pending):
248
+ """Mark a panel whose pixels are loading in the background (lazy open):
249
+ batoolset-gui draws it as "Loading…" rather than a red "Error". The mark
250
+ lives on the class, never on the panel, so it is not saved with it."""
251
+ marks = Image2D.__dict__.get('pixels_pending')
252
+ if marks is None: # batoolset-gui < 0.2.4: keeps showing "Error"
253
+ marks = set()
254
+ Image2D.pixels_pending = marks
255
+ if pending:
256
+ marks.add(id(img2d))
257
+ else:
258
+ marks.discard(id(img2d))
259
+
260
+
247
261
  def _qt_alive(obj):
248
262
  """False once the C++ side of a Qt wrapper has been destroyed — a queued
249
263
  loader callback arriving after its window was deleted must not touch it
@@ -4073,6 +4087,9 @@ class EZFIG_GUI(QMainWindow):
4073
4087
  obj = stack.pop()
4074
4088
  if isinstance(obj, Image2D):
4075
4089
  if obj.filename is not None and obj.img is None and obj.filename != '@template@':
4090
+ # drawn as "Loading…", not as a red "Error", until
4091
+ # its pixels arrive (or fail: _on_img_ready)
4092
+ _pixels_pending(obj, True)
4076
4093
  pending.append(obj)
4077
4094
  if hasattr(obj, 'content') and obj.content:
4078
4095
  stack.extend(obj.content)
@@ -4149,6 +4166,7 @@ class EZFIG_GUI(QMainWindow):
4149
4166
  if not _qt_alive(self) or getattr(self, '_lazy_generation', 0) != gen:
4150
4167
  return # window gone, or loading cancelled (New/replace) — discard
4151
4168
  img = lazy_results.get(path)
4169
+ _pixels_pending(img2d, False) # loaded, or a real error from now on
4152
4170
  if isinstance(img, _LoadFailed):
4153
4171
  # the panel stays empty (its img None): set as the image, the
4154
4172
  # sentinel left the panel without a qimage and every repaint
@@ -4177,6 +4195,7 @@ class EZFIG_GUI(QMainWindow):
4177
4195
  self._schedule_lazy_refresh()
4178
4196
 
4179
4197
  def _on_finished():
4198
+ _pixels_pending(img2d, False) # even if no result came back
4180
4199
  if not _qt_alive(self):
4181
4200
  return # the window was destroyed while this image was loading
4182
4201
  try:
@@ -4362,6 +4381,8 @@ class EZFIG_GUI(QMainWindow):
4362
4381
  finishes and is discarded instead of flooding the UI thread with
4363
4382
  update_qimage()/repaint work for images no longer on the canvas."""
4364
4383
  self._lazy_generation = getattr(self, '_lazy_generation', 0) + 1
4384
+ for img2d in getattr(self, '_lazy_img_queue', None) or []:
4385
+ _pixels_pending(img2d, False)
4365
4386
  self._lazy_img_queue = []
4366
4387
  QApplication.restoreOverrideCursor()
4367
4388
  try:
@@ -85,16 +85,37 @@ def zoom_links(shapes, moved, moving=()):
85
85
  for line, end1, end2 in _leaders(shapes, moved, _shown_rect(inset), moving):
86
86
  links.append((line, 1 if end1 == 'box' else 2))
87
87
  if not any(inset is m for m in moving):
88
- links.append(('crop', inset))
88
+ links.append(('crop', (inset, moved)))
89
89
  return links
90
90
 
91
91
 
92
+ def _crop_to_box(inset, box):
93
+ """Set the inset's crop margins so it shows exactly what *box* covers (as
94
+ roi_to_inset makes it). False when the image size is unknown."""
95
+ try:
96
+ w, h = inset.get_raw_size()
97
+ except Exception:
98
+ return False
99
+ if not w or not h:
100
+ return False
101
+ x0 = min(max(0, int(round(box.x()))), int(w) - 1)
102
+ y0 = min(max(0, int(round(box.y()))), int(h) - 1)
103
+ x1 = min(max(x0 + 1, int(round(box.x() + box.width()))), int(w))
104
+ y1 = min(max(y0 + 1, int(round(box.y() + box.height()))), int(h))
105
+ inset.crop(x0, int(w) - x1, y0, int(h) - y1)
106
+ return True
107
+
108
+
92
109
  def follow_zoom_links(links, delta):
93
- """Move the linked leader ends by *delta*; shift the inset's crop with a
94
- moved box (its magnified region follows the box)."""
110
+ """Move the linked leader ends by *delta*; with a moved box, the inset
111
+ shows what the box now covers. (Its crop used to be shifted by *delta*: a
112
+ crop already wrong — margins entered as coordinates, the inset 0 px wide —
113
+ stayed wrong, 2026-11-06.)"""
95
114
  for target, what in links:
96
115
  if target == 'crop':
97
- inset = what
116
+ inset, box = what
117
+ if _crop_to_box(inset, box):
118
+ continue
98
119
  dx, dy = int(round(delta.x())), int(round(delta.y()))
99
120
  w = inset.crop_left + inset.crop_right
100
121
  h = inset.crop_top + inset.crop_bottom
@@ -1552,6 +1552,12 @@ def set_label_background(
1552
1552
  what = "removed from" if value == "None" else f"set to {color} on"
1553
1553
  note = (f" {recoloured} text(s) the colour of the box now {'white' if new_col == '#ffffff' else 'black'}."
1554
1554
  if recoloured else "")
1555
+ # lettered per row, the letters are not in the panels (0 labels above)
1556
+ # but drawn from the figure letter font, which was just set: say so, or
1557
+ # "0 label(s)" reads as a failure (2026-11-06)
1558
+ if include_letters and not group_path and letter_layout_of(root)["letter_layout"] == "row":
1559
+ note += (" The row letters (one per row, outside on the left) "
1560
+ + ("have no box any more." if value == "None" else f"now have a {color} box."))
1555
1561
  return f"Label background {what} {n} label(s).{note}"
1556
1562
 
1557
1563
 
@@ -1013,7 +1013,9 @@ def set_inset_property(
1013
1013
  │ border_size │ "5" │
1014
1014
  │ border_color │ "16776960" (yellow) │
1015
1015
  │ filename │ "/new/path/detail.png" │
1016
- │ crop_left / crop_right / crop_top / crop_bottom │ "20" │
1016
+ │ crop_left / crop_right / crop_top / crop_bottom │ "20" (px cut away │
1017
+ │ from that EDGE, not a coordinate: x 275-375 of │ a 650 px image = │
1018
+ │ a 650 px wide image is left 275, right 275) │ left 275 right 275) │
1017
1019
  │ opacity │ "0.8" │
1018
1020
  │ LUTs │ "['GREEN', None, None]" │
1019
1021
  │ theta │ "45" │
@@ -1075,6 +1077,17 @@ def set_inset_property(
1075
1077
  if err:
1076
1078
  return err
1077
1079
  _set_child_text(insets[inset_index], property_name, raw)
1080
+ if property_name.startswith("crop_"):
1081
+ # crops are margins cut from each side, not coordinates: a model set
1082
+ # crop_right=375 meaning "up to x 375" next to crop_left=275 on a
1083
+ # 650 px image, and the inset became 0 px wide, invisible (2026-11-06).
1084
+ # The same check as set_image_property / transform_image.
1085
+ from .core import _crop_fit_error
1086
+ crop_err = _crop_fit_error(insets[inset_index])
1087
+ if crop_err:
1088
+ return (f"ERROR: {crop_err} For an inset made from an ROI: move/resize the ROI, then "
1089
+ "remove_inset and roi_to_inset again. "
1090
+ "Nothing was changed.")
1078
1091
  _save(tree, pyf_path)
1079
1092
  stored = _stored_image_property(pyf_path, group_path, image_index, property_name,
1080
1093
  inset_index=inset_index)
@@ -1,6 +1,6 @@
1
1
  __MAJOR__ = 0
2
2
  __MINOR__ = 2
3
- __MICRO__ = 4
3
+ __MICRO__ = 5
4
4
  __RELEASE__ = '' # a #b # https://www.python.org/dev/peps/pep-0440/#public-version-identifiers --> alpha beta, ...
5
5
  __VERSION__ = f'{__MAJOR__}.{__MINOR__}.{__MICRO__}{__RELEASE__}'
6
6
  __DESCRIPTION__ = """PyFigures will assist you assemble publication ready scientific figures in no time."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyfigures
3
- Version: 0.2.4
3
+ Version: 0.2.5
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
@@ -36,7 +36,7 @@ Requires-Dist: QtPy>=2.1.0
36
36
  Requires-Dist: Deprecated
37
37
  Requires-Dist: Requests
38
38
  Requires-Dist: batoolset>=0.2.0
39
- Requires-Dist: batoolset-gui>=0.2.0
39
+ Requires-Dist: batoolset-gui>=0.2.4
40
40
  Requires-Dist: staplot>=0.1.0
41
41
  Requires-Dist: pyautogui
42
42
  Requires-Dist: imagecodecs
@@ -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.3
49
+ Requires-Dist: qtpy-ai-sidecar>=0.1.4
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.3; extra == "chat"
66
+ Requires-Dist: qtpy-ai-sidecar>=0.1.4; 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.3; extra == "all"
69
+ Requires-Dist: qtpy-ai-sidecar>=0.1.4; 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"
@@ -190,6 +190,7 @@ tests/test_editable_export.py
190
190
  tests/test_editable_plot_text.py
191
191
  tests/test_editor_interaction.py
192
192
  tests/test_editor_rotate_and_tool_20261105.py
193
+ tests/test_empty_inset_roi_20261106.py
193
194
  tests/test_equations.py
194
195
  tests/test_exception_handler.py
195
196
  tests/test_export_waits_for_images.py
@@ -217,6 +218,7 @@ tests/test_gui_workflow_actions.py
217
218
  tests/test_guide_routing.py
218
219
  tests/test_image_opacity_reload.py
219
220
  tests/test_image_search.py
221
+ tests/test_inset_crop_margins_20261106.py
220
222
  tests/test_integrity_and_stats.py
221
223
  tests/test_interactive_tools.py
222
224
  tests/test_internal_dnd_group_placement.py
@@ -231,6 +233,7 @@ tests/test_launchers.py
231
233
  tests/test_layout_canvas_geometry.py
232
234
  tests/test_layout_formula.py
233
235
  tests/test_layout_stability_gui.py
236
+ tests/test_lazy_loading_placeholder_20261106.py
234
237
  tests/test_lazy_reflow.py
235
238
  tests/test_lettering_restore.py
236
239
  tests/test_licensing.py
@@ -280,6 +283,7 @@ tests/test_recordings.py
280
283
  tests/test_render_export.py
281
284
  tests/test_restyle_texts.py
282
285
  tests/test_review_and_library.py
286
+ tests/test_row_letters_chat_style_20261106.py
283
287
  tests/test_row_letters_gui.py
284
288
  tests/test_ruler_labels.py
285
289
  tests/test_save_reminder.py
@@ -22,7 +22,7 @@ QtPy>=2.1.0
22
22
  Deprecated
23
23
  Requests
24
24
  batoolset>=0.2.0
25
- batoolset-gui>=0.2.0
25
+ batoolset-gui>=0.2.4
26
26
  staplot>=0.1.0
27
27
  pyautogui
28
28
  imagecodecs
@@ -32,7 +32,7 @@ latex2mathml
32
32
  mathml2omml
33
33
  pylatexenc
34
34
  pypdfium2
35
- qtpy-ai-sidecar>=0.1.3
35
+ qtpy-ai-sidecar>=0.1.4
36
36
  mcp<2,>=1.12
37
37
 
38
38
  [ai]
@@ -40,7 +40,7 @@ mcp<2,>=1.12
40
40
 
41
41
  [all]
42
42
  mcp<2,>=1.12
43
- qtpy-ai-sidecar>=0.1.3
43
+ qtpy-ai-sidecar>=0.1.4
44
44
  av
45
45
  opencv-python-headless
46
46
  pyimagej
@@ -51,7 +51,7 @@ zarr>=3
51
51
 
52
52
  [chat]
53
53
  mcp<2,>=1.12
54
- qtpy-ai-sidecar>=0.1.3
54
+ qtpy-ai-sidecar>=0.1.4
55
55
 
56
56
  [fiji]
57
57
  pyimagej
@@ -62,7 +62,7 @@ setuptools.setup(
62
62
  "Deprecated",
63
63
  "Requests",
64
64
  "batoolset>=0.2.0", # 0.2.0: the split, the Qt layer moved to batoolset-gui
65
- "batoolset-gui>=0.2.0", # batoolset.drawings / figure / luts / pyqts (Qt layer); inverted LUTs
65
+ "batoolset-gui>=0.2.4", # Qt layer; 0.2.4: "Loading…" placeholder, empty insets no longer hide annotations
66
66
  "staplot>=0.1.0", # data-plot panels and stats brackets (staplot.api)
67
67
  "pyautogui",
68
68
  "imagecodecs",
@@ -74,7 +74,7 @@ setuptools.setup(
74
74
  "pypdfium2", # PDF files as panels, rendered as images (Apache/BSD)
75
75
  # the chat sidebar (Tools > Chat sidebar, a core part of PyFigures): a
76
76
  # local or API model edits the open figure through the MCP tools (BSD-2)
77
- "qtpy-ai-sidecar>=0.1.3",
77
+ "qtpy-ai-sidecar>=0.1.4",
78
78
  "mcp>=1.12,<2", # MCP server (Claude, LM Studio…) and the sidebar's client; mcp 2 renamed FastMCP
79
79
  ],
80
80
  extras_require={
@@ -105,11 +105,11 @@ setuptools.setup(
105
105
  # `pip install pyfigures[chat]` from older instructions still works
106
106
  'chat': [
107
107
  "mcp>=1.12,<2",
108
- "qtpy-ai-sidecar>=0.1.3",
108
+ "qtpy-ai-sidecar>=0.1.4",
109
109
  ],
110
110
  'all': [
111
111
  "mcp>=1.12,<2",
112
- "qtpy-ai-sidecar>=0.1.3",
112
+ "qtpy-ai-sidecar>=0.1.4",
113
113
  "av",
114
114
  "opencv-python-headless",
115
115
  "pyimagej",
@@ -0,0 +1,62 @@
1
+ """User report 2026-11-06: a rectangle moved in the panel editor was not on the
2
+ canvas after Ok, though the editor showed it. The panel's inset had been
3
+ cropped to 0 px (margins entered as coordinates): sizing it raised
4
+ ZeroDivisionError, which aborted ALL the panel's annotations. Moving the box
5
+ only shifted that broken crop. Now an inset cropped to nothing is skipped
6
+ (no image, no border bar), the other annotations are drawn, and the inset
7
+ of a moved box shows exactly what the box covers."""
8
+ from __future__ import annotations
9
+
10
+ import os
11
+
12
+ os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
13
+ os.environ.setdefault("QT_API", "pyqt6")
14
+
15
+ from test_user_findings_20261022 import _callout # noqa: E402
16
+
17
+
18
+ def _parts(panel):
19
+ from batoolset.drawings.shapes.image2d import Image2D
20
+ from batoolset.drawings.shapes.line2d import Line2D
21
+ box = next(a for a in panel.annotations if type(a).__name__ == "Rectangle2D")
22
+ inset = next(a for a in panel.annotations if isinstance(a, Image2D))
23
+ lines = [a for a in panel.annotations if isinstance(a, Line2D)]
24
+ return box, inset, lines
25
+
26
+
27
+ def test_an_inset_cropped_to_nothing_does_not_hide_the_other_annotations(qapp, tmp_path):
28
+ from qtpy.QtGui import QImage, QPainter
29
+ panel = _callout(tmp_path)
30
+ box, inset, lines = _parts(panel)
31
+ w, _ = inset.get_raw_size()
32
+ inset.crop_left, inset.crop_right = 40, w - 40 # 0 px left
33
+ assert inset._cropped_to_nothing()
34
+ drawn = []
35
+ for shape in [box, *lines]:
36
+ real = shape.draw
37
+ shape.draw = lambda *a, _r=real, _s=shape, **k: (drawn.append(_s), _r(*a, **k))[1]
38
+ inset_drawn = []
39
+ real_bg = inset.draw_bg
40
+ inset.draw_bg = lambda *a, **k: (inset_drawn.append(1), real_bg(*a, **k))[1]
41
+ img = QImage(600, 400, QImage.Format.Format_ARGB32)
42
+ p = QPainter(img)
43
+ panel.draw(p)
44
+ p.end()
45
+ assert box in drawn and all(line in drawn for line in lines)
46
+ assert inset_drawn == [] # no stray border bar
47
+
48
+
49
+ def test_moving_the_box_gives_the_inset_the_box_region(qapp, tmp_path):
50
+ from qtpy.QtCore import QPointF
51
+ from pyfigures.gui.zoom_links import zoom_links, follow_zoom_links
52
+ panel = _callout(tmp_path)
53
+ box, inset, _ = _parts(panel)
54
+ w, h = inset.get_raw_size()
55
+ inset.crop(int(box.x()), int(w - box.x()), int(box.y()), int(h - box.y())) # broken: 0 px
56
+ links = zoom_links(panel.annotations, box)
57
+ d = QPointF(15, -10)
58
+ box.translate(d)
59
+ follow_zoom_links(links, d)
60
+ assert (inset.crop_left, inset.crop_top) == (int(box.x()), int(box.y()))
61
+ assert (inset.crop_right, inset.crop_bottom) == (int(w - box.x() - box.width()), int(h - box.y() - box.height()))
62
+ assert not inset._cropped_to_nothing()
@@ -0,0 +1,51 @@
1
+ """User report 2026-11-06 ("there is no inset"): the chat set an inset's
2
+ crop_right=375 / crop_bottom=307 meaning "up to x 375 / y 307" next to
3
+ crop_left=275 / crop_top=207 on a 650 x 514 px image. Crops are margins cut
4
+ from each edge, so the inset kept 0 px and vanished; set_inset_property
5
+ accepted it. It now refuses a crop that removes the whole image (or leaves a
6
+ sliver), as set_image_property already did, and says what to do."""
7
+ from __future__ import annotations
8
+
9
+ import json
10
+ import os
11
+
12
+ import numpy as np
13
+
14
+ os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
15
+ os.environ.setdefault("QT_API", "pyqt6")
16
+
17
+
18
+ def _figure(tmp_path):
19
+ from PIL import Image
20
+ from pyfigures.mcp_server import create_figure, add_image, add_inset
21
+ img = tmp_path / "big.png"
22
+ Image.fromarray(np.random.default_rng(0).integers(0, 255, (514, 650), dtype=np.uint8)).save(img)
23
+ pyf = str(tmp_path / "fig.pyf")
24
+ create_figure(pyf, mode="groups", num_groups=1, orientation="X", spacing=3)
25
+ add_image(pyf, [0], str(img))
26
+ add_inset(pyf, [0], 0, str(img))
27
+ return pyf
28
+
29
+
30
+ def _crops(pyf):
31
+ from pyfigures.mcp_server import list_insets
32
+ inset = json.loads(list_insets(pyf, [0], 0))[0]
33
+ return {k: inset[f"crop_{k}"] for k in ("left", "right", "top", "bottom")}
34
+
35
+
36
+ def test_coordinates_given_as_crops_are_refused(tmp_path):
37
+ from pyfigures.mcp_server import set_inset_property
38
+ pyf = _figure(tmp_path)
39
+ assert "read back" in set_inset_property(pyf, [0], 0, 0, "crop_left", 275)
40
+ out = set_inset_property(pyf, [0], 0, 0, "crop_right", 375)
41
+ assert out.startswith("ERROR") and "not x1/y1/x2/y2 coordinates" in out and "Nothing was changed" in out
42
+ assert "crop_right=275" in out # keep x 275 to 375 of 650 px: right margin 275
43
+ assert _crops(pyf)["right"] == 0 # the file kept the inset visible
44
+
45
+
46
+ def test_margins_are_accepted(tmp_path):
47
+ from pyfigures.mcp_server import set_inset_property
48
+ pyf = _figure(tmp_path)
49
+ for name, v in (("crop_left", 275), ("crop_right", 275), ("crop_top", 207), ("crop_bottom", 207)):
50
+ assert "read back" in set_inset_property(pyf, [0], 0, 0, name, v)
51
+ assert _crops(pyf) == {"left": 275, "right": 275, "top": 207, "bottom": 207}