moleditpy 1.2.4__tar.gz → 1.2.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moleditpy
3
- Version: 1.2.4
3
+ Version: 1.2.6
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
  Project-URL: Homepage, https://github.com/HiroYokoyama/python_molecular_editor
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "moleditpy"
7
7
 
8
- version = "1.2.4"
8
+ version = "1.2.6"
9
9
 
10
10
  authors = [
11
11
  { name="HiroYokoyama", email="titech.yoko.hiro@gmail.com" },
@@ -11,7 +11,7 @@ DOI 10.5281/zenodo.17268532
11
11
  """
12
12
 
13
13
  #Version
14
- VERSION = '1.2.4'
14
+ VERSION = '1.2.6'
15
15
 
16
16
  print("-----------------------------------------------------")
17
17
  print("MoleditPy — A Python-based molecular editing software")
@@ -41,7 +41,7 @@ from PyQt6.QtGui import (
41
41
  QPen, QBrush, QColor, QPainter, QAction, QActionGroup, QFont, QPolygonF,
42
42
  QPainterPath, QPainterPathStroker, QFontMetrics, QFontMetricsF, QKeySequence, QTransform, QCursor, QPixmap, QIcon, QShortcut, QDesktopServices
43
43
  )
44
- from PyQt6.QtCore import Qt, QPointF, QRectF, QLineF, QObject, QThread, pyqtSignal, QEvent, QMimeData, QByteArray, QUrl
44
+ from PyQt6.QtCore import Qt, QPointF, QRectF, QLineF, QObject, QThread, pyqtSignal, QEvent, QMimeData, QByteArray, QUrl, QTimer
45
45
 
46
46
  from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera
47
47
 
@@ -3070,6 +3070,7 @@ class MainWindow(QMainWindow):
3070
3070
  try:
3071
3071
  self.current_mol = Chem.Mol(loaded_data['mol_3d'])
3072
3072
  self.draw_molecule_3d(self.current_mol)
3073
+ self.plotter.reset_camera()
3073
3074
  self.analysis_action.setEnabled(True)
3074
3075
  self.optimize_3d_button.setEnabled(True)
3075
3076
  self.export_button.setEnabled(True)
@@ -3321,7 +3322,7 @@ class MainWindow(QMainWindow):
3321
3322
 
3322
3323
  self.statusBar().showMessage(f"Successfully loaded from SMILES.")
3323
3324
  self.reset_undo_stack()
3324
- self.fit_to_view()
3325
+ QTimer.singleShot(0, self.fit_to_view)
3325
3326
  except Exception as e:
3326
3327
  self.statusBar().showMessage(f"Error loading from SMILES: {e}")
3327
3328
 
@@ -3388,8 +3389,8 @@ class MainWindow(QMainWindow):
3388
3389
  self.scene.create_bond(a1_item, a2_item, bond_order=int(b_type), bond_stereo=stereo)
3389
3390
 
3390
3391
  self.statusBar().showMessage(f"Successfully loaded {file_path}")
3391
- self.fit_to_view()
3392
3392
  self.reset_undo_stack()
3393
+ QTimer.singleShot(0, self.fit_to_view)
3393
3394
  except Exception as e: self.statusBar().showMessage(f"Error loading file: {e}")
3394
3395
 
3395
3396
  def save_raw_data(self):
@@ -3415,6 +3416,7 @@ class MainWindow(QMainWindow):
3415
3416
  self.set_state_from_data(loaded_data)
3416
3417
  self.statusBar().showMessage(f"Project loaded from {file_path}")
3417
3418
  self.reset_undo_stack()
3419
+ QTimer.singleShot(0, self.fit_to_view)
3418
3420
  except Exception as e: self.statusBar().showMessage(f"Error loading project file: {e}")
3419
3421
 
3420
3422
  def save_as_mol(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moleditpy
3
- Version: 1.2.4
3
+ Version: 1.2.6
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
  Project-URL: Homepage, https://github.com/HiroYokoyama/python_molecular_editor
File without changes
File without changes