ms-components 0.6.0__tar.gz → 0.7.0__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 (148) hide show
  1. {ms_components-0.6.0 → ms_components-0.7.0}/PKG-INFO +1 -1
  2. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_monitor/bridge.py +5 -1
  3. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_monitor/detail.py +2 -1
  4. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_monitor/jobs.py +2 -2
  5. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_monitor/models.py +6 -0
  6. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_monitor/polling.py +17 -0
  7. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components.egg-info/PKG-INFO +1 -1
  8. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components.egg-info/scm_version.json +2 -2
  9. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_molsuite_monitor_bridge.py +22 -0
  10. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_molsuite_monitor_widgets.py +9 -0
  11. {ms_components-0.6.0 → ms_components-0.7.0}/.github/workflows/docs.yml +0 -0
  12. {ms_components-0.6.0 → ms_components-0.7.0}/.github/workflows/publish.yml +0 -0
  13. {ms_components-0.6.0 → ms_components-0.7.0}/.gitignore +0 -0
  14. {ms_components-0.6.0 → ms_components-0.7.0}/LICENSE +0 -0
  15. {ms_components-0.6.0 → ms_components-0.7.0}/MANIFEST.in +0 -0
  16. {ms_components-0.6.0 → ms_components-0.7.0}/README.md +0 -0
  17. {ms_components-0.6.0 → ms_components-0.7.0}/examples/tutorial_demo.py +0 -0
  18. {ms_components-0.6.0 → ms_components-0.7.0}/examples/tutorial_demo.toml +0 -0
  19. {ms_components-0.6.0 → ms_components-0.7.0}/licenses/lucide-LICENSE.txt +0 -0
  20. {ms_components-0.6.0 → ms_components-0.7.0}/licenses/qt-themes-LICENSE.txt +0 -0
  21. {ms_components-0.6.0 → ms_components-0.7.0}/pyproject.toml +0 -0
  22. {ms_components-0.6.0 → ms_components-0.7.0}/setup.cfg +0 -0
  23. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/__init__.py +0 -0
  24. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/backdrop.py +0 -0
  25. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/base.qss +0 -0
  26. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/chips.py +0 -0
  27. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ketcher.py +0 -0
  28. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/labels.py +0 -0
  29. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/listview.py +0 -0
  30. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_dockwidget/__init__.py +0 -0
  31. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_dockwidget/resources/__init__.py +0 -0
  32. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_dockwidget/resources/icons/__init__.py +0 -0
  33. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_dockwidget/resources/icons/folder.svg +0 -0
  34. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_dockwidget/widget.py +0 -0
  35. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_executors.py +0 -0
  36. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_monitor/__init__.py +0 -0
  37. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_monitor/config.py +0 -0
  38. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_monitor/formatting.py +0 -0
  39. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_monitor/icons/cpu.svg +0 -0
  40. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_monitor/icons/gpu.svg +0 -0
  41. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_monitor/icons/memory.svg +0 -0
  42. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_monitor/palette.py +0 -0
  43. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_monitor/resources.py +0 -0
  44. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_monitor/widget.py +0 -0
  45. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_projects/__init__.py +0 -0
  46. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_projects/app.py +0 -0
  47. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_projects/backend.py +0 -0
  48. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_projects/browser.py +0 -0
  49. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_projects/scratch.py +0 -0
  50. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_projects/widget.py +0 -0
  51. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/__init__.py +0 -0
  52. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/command_line.py +0 -0
  53. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/actions.svg +0 -0
  54. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/box.svg +0 -0
  55. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/center.svg +0 -0
  56. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/display.svg +0 -0
  57. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/export.svg +0 -0
  58. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/hide.svg +0 -0
  59. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/hydrogens-polar.svg +0 -0
  60. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/hydrogens.svg +0 -0
  61. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/menu.svg +0 -0
  62. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/orient.svg +0 -0
  63. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/presets.svg +0 -0
  64. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/rock.svg +0 -0
  65. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/save.svg +0 -0
  66. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/selection.svg +0 -0
  67. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/settings.svg +0 -0
  68. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/style.svg +0 -0
  69. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/icons/zoom.svg +0 -0
  70. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/plugins.py +0 -0
  71. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/scene.py +0 -0
  72. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_pymol/widget.py +0 -0
  73. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_settings/__init__.py +0 -0
  74. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_settings/panel.py +0 -0
  75. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_stepper.py +0 -0
  76. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/__init__.py +0 -0
  77. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/action_header.py +0 -0
  78. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/cell_delegate.py +0 -0
  79. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/column_panel.py +0 -0
  80. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/example_usage.py +0 -0
  81. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/filter_panel.py +0 -0
  82. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/icons/columns.svg +0 -0
  83. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/icons/export.svg +0 -0
  84. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/icons/filter.svg +0 -0
  85. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/icons/menu.svg +0 -0
  86. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/icons/reload.svg +0 -0
  87. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/icons/search.svg +0 -0
  88. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/icons/settings.svg +0 -0
  89. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/icons/sort-asc.svg +0 -0
  90. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/icons/sort-desc.svg +0 -0
  91. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/icons/sort.svg +0 -0
  92. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/metric_filter_bar.py +0 -0
  93. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/pagination_control.py +0 -0
  94. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/query_builder.py +0 -0
  95. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/session_provider.py +0 -0
  96. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/smart_table_view.py +0 -0
  97. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/sort_panel.py +0 -0
  98. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/table_config.py +0 -0
  99. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/table_interaction.py +0 -0
  100. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/table_model.py +0 -0
  101. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/test_external_filters.py +0 -0
  102. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_table/test_toolbar.py +0 -0
  103. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_tutorial/__init__.py +0 -0
  104. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_tutorial/bindings.py +0 -0
  105. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_tutorial/controller.py +0 -0
  106. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_tutorial/models.py +0 -0
  107. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/ms_tutorial/overlay.py +0 -0
  108. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/opengl.py +0 -0
  109. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/pagination.py +0 -0
  110. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/palettes.py +0 -0
  111. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/step_dialog.py +0 -0
  112. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/theme.py +0 -0
  113. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/tool_panel.py +0 -0
  114. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components/wheel.py +0 -0
  115. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components.egg-info/SOURCES.txt +0 -0
  116. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components.egg-info/dependency_links.txt +0 -0
  117. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components.egg-info/requires.txt +0 -0
  118. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components.egg-info/scm_file_list.json +0 -0
  119. {ms_components-0.6.0 → ms_components-0.7.0}/src/ms_components.egg-info/top_level.txt +0 -0
  120. {ms_components-0.6.0 → ms_components-0.7.0}/tests/conftest.py +0 -0
  121. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_app_settings.py +0 -0
  122. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_chips.py +0 -0
  123. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_dock_window.py +0 -0
  124. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_executors_ui.py +0 -0
  125. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_ketcher.py +0 -0
  126. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_monitor_config.py +0 -0
  127. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_ms_projects_widget.py +0 -0
  128. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_opengl.py +0 -0
  129. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_optional_integrations.py +0 -0
  130. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_progress_column.py +0 -0
  131. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_project_browser.py +0 -0
  132. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_pymol_command_line.py +0 -0
  133. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_pymol_grid.py +0 -0
  134. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_pymol_scene.py +0 -0
  135. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_pymol_toolbar.py +0 -0
  136. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_query_builder_keyset.py +0 -0
  137. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_shift_hscroll.py +0 -0
  138. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_split_button_style.py +0 -0
  139. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_step_dialog.py +0 -0
  140. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_table_autofill_lifecycle.py +0 -0
  141. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_table_interaction.py +0 -0
  142. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_table_toolbar.py +0 -0
  143. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_table_view_state.py +0 -0
  144. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_theme_contrast.py +0 -0
  145. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_theme_menu.py +0 -0
  146. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_tool_panel.py +0 -0
  147. {ms_components-0.6.0 → ms_components-0.7.0}/tests/test_tutorial.py +0 -0
  148. {ms_components-0.6.0 → ms_components-0.7.0}/zensical.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ms_components
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: PySide6 UI components for MolSuite: smart table, project browser, job monitor, PyMOL dock, steppers.
5
5
  Author: Mario S. Valdés-Tresanco, Mario E. Valdés-Tresanco
