MoleditPy 4.11.0__tar.gz → 4.11.1__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 (93) hide show
  1. {moleditpy-4.11.0 → moleditpy-4.11.1}/PKG-INFO +1 -1
  2. {moleditpy-4.11.0 → moleditpy-4.11.1}/pyproject.toml +1 -1
  3. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/MoleditPy.egg-info/PKG-INFO +1 -1
  4. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/plugins/plugin_interface.py +45 -1
  5. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/view_3d_logic.py +24 -11
  6. {moleditpy-4.11.0 → moleditpy-4.11.1}/LICENSE +0 -0
  7. {moleditpy-4.11.0 → moleditpy-4.11.1}/README.md +0 -0
  8. {moleditpy-4.11.0 → moleditpy-4.11.1}/setup.cfg +0 -0
  9. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/MoleditPy.egg-info/SOURCES.txt +0 -0
  10. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/MoleditPy.egg-info/dependency_links.txt +0 -0
  11. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/MoleditPy.egg-info/entry_points.txt +0 -0
  12. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/MoleditPy.egg-info/requires.txt +0 -0
  13. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/MoleditPy.egg-info/top_level.txt +0 -0
  14. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/__init__.py +0 -0
  15. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/__main__.py +0 -0
  16. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/assets/file_icon.ico +0 -0
  17. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/assets/icon.icns +0 -0
  18. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/assets/icon.ico +0 -0
  19. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/assets/icon.png +0 -0
  20. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/core/__init__.py +0 -0
  21. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/core/mol_geometry.py +0 -0
  22. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/core/molecular_data.py +0 -0
  23. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/core/stereo_check.py +0 -0
  24. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/main.py +0 -0
  25. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/plugins/__init__.py +0 -0
  26. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/plugins/plugin_manager.py +0 -0
  27. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/plugins/plugin_manager_window.py +0 -0
  28. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/__init__.py +0 -0
  29. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/about_dialog.py +0 -0
  30. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/align_plane_dialog.py +0 -0
  31. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/alignment_dialog.py +0 -0
  32. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/analysis_window.py +0 -0
  33. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/angle_dialog.py +0 -0
  34. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/app_state.py +0 -0
  35. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/atom_item.py +0 -0
  36. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/atom_picking.py +0 -0
  37. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/base_picking_dialog.py +0 -0
  38. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/bond_item.py +0 -0
  39. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/bond_length_dialog.py +0 -0
  40. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/calculation_worker.py +0 -0
  41. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/chain_mixin.py +0 -0
  42. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/chirality_warning_dialog.py +0 -0
  43. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/color_settings_dialog.py +0 -0
  44. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/compute_logic.py +0 -0
  45. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/constrained_optimization_dialog.py +0 -0
  46. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/custom_interactor_style.py +0 -0
  47. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/custom_qt_interactor.py +0 -0
  48. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/dialog_3d_picking_mixin.py +0 -0
  49. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/dialog_logic.py +0 -0
  50. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/dihedral_dialog.py +0 -0
  51. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/edit_3d_logic.py +0 -0
  52. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/edit_actions_logic.py +0 -0
  53. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/export_logic.py +0 -0
  54. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/geometry_base_dialog.py +0 -0
  55. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/io_logic.py +0 -0
  56. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/main_window.py +0 -0
  57. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/main_window_init.py +0 -0
  58. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/mirror_dialog.py +0 -0
  59. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/molecular_scene_handler.py +0 -0
  60. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/molecule_scene.py +0 -0
  61. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/move_dialog_mixin.py +0 -0
  62. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/move_group_dialog.py +0 -0
  63. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/move_selected_atoms_dialog.py +0 -0
  64. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/periodic_table_dialog.py +0 -0
  65. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/planarize_dialog.py +0 -0
  66. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/plugin_menu_manager.py +0 -0
  67. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/preview_molecule.py +0 -0
  68. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/sdf_record_dialog.py +0 -0
  69. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/settings_dialog.py +0 -0
  70. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/settings_tabs/__init__.py +0 -0
  71. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/settings_tabs/settings_2d_cleanup_tab.py +0 -0
  72. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/settings_tabs/settings_2d_tab.py +0 -0
  73. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/settings_tabs/settings_3d_tabs.py +0 -0
  74. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/settings_tabs/settings_labels_tab.py +0 -0
  75. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/settings_tabs/settings_other_tab.py +0 -0
  76. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/settings_tabs/settings_tab_base.py +0 -0
  77. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/string_importers.py +0 -0
  78. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/template_preview_item.py +0 -0
  79. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/template_preview_view.py +0 -0
  80. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/translation_dialog.py +0 -0
  81. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/ui_manager.py +0 -0
  82. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/user_template_dialog.py +0 -0
  83. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/ui/zoomable_view.py +0 -0
  84. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/utils/__init__.py +0 -0
  85. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/utils/constants.py +0 -0
  86. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/utils/default_settings.py +0 -0
  87. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/utils/finite_float.py +0 -0
  88. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/utils/hit_radius.py +0 -0
  89. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/utils/label_style.py +0 -0
  90. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/utils/sdf_records.py +0 -0
  91. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/utils/sip_isdeleted_safe.py +0 -0
  92. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/utils/suppress_log.py +0 -0
  93. {moleditpy-4.11.0 → moleditpy-4.11.1}/src/moleditpy/utils/system_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MoleditPy
3
- Version: 4.11.0
3
+ Version: 4.11.1
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
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "MoleditPy"
7
7
 
8
- version = "4.11.0"
8
+ version = "4.11.1"
9
9
 
10
10
  license = {file = "LICENSE"}
