MoleditPy 2.2.2__tar.gz → 2.2.4__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 (63) hide show
  1. {moleditpy-2.2.2 → moleditpy-2.2.4}/PKG-INFO +1 -1
  2. {moleditpy-2.2.2 → moleditpy-2.2.4}/pyproject.toml +1 -1
  3. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/MoleditPy.egg-info/PKG-INFO +1 -1
  4. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/constants.py +1 -1
  5. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/main_window_compute.py +5 -8
  6. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/main_window_dialog_manager.py +0 -4
  7. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/main_window_edit_3d.py +0 -4
  8. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/main_window_edit_actions.py +0 -4
  9. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/main_window_export.py +0 -4
  10. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/main_window_main_init.py +32 -9
  11. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/main_window_molecular_parsers.py +0 -4
  12. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/main_window_project_io.py +0 -4
  13. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/main_window_string_importers.py +0 -4
  14. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/main_window_view_3d.py +1 -5
  15. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/main_window_view_loaders.py +0 -4
  16. {moleditpy-2.2.2 → moleditpy-2.2.4}/LICENSE +0 -0
  17. {moleditpy-2.2.2 → moleditpy-2.2.4}/README.md +0 -0
  18. {moleditpy-2.2.2 → moleditpy-2.2.4}/setup.cfg +0 -0
  19. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/MoleditPy.egg-info/SOURCES.txt +0 -0
  20. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/MoleditPy.egg-info/dependency_links.txt +0 -0
  21. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/MoleditPy.egg-info/entry_points.txt +0 -0
  22. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/MoleditPy.egg-info/requires.txt +0 -0
  23. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/MoleditPy.egg-info/top_level.txt +0 -0
  24. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/__init__.py +0 -0
  25. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/__main__.py +0 -0
  26. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/main.py +0 -0
  27. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/__init__.py +0 -0
  28. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/about_dialog.py +0 -0
  29. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/align_plane_dialog.py +0 -0
  30. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/alignment_dialog.py +0 -0
  31. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/analysis_window.py +0 -0
  32. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/angle_dialog.py +0 -0
  33. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/assets/icon.icns +0 -0
  34. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/assets/icon.ico +0 -0
  35. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/assets/icon.png +0 -0
  36. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/atom_item.py +0 -0
  37. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/bond_item.py +0 -0
  38. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/bond_length_dialog.py +0 -0
  39. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/calculation_worker.py +0 -0
  40. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/color_settings_dialog.py +0 -0
  41. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/constrained_optimization_dialog.py +0 -0
  42. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/custom_interactor_style.py +0 -0
  43. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/custom_qt_interactor.py +0 -0
  44. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/dialog3_d_picking_mixin.py +0 -0
  45. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/dihedral_dialog.py +0 -0
  46. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/main_window.py +0 -0
  47. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/main_window_app_state.py +0 -0
  48. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/main_window_ui_manager.py +0 -0
  49. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/mirror_dialog.py +0 -0
  50. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/molecular_data.py +0 -0
  51. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/molecule_scene.py +0 -0
  52. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/move_group_dialog.py +0 -0
  53. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/periodic_table_dialog.py +0 -0
  54. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/planarize_dialog.py +0 -0
  55. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/plugin_interface.py +0 -0
  56. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/plugin_manager.py +0 -0
  57. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/plugin_manager_window.py +0 -0
  58. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/settings_dialog.py +0 -0
  59. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/template_preview_item.py +0 -0
  60. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/template_preview_view.py +0 -0
  61. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/translation_dialog.py +0 -0
  62. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/user_template_dialog.py +0 -0
  63. {moleditpy-2.2.2 → moleditpy-2.2.4}/src/moleditpy/modules/zoomable_view.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MoleditPy
3
- Version: 2.2.2
3
+ Version: 2.2.4
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 = "2.2.2"
8
+ version = "2.2.4"
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: 2.2.2
3
+ Version: 2.2.4
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,7 +16,7 @@ from PyQt6.QtGui import QFont, QColor
16
16
  from rdkit import Chem
17
17
 
18
18
  #Version
19
- VERSION = '2.2.2'
19
+ VERSION = '2.2.4'
20
20
 
21
21
  ATOM_RADIUS = 18
22
22
  BOND_OFFSET = 3.5
@@ -84,10 +84,6 @@ except Exception:
84
84
  class MainWindowCompute(object):
85
85
  """ main_window.py から分離された機能クラス """
86
86
 
87
- def __init__(self, main_window):
88
- """ クラスの初期化 """
89
- self.mw = main_window
90
-
91
87
 
92
88
  def set_optimization_method(self, method_name):