6
6
  License-Expression: MIT
@@ -37,6 +37,7 @@ class MolSuiteMonitorBridge(QObject):
37
37
  resume=None,
38
38
  destinations=None,
39
39
  measure=None,
40
+ title=None,
40
41
  parent: QObject | None = None,
41
42
  ) -> None:
42
43
  """`resume(job_id, executor or None)` and `destinations(job_id) -> names` are for an
@@ -45,7 +46,9 @@ class MolSuiteMonitorBridge(QObject):
45
46
  `measure(job_id) -> {"done": int, "total": int, "unit": str} | None` is what the
46
47
  application counts in a job besides its chunks (the records a chunk holds, say): the
47
48
  monitor shows its rate in that unit. Called on the polling thread, every poll while the
48
- job runs and once after it ends; None for a job it does not measure."""
49
+ job runs and once after it ends; None for a job it does not measure.
50
+ `title(job_id, name) -> str | None` is what the application calls a job ("Docking ·
51
+ gnina", say), shown instead of its name; asked once a job, on the polling thread."""
49
52
  super().__init__(parent)
50
53
  self._workspace = workspace
51
54
  self._resume = resume or self._workspace_resume
@@ -58,6 +61,7 @@ class MolSuiteMonitorBridge(QObject):
58
61
  poll_ms=poll_ms,
59
62
  max_recent_jobs=max_recent_jobs,
60
63
  measure=measure,
64
+ title=title,
61
65
  )
