MoleditPy-linux 3.0.1__tar.gz → 3.0.2__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 (78) hide show
  1. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/PKG-INFO +1 -1
  2. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/pyproject.toml +1 -1
  3. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/MoleditPy_linux.egg-info/PKG-INFO +1 -1
  4. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/plugins/plugin_interface.py +15 -24
  5. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/plugins/plugin_manager.py +0 -1
  6. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/app_state.py +0 -1
  7. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/bond_item.py +0 -7
  8. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/custom_interactor_style.py +0 -6
  9. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/dialog_logic.py +0 -4
  10. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/edit_actions_logic.py +1 -1
  11. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/io_logic.py +8 -6
  12. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/main_window_init.py +10 -14
  13. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/molecular_scene_handler.py +1 -3
  14. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/molecule_scene.py +0 -4
  15. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/settings_dialog.py +0 -1
  16. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/ui_manager.py +0 -2
  17. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/user_template_dialog.py +1 -1
  18. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/view_3d_logic.py +1 -1
  19. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/zoomable_view.py +0 -3
  20. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/utils/constants.py +1 -1
  21. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/LICENSE +0 -0
  22. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/README.md +0 -0
  23. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/setup.cfg +0 -0
  24. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/MoleditPy_linux.egg-info/SOURCES.txt +0 -0
  25. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/MoleditPy_linux.egg-info/dependency_links.txt +0 -0
  26. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/MoleditPy_linux.egg-info/entry_points.txt +0 -0
  27. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/MoleditPy_linux.egg-info/requires.txt +0 -0
  28. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/MoleditPy_linux.egg-info/top_level.txt +0 -0
  29. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/__init__.py +0 -0
  30. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/__main__.py +0 -0
  31. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/assets/file_icon.ico +0 -0
  32. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/assets/icon.icns +0 -0
  33. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/assets/icon.ico +0 -0
  34. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/assets/icon.png +0 -0
  35. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/core/__init__.py +0 -0
  36. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/core/mol_geometry.py +0 -0
  37. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/core/molecular_data.py +0 -0
  38. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/main.py +0 -0
  39. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/plugins/__init__.py +0 -0
  40. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/plugins/plugin_manager_window.py +0 -0
  41. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/__init__.py +0 -0
  42. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/about_dialog.py +0 -0
  43. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/align_plane_dialog.py +0 -0
  44. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/alignment_dialog.py +0 -0
  45. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/analysis_window.py +0 -0
  46. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/angle_dialog.py +0 -0
  47. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/atom_item.py +0 -0
  48. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/base_picking_dialog.py +0 -0
  49. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/bond_length_dialog.py +0 -0
  50. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/calculation_worker.py +0 -0
  51. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/color_settings_dialog.py +0 -0
  52. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/compute_logic.py +0 -0
  53. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/constrained_optimization_dialog.py +0 -0
  54. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/custom_qt_interactor.py +0 -0
  55. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/dialog_3d_picking_mixin.py +0 -0
  56. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/dihedral_dialog.py +0 -0
  57. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/edit_3d_logic.py +0 -0
  58. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/export_logic.py +0 -0
  59. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/geometry_base_dialog.py +0 -0
  60. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/main_window.py +0 -0
  61. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/mirror_dialog.py +0 -0
  62. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/move_group_dialog.py +0 -0
  63. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/periodic_table_dialog.py +0 -0
  64. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/planarize_dialog.py +0 -0
  65. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/settings_tabs/__init__.py +0 -0
  66. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/settings_tabs/settings_2d_tab.py +0 -0
  67. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/settings_tabs/settings_3d_tabs.py +0 -0
  68. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/settings_tabs/settings_other_tab.py +0 -0
  69. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/settings_tabs/settings_tab_base.py +0 -0
  70. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/sip_isdeleted_safe.py +0 -0
  71. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/string_importers.py +0 -0
  72. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/template_preview_item.py +0 -0
  73. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/template_preview_view.py +0 -0
  74. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/ui/translation_dialog.py +0 -0
  75. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/utils/__init__.py +0 -0
  76. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/utils/default_settings.py +0 -0
  77. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/utils/sip_isdeleted_safe.py +0 -0
  78. {moleditpy_linux-3.0.1 → moleditpy_linux-3.0.2}/src/moleditpy_linux/utils/system_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MoleditPy-linux
