MoleditPy-linux 4.2.1__py3-none-any.whl → 4.2.3__py3-none-any.whl
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.
- moleditpy_linux/plugins/plugin_interface.py +2 -2
- moleditpy_linux/ui/compute_logic.py +36 -2
- moleditpy_linux/ui/main_window_init.py +7 -0
- moleditpy_linux/ui/plugin_menu_manager.py +22 -6
- {moleditpy_linux-4.2.1.dist-info → moleditpy_linux-4.2.3.dist-info}/METADATA +1 -1
- {moleditpy_linux-4.2.1.dist-info → moleditpy_linux-4.2.3.dist-info}/RECORD +10 -10
- {moleditpy_linux-4.2.1.dist-info → moleditpy_linux-4.2.3.dist-info}/WHEEL +0 -0
- {moleditpy_linux-4.2.1.dist-info → moleditpy_linux-4.2.3.dist-info}/entry_points.txt +0 -0
- {moleditpy_linux-4.2.1.dist-info → moleditpy_linux-4.2.3.dist-info}/licenses/LICENSE +0 -0
- {moleditpy_linux-4.2.1.dist-info → moleditpy_linux-4.2.3.dist-info}/top_level.txt +0 -0
|
@@ -420,8 +420,8 @@ class PluginContext:
|
|
|
420
420
|
if fn:
|
|
421
421
|
fn()
|
|
422
422
|
|
|
423
|
-
def
|
|
424
|
-
"""
|
|
423
|
+
def fit_2d_view(self) -> None:
|
|
424
|
+
"""Fit all 2D scene items into the 2D editor viewport."""
|
|
425
425
|
mw = self.get_main_window()
|
|
426
426
|
if mw and hasattr(mw, "view_3d_manager"):
|
|
427
427
|
fit = getattr(mw.view_3d_manager, "fit_to_view", None)
|
|
@@ -45,6 +45,9 @@ class ComputeManager:
|
|
|
45
45
|
self.halt_ids: Set[int] = set()
|
|
46
46
|
self.next_conversion_id: int = 1
|
|
47
47
|
self.active_worker_ids: Set[int] = set()
|
|
48
|
+
# worker_id -> (method_key, plugin_entry) for a plugin optimizer to run
|
|
49
|
+
# as a post-step once conversion's built-in pre-optimization completes.
|
|
50
|
+
self._pending_plugin_opt: Dict[int, Tuple[str, Dict[str, Any]]] = {}
|
|
48
51
|
|
|
49
52
|
def reset_active_threads(self) -> None:
|
|
50
53
|
"""Reset active calculation threads list."""
|
|
@@ -239,6 +242,25 @@ class ComputeManager:
|
|
|
239
242
|
self.next_conversion_id = run_id + 1
|
|
240
243
|
self.active_worker_ids.add(run_id)
|
|
241
244
|
|
|
245
|
+
# The worker only runs built-in force fields. If the selected method is a
|
|
246
|
+
# plugin optimizer, pre-optimize with MMFF (RDKit) in the worker (which
|
|
247
|
+
# auto-falls-back to UFF if MMFF setup fails), then run the plugin
|
|
248
|
+
# callback as a post-step in on_calculation_finished.
|
|
249
|
+
effective_method = (
|
|
250
|
+
optimization_method
|
|
251
|
+
or self.host.init_manager.optimization_method
|
|
252
|
+
or "MMFF_RDKIT"
|
|
253
|
+
).upper()
|
|
254
|
+
_reg = getattr(
|
|
255
|
+
getattr(self.host, "plugin_manager", None), "optimization_methods", None
|
|
256
|
+
)
|
|
257
|
+
plugin_entry = _reg.get(effective_method) if isinstance(_reg, dict) else None
|
|
258
|
+
if plugin_entry:
|
|
259
|
+
self._pending_plugin_opt[run_id] = (effective_method, plugin_entry)
|
|
260
|
+
worker_method = "MMFF_RDKIT"
|
|
261
|
+
else:
|
|
262
|
+
worker_method = effective_method
|
|
263
|
+
|
|
242
264
|
# UI Updates
|
|
243
265
|
self.host.init_manager.convert_button.setText("Halt conversion") # type: ignore[union-attr]
|
|
244
266
|
self._safe_disconnect(self.host.init_manager.convert_button.clicked) # type: ignore[union-attr]
|
|
@@ -267,8 +289,7 @@ class ComputeManager:
|
|
|
267
289
|
options = {
|
|
268
290
|
"conversion_mode": conversion_mode
|
|
269
291
|
or self.host.init_manager.settings.get("3d_conversion_mode", "fallback"),
|
|
270
|
-
"optimization_method":
|
|
271
|
-
or self.host.init_manager.optimization_method,
|
|
292
|
+
"optimization_method": worker_method,
|
|
272
293
|
"optimize_intermolecular_interaction_rdkit": self.host.init_manager.settings.get(
|
|
273
294
|
"optimize_intermolecular_interaction_rdkit", True
|
|
274
295
|
),
|
|
@@ -285,6 +306,7 @@ class ComputeManager:
|
|
|
285
306
|
if wids_to_halt:
|
|
286
307
|
self.halt_ids.update(wids_to_halt)
|
|
287
308
|
self.active_worker_ids.clear()
|
|
309
|
+
self._pending_plugin_opt.clear()
|
|
288
310
|
|
|
289
311
|
self._restore_button_ui()
|
|
290
312
|
self.host.init_manager.cleanup_button.setEnabled(True) # type: ignore[union-attr]
|
|
@@ -529,6 +551,16 @@ class ComputeManager:
|
|
|
529
551
|
self.host.view_3d_manager.update_atom_id_menu_text()
|
|
530
552
|
self.host.view_3d_manager.update_atom_id_menu_state()
|
|
531
553
|
|
|
554
|
+
# If the selected method was a plugin optimizer, the worker only did the
|
|
555
|
+
# built-in pre-optimization; run the plugin callback now on the result.
|
|
556
|
+
pending = (
|
|
557
|
+
self._pending_plugin_opt.pop(worker_id, None)
|
|
558
|
+
if worker_id is not None
|
|
559
|
+
else None
|
|
560
|
+
)
|
|
561
|
+
if pending and mol:
|
|
562
|
+
self._run_plugin_optimization(*pending)
|
|
563
|
+
|
|
532
564
|
def on_calculation_error(self, message: Union[str, Tuple[int, str]]) -> None:
|
|
533
565
|
"""Handle an error or halt signal from the background optimization worker."""
|
|
534
566
|
# Accept either a string or (worker_id, message) tuple from the worker signal
|
|
@@ -547,8 +579,10 @@ class ComputeManager:
|
|
|
547
579
|
self.host.statusBar().showMessage( # type: ignore[union-attr]
|
|
548
580
|
f"Ignored stale worker error: {msg} (ID = {worker_id})"
|
|
549
581
|
)
|
|
582
|
+
self._pending_plugin_opt.pop(worker_id, None)
|
|
550
583
|
return # stale worker, ignore
|
|
551
584
|
self.active_worker_ids.discard(worker_id)
|
|
585
|
+
self._pending_plugin_opt.pop(worker_id, None)
|
|
552
586
|
else:
|
|
553
587
|
msg = str(message)
|
|
554
588
|
|
|
@@ -1723,6 +1723,13 @@ class MainInitManager:
|
|
|
1723
1723
|
self.opt_group.addAction(action)
|
|
1724
1724
|
self.opt3d_actions[key_upper] = action
|
|
1725
1725
|
|
|
1726
|
+
# Plugins register after menu-init, so restore the saved default here
|
|
1727
|
+
# if it names this method (menu-init fell back to MMFF_RDKIT).
|
|
1728
|
+
saved_opt = (self.settings.get("optimization_method") or "").upper()
|
|
1729
|
+
if key_upper == saved_opt:
|
|
1730
|
+
action.setChecked(True)
|
|
1731
|
+
self.optimization_method = key_upper
|
|
1732
|
+
|
|
1726
1733
|
def _init_help_menu(self, menu_bar: Any) -> None:
|
|
1727
1734
|
"""Initialize the Help menu."""
|
|
1728
1735
|
help_menu = menu_bar.addMenu("&Help")
|
|
@@ -369,14 +369,30 @@ class PluginMenuManager:
|
|
|
369
369
|
menu.addAction(a)
|
|
370
370
|
|
|
371
371
|
def integrate_plugin_optimization_methods(self) -> None:
|
|
372
|
-
"""Inject plugin optimization methods into the 3D Optimization Settings menu.
|
|
373
|
-
|
|
372
|
+
"""Inject plugin optimization methods into the 3D Optimization Settings menu.
|
|
373
|
+
|
|
374
|
+
Idempotent: previously-added plugin methods are purged first, so a menu
|
|
375
|
+
rebuild (install/uninstall/reload) re-adds only the currently registered
|
|
376
|
+
ones. Without this, _clean_menu removes the menu action while
|
|
377
|
+
opt3d_actions still holds it, and add_optimization_method's dedupe guard
|
|
378
|
+
would then skip re-adding a still-installed method.
|
|
379
|
+
"""
|
|
380
|
+
im = self._im
|
|
381
|
+
methods = getattr(im.host.plugin_manager, "optimization_methods", None)
|
|
382
|
+
if not isinstance(methods, dict):
|
|
374
383
|
return
|
|
375
384
|
|
|
376
|
-
for key,
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
385
|
+
for key, action in list(im.opt3d_actions.items()):
|
|
386
|
+
if action.data() == "plugin_managed":
|
|
387
|
+
im.opt_group.removeAction(action)
|
|
388
|
+
im.optimization_menu.removeAction(action)
|
|
389
|
+
del im.opt3d_actions[key]
|
|
390
|
+
im.opt3d_method_labels.pop(key, None)
|
|
391
|
+
|
|
392
|
+
for key, entry in methods.items():
|
|
393
|
+
im.add_optimization_method(entry["label"], key)
|
|
394
|
+
if key in im.opt3d_actions:
|
|
395
|
+
im.opt3d_actions[key].setData("plugin_managed")
|
|
380
396
|
|
|
381
397
|
def integrate_plugin_file_openers(self) -> None:
|
|
382
398
|
"""Inject plugin file-opener entries into the File > Import menu."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: MoleditPy-linux
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.3
|
|
4
4
|
Summary: A cross-platform, simple, and intuitive molecular structure editor built in Python. It allows 2D molecular drawing and 3D structure visualization. It supports exporting structure files for input to DFT calculation software.
|
|
5
5
|
Author-email: HiroYokoyama <titech.yoko.hiro@gmail.com>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -9,7 +9,7 @@ moleditpy_linux/core/__init__.py,sha256=BEOaCz93HzgTe0FhBzSj6Sfk8MAWxcY9vCDGmOri
|
|
|
9
9
|
moleditpy_linux/core/mol_geometry.py,sha256=PzdJGxWs6vXwVyILBG6-6qhiVYuB33YTr8lcHRJVLNE,23933
|
|
10
10
|
moleditpy_linux/core/molecular_data.py,sha256=CboEOZMjtbyRSQ7-f6kj0jngUM0Tw-7L6lU9eDtdycQ,18606
|
|
11
11
|
moleditpy_linux/plugins/__init__.py,sha256=BEOaCz93HzgTe0FhBzSj6Sfk8MAWxcY9vCDGmOriJx4,267
|
|
12
|
-
moleditpy_linux/plugins/plugin_interface.py,sha256=
|
|
12
|
+
moleditpy_linux/plugins/plugin_interface.py,sha256=GGRQsUGSb36RgujErcQWX-dr5pm55dnQ8K75NfviAe0,22054
|
|
13
13
|
moleditpy_linux/plugins/plugin_manager.py,sha256=LeuqJdIkeqYy1SbL8JLJoKDepbdkYXG1SPus4dK15RE,32025
|
|
14
14
|
moleditpy_linux/plugins/plugin_manager_window.py,sha256=ot4ftAR8GA6mn6PMuYYgMGyqqabEmtP7EVYEnxCeDDU,13432
|
|
15
15
|
moleditpy_linux/ui/__init__.py,sha256=_BslFbhSM4Ba4GDzH1XpvlqlGgvi4OFkcuU3pPeIz3s,751
|
|
@@ -26,7 +26,7 @@ moleditpy_linux/ui/bond_item.py,sha256=8qm15z3OVflCtkVXRfbPGRtZidAduyZ6Yuxci3-Ed
|
|
|
26
26
|
moleditpy_linux/ui/bond_length_dialog.py,sha256=lss8J2g_pUK-BCbqWk25JMFsn-g8SxBjiBp8mZrn57I,15930
|
|
27
27
|
moleditpy_linux/ui/calculation_worker.py,sha256=bwrzCW5935Twe5EY7Mtd35YQaWJILvBPwzPIQgmqz98,41849
|
|
28
28
|
moleditpy_linux/ui/color_settings_dialog.py,sha256=RFp8h0R1yC8YwqOxc972Da9xO95Gu-0qywAAEeXMj4E,14224
|
|
29
|
-
moleditpy_linux/ui/compute_logic.py,sha256=
|
|
29
|
+
moleditpy_linux/ui/compute_logic.py,sha256=kK53dkQQy6LVnnxu5KG7jHPCjdtKirdCOVRy-5QbYRA,31086
|
|
30
30
|
moleditpy_linux/ui/constrained_optimization_dialog.py,sha256=JexsKDqwogdJMKxdDyI-xce3fPq27tsCZdzl2uyXuDc,35980
|
|
31
31
|
moleditpy_linux/ui/custom_interactor_style.py,sha256=8UzJ7tItbsPTSlxe69P8wLB9uOeWG2o1PpJpriRvI3M,44414
|
|
32
32
|
moleditpy_linux/ui/custom_qt_interactor.py,sha256=AZ5TtQjWUs4F5FFg-tBUZQlbk74UHboTjYpBQRUlhvQ,3827
|
|
@@ -39,7 +39,7 @@ moleditpy_linux/ui/export_logic.py,sha256=97NrR6lC8U7ChN2EyOuTrl1vHB6g6xuL1BeJmY
|
|
|
39
39
|
moleditpy_linux/ui/geometry_base_dialog.py,sha256=jj9uI2cexEjC3WxFm8HAlsrGUcTX6lQv-BX70hkSW7o,4472
|
|
40
40
|
moleditpy_linux/ui/io_logic.py,sha256=cGXrECHoCkGIJ7HUZpbm4SrE-Ewmsn6b5nj4V1qsi-M,45975
|
|
41
41
|
moleditpy_linux/ui/main_window.py,sha256=ygYEMJfQQ5Y2-nCMzEym2epOsMRX9JwArB_cyEp3SM4,12551
|
|
42
|
-
moleditpy_linux/ui/main_window_init.py,sha256=
|
|
42
|
+
moleditpy_linux/ui/main_window_init.py,sha256=JoCmrnVg63y-mHioBqaBeCMqwEQZVbfyJ4VVPvbxfOw,77018
|
|
43
43
|
moleditpy_linux/ui/mirror_dialog.py,sha256=iRt5rRVJ4gY2Ha5BlEoYv0D_HJpVXaQz4nqsHPlZ-9c,5210
|
|
44
44
|
moleditpy_linux/ui/molecular_scene_handler.py,sha256=w2TYkJFtsQzQHIfKDQbByoSxmEHOlUrfb5vYvs6-dw4,69793
|
|
45
45
|
moleditpy_linux/ui/molecule_scene.py,sha256=BnYZipB9zZN76mLK3bVro_CroTo166oTz5K7obObYFA,44084
|
|
@@ -47,7 +47,7 @@ moleditpy_linux/ui/move_group_dialog.py,sha256=W5Tk2OgKAApXuEqHoB-gY6RsDerRbC3_C
|
|
|
47
47
|
moleditpy_linux/ui/move_selected_atoms_dialog.py,sha256=NJbYZ8-DHBD7jpqlkyWKNhW7gCYpzfRXjfniPpijC5w,29654
|
|
48
48
|
moleditpy_linux/ui/periodic_table_dialog.py,sha256=yadE1bbJaObAiIfpKwANqiDOBI8R3yOHvDTZYrw1J4Q,6134
|
|
49
49
|
moleditpy_linux/ui/planarize_dialog.py,sha256=qWMokIKDjsuC2KY-s00nrHflIr3uw4XAcwWftNFleek,7951
|
|
50
|
-
moleditpy_linux/ui/plugin_menu_manager.py,sha256=
|
|
50
|
+
moleditpy_linux/ui/plugin_menu_manager.py,sha256=Lev1aeWmZInwebnYBe7TpyI01KWYSwl1-etSmDT6Ng4,20592
|
|
51
51
|
moleditpy_linux/ui/settings_dialog.py,sha256=tAw-Ko73oBG5o8jnsiK4MiPar88GxiAkcnE5h6aUlYo,7319
|
|
52
52
|
moleditpy_linux/ui/string_importers.py,sha256=cgsMoIYRKKP-RZZzhcpCdlDqr8KJgmazZdJ7C3GCSaE,8078
|
|
53
53
|
moleditpy_linux/ui/template_preview_item.py,sha256=exJ4r3qmLOCQrEgl9ktNu4zTrgqixZcq82rUb9flWiM,7743
|
|
@@ -68,9 +68,9 @@ moleditpy_linux/utils/default_settings.py,sha256=6Q3Gw1vyG7uk-35yBtr1sKeJVnOjb4S
|
|
|
68
68
|
moleditpy_linux/utils/sip_isdeleted_safe.py,sha256=aXoW_PDHAsu0SkqcvkUZAsWDhl9Ka8-VnzgNE5ub41Y,1215
|
|
69
69
|
moleditpy_linux/utils/suppress_log.py,sha256=EFkN79q6QfYXAuii8g1fBuvFJrnVsio3aFTKMvAmXW4,928
|
|
70
70
|
moleditpy_linux/utils/system_utils.py,sha256=j1RAiiKXg3N-rjpTh7yxKVAYED_kUJy4aVrY-9Hh0Mc,2674
|
|
71
|
-
moleditpy_linux-4.2.
|
|
72
|
-
moleditpy_linux-4.2.
|
|
73
|
-
moleditpy_linux-4.2.
|
|
74
|
-
moleditpy_linux-4.2.
|
|
75
|
-
moleditpy_linux-4.2.
|
|
76
|
-
moleditpy_linux-4.2.
|
|
71
|
+
moleditpy_linux-4.2.3.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
|
|
72
|
+
moleditpy_linux-4.2.3.dist-info/METADATA,sha256=_5QBwFNMIOGE2GTFnPH5fMH8OGzyzB0BnK5MoDAFgMs,64474
|
|
73
|
+
moleditpy_linux-4.2.3.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
74
|
+
moleditpy_linux-4.2.3.dist-info/entry_points.txt,sha256=-OzipSi__yVwlimNtu3eiRP5t5UMg55Cs0udyhXYiyw,60
|
|
75
|
+
moleditpy_linux-4.2.3.dist-info/top_level.txt,sha256=qyqe-hDYL6CXyin9E5Me5rVl3PG84VqiOjf9bQvfJLs,16
|
|
76
|
+
moleditpy_linux-4.2.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|