62
66
  self._sync_state = MonitorSyncState()
63
67
  self._connect_poller(self._poller)
@@ -475,7 +475,8 @@ class JobDetail(QWidget):
475
475
  self._set_steps(None)
476
476
  return
477
477
  hue = status_color(job.status)
478
- self._name.setText(job.name or job.job_id[:8])
478
+ self._name.setText(job.label)
479
+ self._name.setToolTip(job.name if job.title else "")
479
480
  badge, badge_hue = badge_of(job)
480
481
  self._badge.setText(badge)
481
482
  self._badge.setToolTip(job.unreachable)
@@ -183,7 +183,7 @@ class _JobRow(QStyledItemDelegate):
183
183
  failed_w = p.fontMetrics().horizontalAdvance(failed) if failed else 0
184
184
  p.setFont(font)
185
185
  room = brect.left() - x - 8 - failed_w
186
- name = p.fontMetrics().elidedText(job.name or job.job_id[:8], Qt.ElideRight, int(max(0, room)))
186
+ name = p.fontMetrics().elidedText(job.label, Qt.ElideRight, int(max(0, room)))
187
187
  p.setPen(text)
188
188
  p.drawText(QRectF(x, top, room, 18), Qt.AlignLeft | Qt.AlignVCenter, name)
189
189
  if failed:
@@ -303,7 +303,7 @@ class JobList(QListWidget):
303
303
  job = self.item(i).data(_ROLE)
304
304
  shown = (
305
305
  (self._status == "all" or job.status == self._status)
306
- and (not self._search or self._search in f"{job.name} {job.job_id} {job.status} {job.executor or ''}".lower())
306
+ and (not self._search or self._search in f"{job.label} {job.name} {job.job_id} {job.status} {job.executor or ''}".lower())
307
307
  and (self._executors is None or job.executor in self._executors)
308
308
  )
309
309
  self.item(i).setHidden(not shown)
@@ -38,6 +38,7 @@ class JobMonitorState:
38
38
  job_id: str # the key of the job in the project's journal
39
39
  engine_id: int | None = None # its id in this session's engine; None for a job of another session
40
40
  name: str = ""
41
+ title: str = "" # what the application calls it (`title(job_id, name)`); "" shows `name`
41
42
  executor: str | None = None # the name it was submitted to
42
43
  status: str = "waiting"
43
44
  error: str = ""
@@ -90,6 +91,11 @@ class JobMonitorState:
90
91
  """It completed without a chunk to run (its source had no work: everything was skipped)."""
91
92
  return self.status == "completed" and not (self.chunks_total or self.chunks_settled)
92
93
 
94
+ @property
95
+ def label(self) -> str:
96
+ """What the monitor calls it: the application's title, else the job's name, else its key."""
97
+ return self.title or self.name or self.job_id[:8]
98
+
93
99
 
94
100
  @dataclass(slots=True)
95
101
  class JobDetailState:
@@ -87,11 +87,14 @@ class MolSuiteMonitorPoller(QObject):
87
87
  poll_ms: int = 500,
88
88
  max_recent_jobs: int = 20,
89
89
  measure=None,
90
+ title=None,
90
91
  parent: QObject | None = None,
91
92
  ) -> None:
92
93
  super().__init__(parent)
93
94
  self._workspace = workspace
94
95
  self._measure = measure
96
+ self._title = title
97
+ self._titles: dict[str, str] = {} # asked once a job: what it is does not change
95
98
  self._measured: dict[str, dict] = {} # the last word on a job that ended: asked no more
96
99
  # Only poll fast while jobs are active; back off hard when idle.
97
100
  self._active_poll_ms = max(100, poll_ms)
@@ -161,6 +164,18 @@ class MolSuiteMonitorPoller(QObject):
161
164
  self._last_snapshot = snapshot
162
165
  self.project_snapshot_updated.emit(snapshot)
163
166
 