11
11
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MoleditPy
3
- Version: 4.11.0
3
+ Version: 4.11.1
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
@@ -13,7 +13,17 @@ DOI: 10.5281/zenodo.17268532
13
13
  from __future__ import annotations
14
14
 
15
15
  import logging
16
- from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union
16
+ from typing import (
17
+ TYPE_CHECKING,
18
+ Any,
19
+ Callable,
20
+ Dict,
21
+ List,
22
+ Mapping,
23
+ Optional,
24
+ Tuple,
25
+ Union,
26
+ )
17
27
 
18
28
  if TYPE_CHECKING:
19
29
  # Annotation-only: plugin test suites import this module without RDKit.
@@ -652,6 +662,40 @@ class Plugin3DController:
652
662
  if v3d.plotter:
653
663
  v3d.plotter.render()
654
664
 
665
+ def set_atom_colors(self, colors: Mapping[int, Optional[str]]) -> None:
666
+ """
667
+ Set the colors of many atoms in the 3D view with a single redraw.
668
+
669
+ ``set_atom_color`` redraws the molecule on every call, so coloring
670
+ hundreds of atoms one by one is slow; use this for batches.
671
+
672
+ Args:
673
+ colors: RDKit atom index -> hex string e.g. "#FF0000".
674
+ ``None`` removes that atom's override.
675
+ """
676
+ v3d = self._get_v3d()
677
+ if v3d:
678
+ v3d.update_atom_color_overrides(colors)
679
+ if v3d.plotter:
680
+ v3d.plotter.render()
681
+
682
+ def set_bond_colors(self, colors: Mapping[int, Optional[str]]) -> None:
683
+ """
684
+ Set the colors of many bonds in the 3D view with a single redraw.
685
+
686
+ ``set_bond_color`` redraws the molecule on every call, so coloring
687
+ hundreds of bonds one by one is slow; use this for batches.
688
+
689
+ Args:
690
+ colors: RDKit bond index -> hex string e.g. "#00FF00".
691
+ ``None`` removes that bond's override.
692
+ """
693
+ v3d = self._get_v3d()
694
+ if v3d:
695
+ v3d.update_bond_color_overrides(colors)
696
+ if v3d.plotter:
697
+ v3d.plotter.render()
698
+
655
699
  def set_bond_color_by_atoms(
656
700
  self, atom_idx1: int, atom_idx2: int, color_hex: str
657
701
  ) -> None:
@@ -13,7 +13,7 @@ DOI: 10.5281/zenodo.17268532
13
13
  from __future__ import annotations
14
14
  import logging
15
15
  from ..utils.suppress_log import suppress_log
16
- from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
16
+ from typing import TYPE_CHECKING, Any, Dict, List, Mapping, Optional, Tuple
17
17
 
18
18
  if TYPE_CHECKING:
19
19
  from .custom_qt_interactor import CustomQtInteractor
@@ -43,6 +43,17 @@ from .template_preview_item import TemplatePreviewItem
43
43
  WRONG_CHIRAL_COLOR = "#FF0000"
44
44
 
45
45
 
46
+ def _apply_overrides(
47
+ store: Dict[int, str], colors: Mapping[int, Optional[str]]
48
+ ) -> None:
49
+ """Write plugin color overrides into *store*; a None color removes one."""
50
+ for index, color in colors.items():
51
+ if color is None:
52
+ store.pop(index, None)
53
+ else:
54
+ store[index] = color
55
+
56
+
46
57
  class View3DManager:
47
58
  """Independent manager for 3D rendering logic, ported from MainWindowView3d mixin."""
48
59
 
@@ -1971,13 +1982,14 @@ class View3DManager:
1971
1982
  self, bond_idx: int, hex_color: Optional[str]
1972
1983
  ) -> None:
1973
1984
  """Plugin API helper to override bond color."""
1985
+ self.update_bond_color_overrides({bond_idx: hex_color})
1974
1986
 
1975
- if hex_color is None:
1976
- if bond_idx in self._plugin_bond_color_overrides:
1977
- del self._plugin_bond_color_overrides[bond_idx]
1978
- else:
1979
- self._plugin_bond_color_overrides[bond_idx] = hex_color
1987
+ def update_bond_color_overrides(self, colors: Mapping[int, Optional[str]]) -> None:
1988
+ """Plugin API helper: apply many bond color overrides, redraw once.
1980
1989
 
1990
+ A ``None`` color removes that bond's override.
1991
+ """
1992
+ _apply_overrides(self._plugin_bond_color_overrides, colors)
1981
1993
  if self.current_mol:
1982
1994
  self.draw_molecule_3d(self.current_mol)
1983
1995
 
@@ -1985,12 +1997,13 @@ class View3DManager:
1985
1997
  self, atom_index: int, color_hex: Optional[str]
1986
1998
  ) -> None:
1987
1999
  """Plugin helper to update specific atom color override."""
2000
+ self.update_atom_color_overrides({atom_index: color_hex})
1988
2001
 
1989
- if color_hex is None:
1990
- if atom_index in self._plugin_color_overrides:
1991
- del self._plugin_color_overrides[atom_index]
1992
- else:
1993
- self._plugin_color_overrides[atom_index] = color_hex
2002
+ def update_atom_color_overrides(self, colors: Mapping[int, Optional[str]]) -> None:
2003
+ """Plugin API helper: apply many atom color overrides, redraw once.
1994
2004
 
2005
+ A ``None`` color removes that atom's override.
2006
+ """
2007
+ _apply_overrides(self._plugin_color_overrides, colors)
1995
2008
  if self.current_mol:
1996
2009
  self.draw_molecule_3d(self.current_mol)
File without changes
File without changes
File without changes