3
- Version: 3.0.1
3
+ Version: 3.0.2
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-linux"
7
7
 
8
- version = "3.0.1"
8
+ version = "3.0.2"
9
9
 
10
10
  license = {file = "LICENSE"}
11
11
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MoleditPy-linux
3
- Version: 3.0.1
3
+ Version: 3.0.2
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
@@ -119,12 +119,6 @@ class PluginContext:
119
119
  """
120
120
  return Plugin3DController(self._manager.get_main_window())
121
121
 
122
- def show_status_message(self, message: str, timeout: int = 3000) -> None:
123
- """
124
- Display a message in the application status bar.
125
- """
126
- self._manager.show_status_message(message, timeout)
127
-
128
122
  def push_undo_checkpoint(self) -> None:
129
123
  """
130
124
  Create an undo checkpoint for the current state.
@@ -133,18 +127,6 @@ class PluginContext:
133
127
  """
134
128
  self._manager.push_undo_checkpoint()
135
129
 
136
- def refresh_3d_view(self) -> None:
137
- """
138
- Force a refresh (re-render) of the 3D scene.
139
- """
140
- self._manager.refresh_3d_view()
141
-
142
- def reset_3d_camera(self) -> None:
143
- """
144
- Resets the 3D camera to fit the current molecule.
145
- """
146
- self._manager.reset_3d_camera()
147
-
148
130
  def get_selected_atom_indices(self) -> List[int]:
149
131
  """
150
132
  Returns a list of RDKit atom indices currently selected in the 2D or 3D view.
@@ -177,9 +159,7 @@ class PluginContext:
177
159
  """
178
160
  Display a temporary message in the status bar of the main window.
179
161
  """
180
- mw = self.get_main_window()
181
- if mw and hasattr(mw, "ui_manager"):
182
- mw.ui_manager.update_status_bar(message)
162
+ self._manager.show_status_message(message, timeout)
183
163
 
184
164
  @property
185
165
  def current_mol(self) -> Any:
@@ -187,7 +167,11 @@ class PluginContext:
187
167
  Get or set the current molecule (RDKit Mol object). Shortcut for current_molecule.
188
168
  """
189
169
  mw = self.get_main_window()
190
- return mw.view_3d_manager.current_mol if mw and hasattr(mw, "view_3d_manager") else None
170
+ return (
171
+ mw.view_3d_manager.current_mol
172
+ if mw and hasattr(mw, "view_3d_manager")
173
+ else None
174
+ )
191
175
 
192
176
  @current_mol.setter
193
177
  def current_mol(self, mol: Any):
@@ -211,7 +195,11 @@ class PluginContext:
211
195
  Returns the PyVista plotter from the MainWindow.
212
196
  """
213
197
  mw = self.get_main_window()
214
- return mw.view_3d_manager.plotter if mw and hasattr(mw, "view_3d_manager") else None
198
+ return (
199
+ mw.view_3d_manager.plotter
200
+ if mw and hasattr(mw, "view_3d_manager")
201
+ else None
202
+ )
215
203
 
216
204
  @property
217
205
  def scene(self) -> Any:
@@ -236,7 +224,10 @@ class PluginContext:
236
224
  mw.view_3d_manager.draw_molecule_3d(mol)
237
225
  else:
238
226
  # Also redraw/clear plotter if no molecule
239
- if hasattr(mw.view_3d_manager, "plotter") and mw.view_3d_manager.plotter:
227
+ if (
228
+ hasattr(mw.view_3d_manager, "plotter")
229
+ and mw.view_3d_manager.plotter
230
+ ):
240
231
  mw.view_3d_manager.plotter.render()
241
232
 
242
233
  def reset_3d_camera(self) -> None:
@@ -514,7 +514,6 @@ class PluginManager:
514
514
 
515
515
  # Check 2D selection
516
516
  try:
517
- from .plugin_interface import PluginContext
518
517
  # We need to access the scene items.
519
518
  # In MoleditPy, atoms in the scene are AtomItem objects which have an 'atom_id'.
520
519
  # These atom_ids map to entries in state_manager.data.atoms.
@@ -752,7 +752,6 @@ class StateManager:
752
752
  if self.host.view_3d_manager.current_mol:
753
753
  # Set 3D coordinates
754
754
  if self.host.view_3d_manager.current_mol.GetNumConformers() > 0:
