MoleditPy 3.0.3__tar.gz → 3.0.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 (78) hide show
  1. {moleditpy-3.0.3 → moleditpy-3.0.5}/PKG-INFO +1 -1
  2. {moleditpy-3.0.3 → moleditpy-3.0.5}/pyproject.toml +1 -1
  3. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/MoleditPy.egg-info/PKG-INFO +1 -1
  4. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/main.py +14 -3
  5. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/plugins/plugin_manager.py +21 -1
  6. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/about_dialog.py +2 -1
  7. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/main_window_init.py +5 -4
  8. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/view_3d_logic.py +2 -2
  9. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/utils/constants.py +1 -1
  10. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/utils/default_settings.py +1 -1
  11. {moleditpy-3.0.3 → moleditpy-3.0.5}/LICENSE +0 -0
  12. {moleditpy-3.0.3 → moleditpy-3.0.5}/README.md +0 -0
  13. {moleditpy-3.0.3 → moleditpy-3.0.5}/setup.cfg +0 -0
  14. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/MoleditPy.egg-info/SOURCES.txt +0 -0
  15. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/MoleditPy.egg-info/dependency_links.txt +0 -0
  16. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/MoleditPy.egg-info/entry_points.txt +0 -0
  17. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/MoleditPy.egg-info/requires.txt +0 -0
  18. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/MoleditPy.egg-info/top_level.txt +0 -0
  19. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/__init__.py +0 -0
  20. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/__main__.py +0 -0
  21. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/assets/file_icon.ico +0 -0
  22. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/assets/icon.icns +0 -0
  23. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/assets/icon.ico +0 -0
  24. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/assets/icon.png +0 -0
  25. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/core/__init__.py +0 -0
  26. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/core/mol_geometry.py +0 -0
  27. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/core/molecular_data.py +0 -0
  28. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/plugins/__init__.py +0 -0
  29. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/plugins/plugin_interface.py +0 -0
  30. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/plugins/plugin_manager_window.py +0 -0
  31. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/__init__.py +0 -0
  32. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/align_plane_dialog.py +0 -0
  33. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/alignment_dialog.py +0 -0
  34. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/analysis_window.py +0 -0
  35. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/angle_dialog.py +0 -0
  36. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/app_state.py +0 -0
  37. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/atom_item.py +0 -0
  38. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/base_picking_dialog.py +0 -0
  39. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/bond_item.py +0 -0
  40. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/bond_length_dialog.py +0 -0
  41. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/calculation_worker.py +0 -0
  42. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/color_settings_dialog.py +0 -0
  43. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/compute_logic.py +0 -0
  44. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/constrained_optimization_dialog.py +0 -0
  45. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/custom_interactor_style.py +0 -0
  46. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/custom_qt_interactor.py +0 -0
  47. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/dialog_3d_picking_mixin.py +0 -0
  48. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/dialog_logic.py +0 -0
  49. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/dihedral_dialog.py +0 -0
  50. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/edit_3d_logic.py +0 -0
  51. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/edit_actions_logic.py +0 -0
  52. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/export_logic.py +0 -0
  53. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/geometry_base_dialog.py +0 -0
  54. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/io_logic.py +0 -0
  55. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/main_window.py +0 -0
  56. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/mirror_dialog.py +0 -0
  57. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/molecular_scene_handler.py +0 -0
  58. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/molecule_scene.py +0 -0
  59. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/move_group_dialog.py +0 -0
  60. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/periodic_table_dialog.py +0 -0
  61. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/planarize_dialog.py +0 -0
  62. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/settings_dialog.py +0 -0
  63. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/settings_tabs/__init__.py +0 -0
  64. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/settings_tabs/settings_2d_tab.py +0 -0
  65. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/settings_tabs/settings_3d_tabs.py +0 -0
  66. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/settings_tabs/settings_other_tab.py +0 -0
  67. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/settings_tabs/settings_tab_base.py +0 -0
  68. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/sip_isdeleted_safe.py +0 -0
  69. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/string_importers.py +0 -0
  70. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/template_preview_item.py +0 -0
  71. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/template_preview_view.py +0 -0
  72. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/translation_dialog.py +0 -0
  73. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/ui_manager.py +0 -0
  74. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/user_template_dialog.py +0 -0
  75. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/ui/zoomable_view.py +0 -0
  76. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/utils/__init__.py +0 -0
  77. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/utils/sip_isdeleted_safe.py +0 -0
  78. {moleditpy-3.0.3 → moleditpy-3.0.5}/src/moleditpy/utils/system_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MoleditPy
3
- Version: 3.0.3
3
+ Version: 3.0.5
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 = "3.0.3"
8
+ version = "3.0.5"
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: 3.0.3
3
+ Version: 3.0.5
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
@@ -16,15 +16,22 @@ import argparse
16
16
  import logging
17
17
  import os
18
18
 
19
- from PyQt6.QtWidgets import QApplication
20
-
21
19
  try:
22
- from .ui.main_window import MainWindow
20
+ from .utils.constants import VERSION
23
21
  except ImportError:
24
22
  # Add the parent directory (src) to sys.path so 'moleditpy.*' imports work
25
23
  src_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
26
24
  if src_dir not in sys.path:
27
25
  sys.path.insert(0, src_dir)
26
+ from moleditpy.utils.constants import VERSION
27
+
28
+ # VERSION is resolved above (before Qt) so --version works without launching the app.
29
+
30
+ from PyQt6.QtWidgets import QApplication
31
+
32
+ try:
33
+ from .ui.main_window import MainWindow
34
+ except ImportError:
28
35
  from moleditpy.ui.main_window import MainWindow