93
89
  """Set preferred 3D optimization method and persist to settings.
@@ -209,8 +205,8 @@ class MainWindowCompute(object):
209
205
  menu.addAction(a)
210
206
 
211
207
  # Add Plugin Optimization Methods
212
- if hasattr(self.mw, 'plugin_manager') and self.mw.plugin_manager.optimization_methods:
213
- methods = self.mw.plugin_manager.optimization_methods
208
+ if hasattr(self, 'plugin_manager') and self.plugin_manager.optimization_methods:
209
+ methods = self.plugin_manager.optimization_methods
214
210
  if methods:
215
211
  menu.addSeparator()
216
212
  for method_name, info in methods.items():
@@ -781,8 +777,9 @@ class MainWindowCompute(object):
781
777
  self.statusBar().showMessage(f"UFF (RDKit) optimization error: {e}")
782
778
  return
783
779
  # Plugin method dispatch
784
- elif hasattr(self.mw, 'plugin_manager') and hasattr(self.mw.plugin_manager, 'optimization_methods') and method in self.mw.plugin_manager.optimization_methods:
785
- info = self.mw.plugin_manager.optimization_methods[method]
780
+ # Plugin method dispatch
781
+ elif hasattr(self, 'plugin_manager') and hasattr(self.plugin_manager, 'optimization_methods') and method in self.plugin_manager.optimization_methods:
782
+ info = self.plugin_manager.optimization_methods[method]
786
783
  callback = info['callback']
787
784
  try:
788
785
  success = callback(self.current_mol)
@@ -111,10 +111,6 @@ except Exception:
111
111
  class MainWindowDialogManager(object):
112
112
  """ main_window.py から分離された機能クラス """
113
113
 
114
- def __init__(self, main_window):
115
- """ クラスの初期化 """
116
- self.mw = main_window
117
-
118
114
 
119
115
  def show_about_dialog(self):
120
116
  """Show the custom About dialog with Easter egg functionality"""
@@ -84,10 +84,6 @@ except Exception:
84
84
  class MainWindowEdit3d(object):
85
85
  """ main_window.py から分離された機能クラス """
86
86
 
87
- def __init__(self, main_window):
88
- """ クラスの初期化 """
89
- self.mw = main_window
90
-
91
87
 
92
88
  def toggle_measurement_mode(self, checked):
93
89
  """測定モードのオン/オフを切り替える"""
@@ -102,10 +102,6 @@ except Exception:
102
102
  class MainWindowEditActions(object):
103
103
  """ main_window.py から分離された機能クラス """
104
104
 
105
- def __init__(self, main_window):
106
- """ クラスの初期化 """
107
- self.mw = main_window
108
-
109
105
 
110
106
  def copy_selection(self):
111
107
  """選択された原子と結合をクリップボードにコピーする"""
@@ -88,10 +88,6 @@ except Exception:
88
88
  class MainWindowExport(object):
89
89
  """ main_window.py から分離された機能クラス """
90
90
 
91
- def __init__(self, main_window):
92
- """ クラスの初期化 """
93
- self.mw = main_window
94
-
95
91
 
96
92
  def export_stl(self):
97
93
  """STLファイルとしてエクスポート(色なし)"""
@@ -1897,7 +1897,7 @@ class MainWindowMainInit(object):
1897
1897
 
1898
1898
  # Add action to the resolved parent_menu
1899
1899
  action = QAction(p['name'], self)
1900
- action.triggered.connect(lambda checked, mod=p['module']: self.plugin_manager.run_plugin(mod, self.mw if hasattr(self, 'mw') else self))
1900
+ action.triggered.connect(lambda checked, mod=p['module']: self.plugin_manager.run_plugin(mod, self))
1901
1901
  parent_menu.addAction(action)
1902
1902
 
1903
1903
  # 4. Integrate Export Actions into Export Button and Menu
@@ -1934,29 +1934,52 @@ class MainWindowMainInit(object):
1934
1934
  a.setData(PLUGIN_ACTION_TAG)
1935
1935
  menu.addAction(a)
1936
1936
 
1937
+ # 5. Integrate File Openers into Import Menu
1937
1938
  # 5. Integrate File Openers into Import Menu
1938
1939
  if hasattr(self, 'import_menu') and self.plugin_manager.file_openers:
1939
1940
  # Add separator
1940
1941
  sep = self.import_menu.addSeparator()
1941
1942
  sep.setData(PLUGIN_ACTION_TAG)
1942
1943
 
1944
+ # Group by Plugin Name
1945
+ plugin_map = {}
1943
1946
  for ext, info in self.plugin_manager.file_openers.items():
1944
- label = f"Import {ext} ({info.get('plugin', 'Plugin')})..."
1947
+ p_name = info.get('plugin', 'Plugin')
1948
+ if p_name not in plugin_map:
1949
+ plugin_map[p_name] = {}
1950
+ plugin_map[p_name][ext] = info['callback']
1951
+
1952
+ for p_name, ext_map in plugin_map.items():
1953
+ # Create combined label: "Import .ext1/.ext2 (PluginName)..."
1954
+ extensions = sorted(ext_map.keys())
1955
+ ext_str = "/".join(extensions)
1956
+ label = f"Import {ext_str} ({p_name})..."
1957
+
1958
+ # Create combined filter: "PluginName Files (*.ext1 *.ext2)"
1959
+ filter_exts = " ".join([f"*{e}" for e in extensions])
1960
+ filter_str = f"{p_name} Files ({filter_exts});;All Files (*)"
1945
1961
 
1946
- def make_cb(callback):
1962
+ # Factory for callback to fix closure capture
1963
+ def make_unified_cb(extensions_map, dialog_filter, plugin_nm):
1947
1964
  def _cb():
1948
1965
  fpath, _ = QFileDialog.getOpenFileName(
1949
- self, f"Import {ext}", "",
1950
- f"{info.get('plugin', 'Plugin')} File (*{ext});;All Files (*)"
1966
+ self, f"Import {plugin_nm} Files", "",
1967
+ dialog_filter
1951
1968
  )
1952
1969
  if fpath:
1953
- callback(fpath)
1954
- self.current_file_path = fpath
1955
- self.update_window_title()
1970
+ _, extension = os.path.splitext(fpath)
1971
+ extension = extension.lower()
1972
+ # Dispatch to specific callback
1973
+ if extension in extensions_map:
1974
+ extensions_map[extension](fpath)
1975
+ self.current_file_path = fpath
1976
+ self.update_window_title()
1977
+ else:
1978
+ self.statusBar().showMessage(f"No handler for extension {extension}")
1956
1979
  return _cb
1957
1980
 
1958
1981
  a = QAction(label, self)
1959
- a.triggered.connect(make_cb(info['callback']))
1982
+ a.triggered.connect(make_unified_cb(ext_map, filter_str, p_name))
1960
1983
  a.setData(PLUGIN_ACTION_TAG)
1961
1984
  self.import_menu.addAction(a)
1962
1985
 
@@ -88,10 +88,6 @@ except Exception:
88
88
  class MainWindowMolecularParsers(object):
89
89
  """ main_window.py から分離された機能クラス """
90
90
 
91
- def __init__(self, main_window):
92
- """ クラスの初期化 """
93
- self.mw = main_window
94
-
95
91
 
96
92
  def load_mol_file(self, file_path=None):
97
93
  if not self.check_unsaved_changes():
@@ -83,10 +83,6 @@ except Exception:
83
83
  class MainWindowProjectIo(object):
84
84
  """ main_window.py から分離された機能クラス """
85
85
 
86
- def __init__(self, main_window):
87
- """ クラスの初期化 """
88
- self.mw = main_window
89
-
90
86
 
91
87
  def save_project(self):
92
88
  """上書き保存(Ctrl+S)- デフォルトでPMEPRJ形式"""
@@ -82,10 +82,6 @@ except Exception:
82
82
  class MainWindowStringImporters(object):
83
83
  """ main_window.py から分離された機能クラス """
84
84
 
85
- def __init__(self, main_window):
86
- """ クラスの初期化 """
87
- self.mw = main_window
88
-
89
85
 
90
86
  def import_smiles_dialog(self):
91
87
  """ユーザーにSMILES文字列の入力を促すダイアログを表示する"""
@@ -88,10 +88,6 @@ except Exception:
88
88
  class MainWindowView3d(object):
89
89
  """ main_window.py から分離された機能クラス """
90
90
 
91
- def __init__(self, main_window):
92
- """ クラスの初期化 """
93
- self.mw = main_window
94
-
95
91
 
96
92
  def set_3d_style(self, style_name):
97
93
  """3D表示スタイルを設定し、ビューを更新する"""
@@ -121,7 +117,7 @@ class MainWindowView3d(object):
121
117
 
122
118
  def draw_molecule_3d(self, mol):
123
119
  """Dispatch to custom style or standard drawing."""
124
- mw = self.mw if hasattr(self, 'mw') else self
120
+ mw = self
125
121
 
126
122
  if hasattr(mw, 'plugin_manager') and hasattr(mw.plugin_manager, 'custom_3d_styles'):
127
123
  if hasattr(self, 'current_3d_style') and self.current_3d_style in mw.plugin_manager.custom_3d_styles:
@@ -79,10 +79,6 @@ except Exception:
79
79
  class MainWindowViewLoaders(object):
80
80
  """ main_window.py から分離された機能クラス """
81
81
 
82
- def __init__(self, main_window):
83
- """ クラスの初期化 """
84
- self.mw = main_window
85
-
86
82
  def load_xyz_for_3d_viewing(self, file_path=None):
87
83
  """XYZファイルを読み込んで3Dビューアで表示する"""
88
84
  if not file_path:
File without changes
File without changes
File without changes