167
+ def _apply_title(self, job: JobMonitorState) -> None:
168
+ """What the application calls `job`, from `title(job_id, name)`: asked once a job."""
169
+ if self._title is None:
170
+ return
171
+ if job.job_id not in self._titles:
172
+ try:
173
+ said = self._title(job.job_id, job.name)
174
+ except Exception: # noqa: BLE001 — a name of the application must never stop the monitor
175
+ said = None
176
+ self._titles[job.job_id] = str(said or "")
177
+ job.title = self._titles[job.job_id]
178
+
164
179
  def _apply_measure(self, job: JobMonitorState, now: float) -> None:
165
180
  """What the application counts in `job`, from `measure(job_id)`: `{"done", "total", "unit"}`
166
181
  or None. A job that ended is asked once more and then kept."""
@@ -195,7 +210,9 @@ class MolSuiteMonitorPoller(QObject):
195
210
  self._speeds.keep(job.job_id for job in jobs)
196
211
  shown = {job.job_id for job in jobs}
197
212
  self._measured = {job_id: said for job_id, said in self._measured.items() if job_id in shown}
213
+ self._titles = {job_id: said for job_id, said in self._titles.items() if job_id in shown}
198
214
  for job in jobs:
215
+ self._apply_title(job)
199
216
  self._apply_measure(job, now)
200
217
  self._speeds.apply(job, now)
201
218
  if job.job_id == self.selected and not job.is_terminal:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ms_components
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: PySide6 UI components for MolSuite: smart table, project browser, job monitor, PyMOL dock, steppers.
5
5
  Author: Mario S. Valdés-Tresanco, Mario E. Valdés-Tresanco
6
6
  License-Expression: MIT
@@ -1,7 +1,7 @@
1
1
  {
2
- "tag": "0.6.0",
2
+ "tag": "0.7.0",
3
3
  "distance": 0,
4
- "node": "gcce127cbfb35cdedcf2421b3cdc916d3c609d85a",
4
+ "node": "ga2431bfb6f30f9560a4f94696120ebe35eb2c354",
5
5
  "dirty": false,
6
6
  "branch": "HEAD",
7
7
  "node_date": "2026-11-14"
@@ -241,3 +241,25 @@ def test_a_job_the_application_does_not_measure_shows_its_chunks_alone(ms, tmp_p
241
241
  ms.engine.wait(ms.submit(halves, executor="thread"), 30)
242
242
  [state] = bridge.refresh_now().jobs
243
243
  assert (state.items_unit, state.items_done, state.status) == ("", 0, "completed_with_errors")
244
+
245
+
246
+ def test_the_application_titles_a_job_once_and_a_failing_title_keeps_its_name(ms, tmp_path):
247
+ """`title(job_id, name)` replaces the name of the job in the monitor; it is asked once a job."""
248
+ _open(ms, tmp_path)
249
+ asked = []
250
+
251
+ def title(job_id, name):
252
+ asked.append((job_id, name))
253
+ return f"Halves · {name}"
254
+
255
+ bridge = MolSuiteMonitorBridge(workspace=ms, poll_ms=50, title=title)
256
+ GATE.set()
257
+ ms.engine.wait(ms.submit(halves, executor="thread"), 30)
258
+ [state] = bridge.refresh_now().jobs
259
+ assert state.title == f"Halves · {state.name}" and state.label == state.title
260
+ bridge.refresh_now()
261
+ assert asked == [(state.job_id, state.name)]
262
+
263
+ failing = MolSuiteMonitorBridge(workspace=ms, poll_ms=50, title=lambda job_id, name: 1 / 0)
264
+ [state] = failing.refresh_now().jobs
265
+ assert (state.title, state.label) == ("", state.name)
@@ -439,3 +439,12 @@ def test_the_hover_of_a_host_says_its_cpu_memory_and_cards():
439
439
  assert "AMD Ryzen 7 3700X 8-Core Processor · 16 threads" in tip and "<b>Memory</b> 47 GB" in tip
440
440
  assert "2× NVIDIA GeForce GTX 1660 SUPER · 6 GB" in tip and "Click: only its jobs" in tip
441
441
  assert _Reader("").read().hardware.get("threads") # this machine, read with no ssh
442
+
443
+
444
+ def test_a_titled_job_shows_its_title_and_keeps_its_name_in_the_tooltip():
445
+ QApplication.instance() or QApplication([])
446
+ detail = JobDetail()
447
+ detail.set_job(_job(name="amdock_docking_job", title="Docking · gnina (CNN)"))
448
+ assert detail._name.text() == "Docking · gnina (CNN)" and detail._name.toolTip() == "amdock_docking_job"
449
+ detail.set_job(_job(name="amdock_docking_job"))
450
+ assert detail._name.text() == "amdock_docking_job" and detail._name.toolTip() == ""
File without changes
File without changes
File without changes
File without changes
File without changes