755
- conf = self.host.view_3d_manager.current_mol.GetConformer()
756
755
  atoms_3d = structure_3d.get("atoms", [])
757
756
  # Ensure numpy array size matches atoms in file
758
757
  num_atoms_file = len(atoms_3d)
@@ -242,7 +242,6 @@ class BondItem(QGraphicsItem):
242
242
  center = line.center()
243
243
 
244
244
  # Logic similar to boundingRect but returning just the label box
245
- font_size = 20
246
245
  # ... (Simpler logic: just return a box around center)
247
246
  # Standard size estimate
248
247
  box_size = 30
@@ -265,7 +264,6 @@ class BondItem(QGraphicsItem):
265
264
  return
266
265
 
267
266
  # Default values
268
- width_2d = 2.0
269
267
  wedge_width_half = 6.0
270
268
  num_dashes = 8
271
269
  bond_color = QColor("#222222")
@@ -375,9 +373,6 @@ class BondItem(QGraphicsItem):
375
373
 
376
374
  if is_in_ring and ring_center:
377
375
  # Ring structure: 1 central line (single bond pos) + 1 short inner line
378
- # Calculate direction from bond center to ring center
379
- bond_center = line.center()
380
-
381
376
  # Ring center direction in local coords
382
377
  # ring_center may be QPointF (from old/legacy code) or tuple (from new decoupled core)
383
378
  if isinstance(ring_center, (list, tuple)):
@@ -512,8 +507,6 @@ class BondItem(QGraphicsItem):
512
507
  # Continue without crashing
513
508
 
514
509
  def hoverEnterEvent(self, event: Any) -> None:
515
- scene = self.scene()
516
- mode = getattr(scene, "mode", "")
517
510
  self.hovered = True
518
511
  self.update()
519
512
  if self.scene():
@@ -182,11 +182,6 @@ class CustomInteractorStyle(vtkInteractorStyleTrackballCamera):
182
182
  )
183
183
  is_edit_active = mw.edit_3d_manager.is_3d_edit_mode or is_temp_mode
184
184
 
185
- # Ctrl+Click for atom selection (3D edit)
186
- is_ctrl_click = bool(
187
- QApplication.keyboardModifiers() & Qt.KeyboardModifier.ControlModifier
188
- )
189
-
190
185
  # Handle measurement mode
191
186
  if mw.edit_3d_manager.measurement_mode and mw.view_3d_manager.current_mol:
192
187
  click_pos = self.GetInteractor().GetEventPosition()
@@ -419,7 +414,6 @@ class CustomInteractorStyle(vtkInteractorStyleTrackballCamera):
419
414
  if self._is_dragging_atom and mw.dragged_atom_info is not None:
420
415
  # Custom atom drag
421
416
  self.is_dragging = True
422
- atom_id = mw.dragged_atom_info["id"]
423
417
  else:
424
418
  # Delegate camera rotation to parent
425
419
  super().OnMouseMove()
@@ -16,10 +16,6 @@ import json
16
16
  import os
17
17
  from PyQt6.QtWidgets import QInputDialog, QMessageBox
18
18
 
19
- try:
20
- from . import sip_isdeleted_safe
21
- except ImportError:
22
- pass
23
19
 
24
20
  try:
25
21
  # package relative imports (preferred when running as `python -m moleditpy`)
@@ -22,7 +22,7 @@ from typing import Any, Dict, List, Optional
22
22
  import numpy as np
23
23
 
24
24
  try:
25
- from .mol_geometry import is_problematic_valence, identify_valence_problems
25
+ from .mol_geometry import identify_valence_problems
26
26
  except ImportError:
27
27
  from moleditpy_linux.core.mol_geometry import identify_valence_problems
28
28
 
@@ -207,7 +207,10 @@ class IOManager:
207
207
  final_mol = _process(charge_val, use_rd_determine=True)
208
208
  break
209
209
  except (RuntimeError, ValueError, TypeError) as e:
210
- if hasattr(self.host, "statusBar") and self.host.statusBar():
210
+ if (
211
+ hasattr(self.host, "statusBar")
212
+ and self.host.statusBar()
213
+ ):
211
214
  self.host.statusBar().showMessage(
212
215
  f"Chemistry failed for charge {charge_val}: {e}. Try a different charge or skip."
213
216
  )