29
36
 
30
37
 
@@ -63,6 +70,10 @@ def main():
63
70
  prog="moleditpy", description="MoleditPy molecular editor"
64
71
  )
65
72
  parser.add_argument("file", nargs="?", default=None, help="File to open on startup")
73
+ _variant = " (Linux)" if "moleditpy_linux" in (__file__ or "") else ""
74
+ parser.add_argument(
75
+ "--version", action="version", version=f"MoleditPy{_variant} {VERSION}"
76
+ )
66
77
  parser.add_argument(
67
78
  "--safe",
68
79
  action="store_true",
@@ -254,7 +254,27 @@ class PluginManager:
254
254
  )
255
255
  unique_module_name = unique_module_name.strip(".")
256
256
 
257
- spec = importlib.util.spec_from_file_location(unique_module_name, filepath)
257
+ is_package = os.path.basename(filepath) == "__init__.py"
258
+ pkg_dir = os.path.dirname(filepath) if is_package else None
259
+
260
+ # For package plugins, register stub parent packages so that
261
+ # relative imports (e.g. "from . import parser") resolve correctly.
262
+ if is_package and "." in unique_module_name:
263
+ parts = unique_module_name.split(".")
264
+ for i in range(1, len(parts)):
265
+ parent_name = ".".join(parts[:i])
266
+ if parent_name not in sys.modules:
267
+ import types as _types
268
+ stub = _types.ModuleType(parent_name)
269
+ stub.__path__ = []
270
+ stub.__package__ = parent_name
271
+ sys.modules[parent_name] = stub
272
+
273
+ spec = importlib.util.spec_from_file_location(
274
+ unique_module_name,
275
+ filepath,
276
+ submodule_search_locations=([pkg_dir] if is_package else None),
277
+ )
258
278
  if spec and spec.loader:
259
279
  module = importlib.util.module_from_spec(spec)
260
280
  sys.modules[spec.name] = module
@@ -72,7 +72,8 @@ class AboutDialog(QDialog):
72
72
  layout.addWidget(self.image_label)
73
73
 
74
74
  # Add text information
75
- info_text = f"MoleditPy Ver. {VERSION}\nAuthor: Hiromichi Yokoyama\nLicense: GPL-3.0 license"
75
+ _variant = " (Linux)" if "moleditpy_linux" in (__file__ or "") else ""
76
+ info_text = f"MoleditPy{_variant} Ver. {VERSION}\nAuthor: Hiromichi Yokoyama\nLicense: GPL-3.0 license"
76
77
  info_label = QLabel(info_text)
77
78
  info_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
78
79
  layout.addWidget(info_label)
@@ -264,7 +264,7 @@ class MainInitManager:
264
264
  file_ext = ext_with_dot.lstrip(".")
265
265
 
266
266
  # 1. Custom Plugin Openers
267
- if ext_with_dot in self.host.plugin_manager.file_openers:
267
+ if self.host.plugin_manager and ext_with_dot in self.host.plugin_manager.file_openers:
268
268
  openers = self.host.plugin_manager.file_openers[ext_with_dot]
269
269
  # Iterate through openers (already sorted by priority)
270
270
  for opener_info in openers:
@@ -276,9 +276,10 @@ class MainInitManager:
276
276
  self.host.init_manager.current_file_path = file_path
277
277
  self.host.state_manager.update_window_title()
278
278
  return # Success
279
- except (AttributeError, RuntimeError, ValueError) as e:
280
- print(
281
- f"Plugin opener failed for '{opener_info.get('plugin', 'Unknown')}': {e}"
279
+ except Exception as e:
280
+ logging.warning(
281
+ "Plugin opener failed for '%s': %s",
282
+ opener_info.get('plugin', 'Unknown'), e
282
283
  )
283
284
  # If this opener fails, try the next one or fall through to default
284
285
  continue
@@ -175,7 +175,7 @@ class View3DManager:
175
175
  self._3d_color_map.clear()
176
176
 
177
177
  # 1. Camera state and clear
178
- camera_state = self.host.view_3d_manager.plotter.camera.copy()
178
+ camera_state = self.host.view_3d_manager.plotter.camera_position
179
179
 
180
180
  # Force removal to prevent ghost actor residues
181
181
  old_axes_actor = getattr(self, "axes_actor", None)
@@ -279,7 +279,7 @@ class View3DManager:
279
279
  self._add_3d_bond_cylinders(mol_to_draw, conf, col, current_style, mesh_props)
280
280
  self._add_3d_aromatic_rings(mol_to_draw, current_style, mesh_props)
281
281
  self._add_3d_labels(mol, mol_to_draw)
282
- self.host.view_3d_manager.plotter.camera = camera_state
282
+ self.host.view_3d_manager.plotter.camera_position = camera_state
283
283
 
284
284
  # Update projection mode and force render
285
285
  settings = getattr(self, "settings", {})
@@ -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.3"
19
+ VERSION = "3.0.5"
20
20
 
21
21
  ATOM_RADIUS = 18
22
22
  BOND_OFFSET = 3.5
@@ -53,7 +53,7 @@ DEFAULT_SETTINGS = {
53
53
  "display_aromatic_circles_3d": False,
54
54
  "display_kekule_3d": False,
55
55
  # --- 3D Conversion and Optimization ---
56
- "3d_conversion_mode": "rdkit",
56
+ "3d_conversion_mode": "fallback",
57
57
  "optimization_method": "MMFF_RDKIT",
58
58
  "optimize_intermolecular_interaction_rdkit": True,
59
59
  "skip_chemistry_checks": False,
File without changes
File without changes
File without changes