@@ -919,8 +922,8 @@ class IOManager:
919
922
  charge = Chem.GetFormalCharge(
920
923
  self.host.view_3d_manager.current_mol
921
924
  )
922
- except:
923
- pass
925
+ except Exception as e:
926
+ logging.warning("Could not compute formal charge: %s", e)
924
927
 
925
928
  multiplicity = 1
926
929
  try:
@@ -930,8 +933,8 @@ class IOManager:
930
933
  )
931
934
  + 1
932
935
  )
933
- except:
934
- pass
936
+ except Exception as e:
937
+ logging.warning("Could not compute multiplicity: %s", e)
935
938
 
936
939
  xyz_lines.append(
937
940
  f"chrg = {charge} mult = {multiplicity} | Generated by MoleditPy Ver. {VERSION}"
@@ -1035,4 +1038,3 @@ def _set_mol_prop_safe(mol: Any, key: str, val: Any) -> None:
1035
1038
 
1036
1039
  # Backward-compat aliases
1037
1040
  IOManager = IOManager
1038
-
@@ -371,30 +371,28 @@ class MainInitManager:
371
371
 
372
372
  modules_to_update.append(constants_mod)
373
373
 
374
- for constants_mod in modules_to_update:
375
- constants_mod.CPK_COLORS.clear()
374
+ for mod in modules_to_update:
375
+ mod.CPK_COLORS.clear()
376
376
  for k, v in DEFAULT_CPK_COLORS.items():
377
- constants_mod.CPK_COLORS[k] = (
378
- QColor(v) if not isinstance(v, QColor) else v
379
- )
377
+ mod.CPK_COLORS[k] = QColor(v) if not isinstance(v, QColor) else v
380
378
 
381
379
  # Apply overrides from settings
382
380
  for k, hexv in overrides.items():
383
381
  if isinstance(hexv, str) and hexv:
384
- constants_mod.CPK_COLORS[k] = QColor(hexv)
382
+ mod.CPK_COLORS[k] = QColor(hexv)
385
383
 
386
384
  # Rebuild the PV representation in-place too
387
- if hasattr(constants_mod, "CPK_COLORS_PV"):
388
- constants_mod.CPK_COLORS_PV.clear()
389
- for k, c in constants_mod.CPK_COLORS.items():
390
- constants_mod.CPK_COLORS_PV[k] = [
385
+ if hasattr(mod, "CPK_COLORS_PV"):
386
+ mod.CPK_COLORS_PV.clear()
387
+ for k, c in mod.CPK_COLORS.items():
388
+ mod.CPK_COLORS_PV[k] = [
391
389
  c.redF(),
392
390
  c.greenF(),
393
391
  c.blueF(),
394
392
  ]
395
393
  else: # [REPORT ERROR MISSING ATTRIBUTE]
396
394
  logging.error(
397
- "REPORT ERROR: Missing attribute 'CPK_COLORS_PV' on constants_mod"
395
+ "REPORT ERROR: Missing attribute 'CPK_COLORS_PV' on constants module"
398
396
  )
399
397
  except (AttributeError, RuntimeError, TypeError, ValueError) as e:
400
398
  print(f"Failed to update CPK colors from settings: {e}")
@@ -1318,9 +1316,7 @@ class MainInitManager:
1318
1316
  if key == "ball_and_stick":
1319
1317
  action.setChecked(True)
1320
1318
  action.triggered.connect(
1321
- lambda checked=False, k=key: (
1322
- self.host.view_3d_manager.set_3d_style(k)
1323
- )
1319
+ lambda checked=False, k=key: (self.host.view_3d_manager.set_3d_style(k))
1324
1320
  )
1325
1321
  style_menu.addAction(action)
1326
1322
  style_group.addAction(action)
@@ -733,7 +733,7 @@ class KeyboardMixin:
733
733
  # Case 1: Cursor over atom/bond (one-shot placement)
734
734
  if isinstance(item_at_cursor, (AtomItem, BondItem)):
735
735
  # Set benzene template parameters
736
- n, is_aromatic = 6, True
736
+ n = 6
737
737
  points, bonds_info, existing_items = [], [], []
738
738
 
739
739
  # Calculate placement like update_template_preview
@@ -903,7 +903,6 @@ class KeyboardMixin:
903
903
  self.data.bonds[new_key] = bond_data
904
904
  bond.atom1, bond.atom2 = bond.atom2, bond.atom1
905
905
  bond.update_position()
906
- was_reversed = True
907
906
  else:
908
907
  bond.order = 1
909
908
  bond.stereo = 1
@@ -915,7 +914,6 @@ class KeyboardMixin:
915
914
  self.data.bonds[new_key] = bond_data
916
915
  bond.atom1, bond.atom2 = bond.atom2, bond.atom1
917
916
  bond.update_position()
918
- was_reversed = True
919
917
  else:
920
918
  bond.order = 1
921
919
  bond.stereo = 2
@@ -32,10 +32,6 @@ except ImportError:
32
32
  from moleditpy_linux.ui.bond_item import BondItem
33
33
  from moleditpy_linux.ui.template_preview_item import TemplatePreviewItem
34
34
 
35
- try:
36
- from ..utils.constants import DEFAULT_BOND_LENGTH, SNAP_DISTANCE, SUM_TOLERANCE
37
- except ImportError:
38
- pass
39
35
 
40
36
  try:
41
37
  from PyQt6 import sip as _sip # type: ignore
@@ -27,7 +27,6 @@ from .settings_tabs.settings_3d_tabs import Settings3DSceneTab, SettingsModelTab
27
27
  from .settings_tabs.settings_other_tab import SettingsOtherTab
28
28
 
29
29
  try:
30
- from ..utils.constants import CPK_COLORS
31
30
  from ..utils.default_settings import DEFAULT_SETTINGS
32
31
  except ImportError:
33
32
  from moleditpy_linux.utils.default_settings import DEFAULT_SETTINGS
@@ -319,7 +319,6 @@ class UIManager(QObject):
319
319
  self.host.view_3d_manager.plotter.interactor.SetInteractorStyle(style)
320
320
  self.host.view_3d_manager.plotter.interactor.Initialize()
321
321
 
322
-
323
322
  def handle_drag_enter_event(self, event):
324
323
  """Internal handler for drag enter event (bypasses PyQt type checks in tests)."""
325
324
  if not event.mimeData().hasUrls():
@@ -344,7 +343,6 @@ class UIManager(QObject):
344
343
 
345
344
  event.ignore()
346
345
 
347
-
348
346
  def handle_drop_event(self, event):
349
347
  """Internal handler for file drop event (bypasses PyQt type checks in tests)."""
350
348
  urls = event.mimeData().urls()
@@ -508,7 +508,7 @@ class UserTemplateDialog(QDialog):
508
508
  brush = QBrush(Qt.GlobalColor.white)
509
509
  ellipse_x = pos.x() - ellipse_width / 2
510
510
  ellipse_y = pos.y() - ellipse_height / 2
511
- ellipse = scene.addEllipse(
511
+ scene.addEllipse(
512
512
  ellipse_x, ellipse_y, ellipse_width, ellipse_height, pen, brush
513
513
  )
514
514
 
@@ -37,7 +37,7 @@ except (ImportError, AttributeError, TypeError):
37
37
 
38
38
  try:
39
39
  # package relative imports (preferred when running as `python -m moleditpy`)
40
- from .constants import CPK_COLORS_PV, DEFAULT_CPK_COLORS, VDW_RADII, pt
40
+ from .constants import CPK_COLORS_PV, VDW_RADII, pt
41
41
  from .template_preview_item import TemplatePreviewItem
42
42
  except ImportError:
43
43
  # Fallback to absolute imports for script-style execution
@@ -117,9 +117,6 @@ class ZoomableView(QGraphicsView):
117
117
  # (positive for zoom-in, negative for zoom-out)
118
118
  factor = 1.0 + event.value()
119
119
 
120
- current_scale = self.transform().m11()
121
- min_scale, max_scale = 0.05, 20.0
122
-
123
120
  # Apply scaling if within limits
124
121
  self.scale(factor, factor)
125
122
  return True
@@ -16,7 +16,7 @@ from PyQt6.QtGui import QColor, QFont
16
16
  from rdkit import Chem
17
17
 
18
18
  # Version
19
- VERSION = "3.0.1"
19
+ VERSION = "3.0.2"
20
20
 
21
21
  ATOM_RADIUS = 18
22
22
  BOND_OFFSET = 3.5
File without changes