moleditpy 0.3.6__tar.gz → 0.3.7__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.
- {moleditpy-0.3.6 → moleditpy-0.3.7}/PKG-INFO +16 -12
- {moleditpy-0.3.6 → moleditpy-0.3.7}/README.md +14 -10
- {moleditpy-0.3.6 → moleditpy-0.3.7}/pyproject.toml +2 -2
- {moleditpy-0.3.6 → moleditpy-0.3.7}/src/moleditpy/main.py +59 -18
- {moleditpy-0.3.6 → moleditpy-0.3.7}/src/moleditpy.egg-info/PKG-INFO +16 -12
- {moleditpy-0.3.6 → moleditpy-0.3.7}/setup.cfg +0 -0
- {moleditpy-0.3.6 → moleditpy-0.3.7}/src/moleditpy/__init__.py +0 -0
- {moleditpy-0.3.6 → moleditpy-0.3.7}/src/moleditpy/assets/icon.ico +0 -0
- {moleditpy-0.3.6 → moleditpy-0.3.7}/src/moleditpy/assets/icon.png +0 -0
- {moleditpy-0.3.6 → moleditpy-0.3.7}/src/moleditpy.egg-info/SOURCES.txt +0 -0
- {moleditpy-0.3.6 → moleditpy-0.3.7}/src/moleditpy.egg-info/dependency_links.txt +0 -0
- {moleditpy-0.3.6 → moleditpy-0.3.7}/src/moleditpy.egg-info/entry_points.txt +0 -0
- {moleditpy-0.3.6 → moleditpy-0.3.7}/src/moleditpy.egg-info/requires.txt +0 -0
- {moleditpy-0.3.6 → moleditpy-0.3.7}/src/moleditpy.egg-info/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: moleditpy
|
|
3
|
-
Version: 0.3.
|
|
4
|
-
Summary: A
|
|
3
|
+
Version: 0.3.7
|
|
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
|
|
7
7
|
Project-URL: Issues, https://github.com/HiroYokoyama/python_molecular_editor/issues
|
|
@@ -22,7 +22,11 @@ Requires-Dist: numpy
|
|
|
22
22
|
Requires-Dist: pyvista
|
|
23
23
|
Requires-Dist: pyvistaqt
|
|
24
24
|
|
|
25
|
-
#
|
|
25
|
+
# MoleditPy -- Python Molecular Editor
|
|
26
|
+
|
|
27
|
+
[](https://doi.org/10.5281/zenodo.17268533)
|
|
28
|
+
[](https://www.rdkit.org/)
|
|
29
|
+
|
|
26
30
|
|
|
27
31
|
Pythonで構築された、クロスプラットフォームかつシンプルで直感的な分子構造エディターです。2Dでの分子描画と、3D構造可視化ができます。DFT計算ソフト用のインプット用に構造ファイルのエクスポートをサポートします。
|
|
28
32
|
|
|
@@ -115,7 +119,7 @@ moleditpy
|
|
|
115
119
|
|
|
116
120
|
-----
|
|
117
121
|
|
|
118
|
-
## Windows ショートカットとファイル関連付けガイド
|
|
122
|
+
## Windows: ショートカットとファイル関連付けガイド
|
|
119
123
|
|
|
120
124
|
Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリックで開いたり、アイコン付きのショートカットからアプリケーションを起動したりするための詳細な設定手順です。
|
|
121
125
|
|
|
@@ -146,7 +150,7 @@ Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリ
|
|
|
146
150
|
|
|
147
151
|
1. **新規ショートカットの作成:** デスクトップなどの任意の場所を右クリックし、「新規作成」→\*\*「ショートカット」\*\*を選択します。
|
|
148
152
|
2. **実行ファイルのパスを入力:** 「項目の場所を入力してください」に、上記の実行ファイルのパスを入力し、「次へ」をクリックします。
|
|
149
|
-
3. **名前を指定:** ショートカットに任意の名前(例: `
|
|
153
|
+
3. **名前を指定:** ショートカットに任意の名前(例: `MoleditPy`)を付けて、「完了」をクリックします。
|
|
150
154
|
4. **アイコンの変更:**
|
|
151
155
|
* 作成されたショートカットを右クリックし、\*\*「プロパティ」\*\*を選択します。
|
|
152
156
|
* 「ショートカット」タブの\*\*「アイコンの変更...」\*\*ボタンをクリックします。
|
|
@@ -160,12 +164,12 @@ Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリ
|
|
|
160
164
|
1. **スタートメニューフォルダのパスを確認:** エクスプローラーのアドレスバーに以下のいずれかのパスを入力し、Enterキーを押します。
|
|
161
165
|
* **現在のユーザー専用 (推奨):** `%APPDATA%\Microsoft\Windows\Start Menu\Programs`
|
|
162
166
|
* **すべてのユーザー共通 (管理者権限が必要):** `%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs`
|
|
163
|
-
2. **ショートカットのコピーまたは移動:** 上記で開いたスタートメニューフォルダに、作成したショートカット(例: デスクトップ上の `
|
|
167
|
+
2. **ショートカットのコピーまたは移動:** 上記で開いたスタートメニューフォルダに、作成したショートカット(例: デスクトップ上の `MoleditPy` ショートカット)を**コピーまたは移動**します。(Ctrlキーを押しながらドラッグするとコピーされます。)
|
|
164
168
|
3. **確認:** スタートボタンをクリックし、プログラム一覧からショートカットに付けた名前が追加されていることを確認してください。
|
|
165
169
|
|
|
166
170
|
-----
|
|
167
171
|
|
|
168
|
-
## macOS
|
|
172
|
+
## macOS: Python CLIアプリをAutomator経由で.app化する方法
|
|
169
173
|
|
|
170
174
|
この手順では、`pip install moleditpy` でインストールしたPythonアプリをmacOS上で\*\*.appアプリケーション\*\*として使えるようにし、独自アイコンを設定します。
|
|
171
175
|
|
|
@@ -195,7 +199,7 @@ Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリ
|
|
|
195
199
|
### 4\. アプリとして保存
|
|
196
200
|
|
|
197
201
|
1. メニューから\*\*「ファイル」\*\* → **「保存」** を選択します。
|
|
198
|
-
2. 名前を **`
|
|
202
|
+
2. 名前を **`MoleditPy.app`** にします。
|
|
199
203
|
3. 保存場所は一時的にデスクトップなど任意で構いません。
|
|
200
204
|
|
|
201
205
|
### 5\. アプリケーションフォルダーへ移動
|
|
@@ -204,14 +208,14 @@ Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリ
|
|
|
204
208
|
|
|
205
209
|
**Finderからコピーする場合**
|
|
206
210
|
|
|
207
|
-
1. Finderで `
|
|
211
|
+
1. Finderで `MoleditPy.app` を選択し、`⌘ + C` でコピーします。
|
|
208
212
|
2. Finderメニューの「移動」→\*\*「アプリケーション」\*\* を開きます。
|
|
209
213
|
3. `⌘ + V` で貼り付けます。
|
|
210
214
|
|
|
211
215
|
**ターミナルからコピーする場合**
|
|
212
216
|
|
|
213
217
|
```bash
|
|
214
|
-
sudo cp -R ~/Desktop/
|
|
218
|
+
sudo cp -R ~/Desktop/MoleditPy.app /Applications/
|
|
215
219
|
```
|
|
216
220
|
|
|
217
221
|
### 6\. アイコンを設定
|
|
@@ -226,7 +230,7 @@ sudo cp -R ~/Desktop/moleditpy.app /Applications/
|
|
|
226
230
|
|
|
227
231
|
1. Finderで上記の `icon.png` を開きます。
|
|
228
232
|
2. 「プレビュー」で画像を開いた状態で `⌘ + A` で**全選択**、`⌘ + C` で**コピー**します。
|
|
229
|
-
3. Finderで `/Applications` フォルダー内の `
|
|
233
|
+
3. Finderで `/Applications` フォルダー内の `MoleditPy.app` を選択 → `⌘ + I`(情報を見る)を押します。
|
|
230
234
|
4. 左上の小さいアイコンをクリック(枠が出る) → `⌘ + V` で**貼り付け**ます。
|
|
231
235
|
これでアプリのアイコンが変更されます。
|
|
232
236
|
|
|
@@ -240,7 +244,7 @@ chmod +x /Users/<username>/Library/Python/<python_version>/bin/moleditpy
|
|
|
240
244
|
|
|
241
245
|
### 8\. 完了
|
|
242
246
|
|
|
243
|
-
これで `/Applications` にインストールされた **`
|
|
247
|
+
これで `/Applications` にインストールされた **`MoleditPy.app`** をダブルクリックするだけでPythonアプリが実行できます。
|
|
244
248
|
|
|
245
249
|
-----
|
|
246
250
|
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# MoleditPy -- Python Molecular Editor
|
|
2
|
+
|
|
3
|
+
[](https://doi.org/10.5281/zenodo.17268533)
|
|
4
|
+
[](https://www.rdkit.org/)
|
|
5
|
+
|
|
2
6
|
|
|
3
7
|
Pythonで構築された、クロスプラットフォームかつシンプルで直感的な分子構造エディターです。2Dでの分子描画と、3D構造可視化ができます。DFT計算ソフト用のインプット用に構造ファイルのエクスポートをサポートします。
|
|
4
8
|
|
|
@@ -91,7 +95,7 @@ moleditpy
|
|
|
91
95
|
|
|
92
96
|
-----
|
|
93
97
|
|
|
94
|
-
## Windows ショートカットとファイル関連付けガイド
|
|
98
|
+
## Windows: ショートカットとファイル関連付けガイド
|
|
95
99
|
|
|
96
100
|
Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリックで開いたり、アイコン付きのショートカットからアプリケーションを起動したりするための詳細な設定手順です。
|
|
97
101
|
|
|
@@ -122,7 +126,7 @@ Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリ
|
|
|
122
126
|
|
|
123
127
|
1. **新規ショートカットの作成:** デスクトップなどの任意の場所を右クリックし、「新規作成」→\*\*「ショートカット」\*\*を選択します。
|
|
124
128
|
2. **実行ファイルのパスを入力:** 「項目の場所を入力してください」に、上記の実行ファイルのパスを入力し、「次へ」をクリックします。
|
|
125
|
-
3. **名前を指定:** ショートカットに任意の名前(例: `
|
|
129
|
+
3. **名前を指定:** ショートカットに任意の名前(例: `MoleditPy`)を付けて、「完了」をクリックします。
|
|
126
130
|
4. **アイコンの変更:**
|
|
127
131
|
* 作成されたショートカットを右クリックし、\*\*「プロパティ」\*\*を選択します。
|
|
128
132
|
* 「ショートカット」タブの\*\*「アイコンの変更...」\*\*ボタンをクリックします。
|
|
@@ -136,12 +140,12 @@ Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリ
|
|
|
136
140
|
1. **スタートメニューフォルダのパスを確認:** エクスプローラーのアドレスバーに以下のいずれかのパスを入力し、Enterキーを押します。
|
|
137
141
|
* **現在のユーザー専用 (推奨):** `%APPDATA%\Microsoft\Windows\Start Menu\Programs`
|
|
138
142
|
* **すべてのユーザー共通 (管理者権限が必要):** `%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs`
|
|
139
|
-
2. **ショートカットのコピーまたは移動:** 上記で開いたスタートメニューフォルダに、作成したショートカット(例: デスクトップ上の `
|
|
143
|
+
2. **ショートカットのコピーまたは移動:** 上記で開いたスタートメニューフォルダに、作成したショートカット(例: デスクトップ上の `MoleditPy` ショートカット)を**コピーまたは移動**します。(Ctrlキーを押しながらドラッグするとコピーされます。)
|
|
140
144
|
3. **確認:** スタートボタンをクリックし、プログラム一覧からショートカットに付けた名前が追加されていることを確認してください。
|
|
141
145
|
|
|
142
146
|
-----
|
|
143
147
|
|
|
144
|
-
## macOS
|
|
148
|
+
## macOS: Python CLIアプリをAutomator経由で.app化する方法
|
|
145
149
|
|
|
146
150
|
この手順では、`pip install moleditpy` でインストールしたPythonアプリをmacOS上で\*\*.appアプリケーション\*\*として使えるようにし、独自アイコンを設定します。
|
|
147
151
|
|
|
@@ -171,7 +175,7 @@ Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリ
|
|
|
171
175
|
### 4\. アプリとして保存
|
|
172
176
|
|
|
173
177
|
1. メニューから\*\*「ファイル」\*\* → **「保存」** を選択します。
|
|
174
|
-
2. 名前を **`
|
|
178
|
+
2. 名前を **`MoleditPy.app`** にします。
|
|
175
179
|
3. 保存場所は一時的にデスクトップなど任意で構いません。
|
|
176
180
|
|
|
177
181
|
### 5\. アプリケーションフォルダーへ移動
|
|
@@ -180,14 +184,14 @@ Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリ
|
|
|
180
184
|
|
|
181
185
|
**Finderからコピーする場合**
|
|
182
186
|
|
|
183
|
-
1. Finderで `
|
|
187
|
+
1. Finderで `MoleditPy.app` を選択し、`⌘ + C` でコピーします。
|
|
184
188
|
2. Finderメニューの「移動」→\*\*「アプリケーション」\*\* を開きます。
|
|
185
189
|
3. `⌘ + V` で貼り付けます。
|
|
186
190
|
|
|
187
191
|
**ターミナルからコピーする場合**
|
|
188
192
|
|
|
189
193
|
```bash
|
|
190
|
-
sudo cp -R ~/Desktop/
|
|
194
|
+
sudo cp -R ~/Desktop/MoleditPy.app /Applications/
|
|
191
195
|
```
|
|
192
196
|
|
|
193
197
|
### 6\. アイコンを設定
|
|
@@ -202,7 +206,7 @@ sudo cp -R ~/Desktop/moleditpy.app /Applications/
|
|
|
202
206
|
|
|
203
207
|
1. Finderで上記の `icon.png` を開きます。
|
|
204
208
|
2. 「プレビュー」で画像を開いた状態で `⌘ + A` で**全選択**、`⌘ + C` で**コピー**します。
|
|
205
|
-
3. Finderで `/Applications` フォルダー内の `
|
|
209
|
+
3. Finderで `/Applications` フォルダー内の `MoleditPy.app` を選択 → `⌘ + I`(情報を見る)を押します。
|
|
206
210
|
4. 左上の小さいアイコンをクリック(枠が出る) → `⌘ + V` で**貼り付け**ます。
|
|
207
211
|
これでアプリのアイコンが変更されます。
|
|
208
212
|
|
|
@@ -216,7 +220,7 @@ chmod +x /Users/<username>/Library/Python/<python_version>/bin/moleditpy
|
|
|
216
220
|
|
|
217
221
|
### 8\. 完了
|
|
218
222
|
|
|
219
|
-
これで `/Applications` にインストールされた **`
|
|
223
|
+
これで `/Applications` にインストールされた **`MoleditPy.app`** をダブルクリックするだけでPythonアプリが実行できます。
|
|
220
224
|
|
|
221
225
|
-----
|
|
222
226
|
|
|
@@ -5,13 +5,13 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "moleditpy"
|
|
7
7
|
|
|
8
|
-
version = "0.3.
|
|
8
|
+
version = "0.3.7"
|
|
9
9
|
|
|
10
10
|
authors = [
|
|
11
11
|
{ name="HiroYokoyama", email="titech.yoko.hiro@gmail.com" },
|
|
12
12
|
]
|
|
13
13
|
|
|
14
|
-
description = "A
|
|
14
|
+
description = "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."
|
|
15
15
|
|
|
16
16
|
readme = "README.md"
|
|
17
17
|
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
3
4
|
"""
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
MoleditPy — A Python-based molecular editing software
|
|
6
|
+
|
|
6
7
|
Author: HiroYokoyama
|
|
7
8
|
License: Apache-2.0 license
|
|
8
9
|
Repo: https://github.com/HiroYokoyama/python_molecular_editor
|
|
10
|
+
DOI 10.5281/zenodo.17268532
|
|
9
11
|
"""
|
|
10
12
|
|
|
13
|
+
#Version
|
|
14
|
+
VERSION = "0.3.7"
|
|
15
|
+
|
|
11
16
|
import sys
|
|
12
17
|
import numpy as np
|
|
13
18
|
import pickle
|
|
@@ -83,7 +88,7 @@ VDW_RADII = {pt.GetElementSymbol(i): pt.GetRvdw(i) * 0.3 for i in range(1, 119)}
|
|
|
83
88
|
def main():
|
|
84
89
|
# --- Windows タスクバーアイコンのための追加処理 ---
|
|
85
90
|
if sys.platform == 'win32':
|
|
86
|
-
myappid = 'hyoko.moleditpy.0.
|
|
91
|
+
myappid = 'hyoko.moleditpy.0.3' # アプリケーション固有のID(任意)
|
|
87
92
|
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
|
|
88
93
|
|
|
89
94
|
app = QApplication(sys.argv)
|
|
@@ -1586,7 +1591,7 @@ class MainWindow(QMainWindow):
|
|
|
1586
1591
|
start_calculation = pyqtSignal(str)
|
|
1587
1592
|
def __init__(self, initial_file=None):
|
|
1588
1593
|
super().__init__()
|
|
1589
|
-
self.setWindowTitle("
|
|
1594
|
+
self.setWindowTitle("MoleditPy -- Python Molecular Editor Ver. " + VERSION); self.setGeometry(100, 100, 1400, 800)
|
|
1590
1595
|
self.data = MolecularData(); self.current_mol = None
|
|
1591
1596
|
self.current_3d_style = 'ball_and_stick'
|
|
1592
1597
|
self.show_chiral_labels = False
|
|
@@ -2291,6 +2296,8 @@ class MainWindow(QMainWindow):
|
|
|
2291
2296
|
for atom_id, data in self.data.atoms.items()}
|
|
2292
2297
|
bonds = {key: {'order': data['order'], 'stereo': data.get('stereo', 0)} for key, data in self.data.bonds.items()}
|
|
2293
2298
|
state = {'atoms': atoms, 'bonds': bonds, '_next_atom_id': self.data._next_atom_id}
|
|
2299
|
+
|
|
2300
|
+
state['version'] = VERSION
|
|
2294
2301
|
|
|
2295
2302
|
if self.current_mol: state['mol_3d'] = self.current_mol.ToBinary()
|
|
2296
2303
|
|
|
@@ -2300,6 +2307,26 @@ class MainWindow(QMainWindow):
|
|
|
2300
2307
|
self.clear_2d_editor(push_to_undo=False)
|
|
2301
2308
|
|
|
2302
2309
|
loaded_data = copy.deepcopy(state_data)
|
|
2310
|
+
|
|
2311
|
+
# ファイルのバージョンを取得(存在しない場合は '0.0.0' とする)
|
|
2312
|
+
file_version_str = loaded_data.get('version', '0.0.0')
|
|
2313
|
+
|
|
2314
|
+
try:
|
|
2315
|
+
app_version_parts = tuple(map(int, VERSION.split('.')))
|
|
2316
|
+
file_version_parts = tuple(map(int, file_version_str.split('.')))
|
|
2317
|
+
|
|
2318
|
+
# ファイルのバージョンがアプリケーションのバージョンより新しい場合に警告
|
|
2319
|
+
if file_version_parts > app_version_parts:
|
|
2320
|
+
QMessageBox.warning(
|
|
2321
|
+
self,
|
|
2322
|
+
"Version Mismatch",
|
|
2323
|
+
f"The file you are opening was saved with a newer version of MoleditPy (ver. {file_version_str}).\n\n"
|
|
2324
|
+
f"Your current version is {VERSION}.\n\n"
|
|
2325
|
+
"Some features may not load or work correctly."
|
|
2326
|
+
)
|
|
2327
|
+
except (ValueError, AttributeError):
|
|
2328
|
+
pass
|
|
2329
|
+
|
|
2303
2330
|
raw_atoms = loaded_data.get('atoms', {})
|
|
2304
2331
|
raw_bonds = loaded_data.get('bonds', {})
|
|
2305
2332
|
|
|
@@ -2577,7 +2604,7 @@ class MainWindow(QMainWindow):
|
|
|
2577
2604
|
try:
|
|
2578
2605
|
conf=self.current_mol.GetConformer(); num_atoms=self.current_mol.GetNumAtoms()
|
|
2579
2606
|
xyz_lines=[str(num_atoms)]; smiles=Chem.MolToSmiles(Chem.RemoveHs(self.current_mol))
|
|
2580
|
-
xyz_lines.append(f"Generated by
|
|
2607
|
+
xyz_lines.append(f"Generated by MoleditPy Ver. {VERSION}. SMILES: {smiles}")
|
|
2581
2608
|
for i in range(num_atoms):
|
|
2582
2609
|
pos=conf.GetAtomPosition(i); symbol=self.current_mol.GetAtomWithIdx(i).GetSymbol()
|
|
2583
2610
|
xyz_lines.append(f"{symbol} {pos.x:.6f} {pos.y:.6f} {pos.z:.6f}")
|
|
@@ -2828,8 +2855,11 @@ class MainWindow(QMainWindow):
|
|
|
2828
2855
|
edge_color = '#505050'
|
|
2829
2856
|
self.plotter.add_mesh(glyphs, scalars='colors', rgb=True, smooth_shading=True, show_edges=True, edge_color=edge_color, edge_opacity=0.3, line_width=0.1)
|
|
2830
2857
|
|
|
2831
|
-
|
|
2858
|
+
|
|
2832
2859
|
if self.current_3d_style == 'ball_and_stick':
|
|
2860
|
+
# 結合メッシュを一時的に格納するリストを作成
|
|
2861
|
+
bond_meshes = []
|
|
2862
|
+
|
|
2833
2863
|
for bond in mol.GetBonds():
|
|
2834
2864
|
sp = np.array(conf.GetAtomPosition(bond.GetBeginAtomIdx()))
|
|
2835
2865
|
ep = np.array(conf.GetAtomPosition(bond.GetEndAtomIdx()))
|
|
@@ -2838,11 +2868,13 @@ class MainWindow(QMainWindow):
|
|
|
2838
2868
|
d = ep - sp
|
|
2839
2869
|
h = np.linalg.norm(d)
|
|
2840
2870
|
if h == 0: continue
|
|
2841
|
-
|
|
2871
|
+
|
|
2872
|
+
# この時点では add_mesh しない
|
|
2842
2873
|
if bt == Chem.rdchem.BondType.SINGLE or bt == Chem.rdchem.BondType.AROMATIC:
|
|
2843
2874
|
cyl = pv.Cylinder(center=c, direction=d, radius=0.1, height=h)
|
|
2844
|
-
|
|
2875
|
+
bond_meshes.append(cyl)
|
|
2845
2876
|
else:
|
|
2877
|
+
# (二重結合・三重結合のロジックも同様に、生成したメッシュをリストに追加する)
|
|
2846
2878
|
v1 = d / h
|
|
2847
2879
|
v_arb = np.array([0, 0, 1])
|
|
2848
2880
|
if np.allclose(np.abs(np.dot(v1, v_arb)), 1.0): v_arb = np.array([0, 1, 0])
|
|
@@ -2853,19 +2885,28 @@ class MainWindow(QMainWindow):
|
|
|
2853
2885
|
s = 0.20
|
|
2854
2886
|
c1 = c + off_dir * (s / 2)
|
|
2855
2887
|
c2 = c - off_dir * (s / 2)
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
self.plotter.add_mesh(cyl1, color=color, smooth_shading=True, show_edges=True, edge_color=edge_color, edge_opacity=0.3)
|
|
2859
|
-
self.plotter.add_mesh(cyl2, color=color, smooth_shading=True, show_edges=True, edge_color=edge_color, edge_opacity=0.3)
|
|
2888
|
+
bond_meshes.append(pv.Cylinder(center=c1, direction=d, radius=r, height=h))
|
|
2889
|
+
bond_meshes.append(pv.Cylinder(center=c2, direction=d, radius=r, height=h))
|
|
2860
2890
|
elif bt == Chem.rdchem.BondType.TRIPLE:
|
|
2861
2891
|
r = 0.08
|
|
2862
2892
|
s = 0.20
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2893
|
+
bond_meshes.append(pv.Cylinder(center=c, direction=d, radius=r, height=h))
|
|
2894
|
+
bond_meshes.append(pv.Cylinder(center=c + off_dir * s, direction=d, radius=r, height=h))
|
|
2895
|
+
bond_meshes.append(pv.Cylinder(center=c - off_dir * s, direction=d, radius=r, height=h))
|
|
2896
|
+
|
|
2897
|
+
# ループが終わった後、リストに溜めた全メッシュを1つに統合
|
|
2898
|
+
if bond_meshes:
|
|
2899
|
+
combined_bonds = pv.merge(bond_meshes)
|
|
2900
|
+
# 最後に一度だけ add_mesh を呼び出す
|
|
2901
|
+
self.plotter.add_meshedge_color = '#505050'
|
|
2902
|
+
self.plotter.add_mesh(
|
|
2903
|
+
combined_bonds,
|
|
2904
|
+
color=[0.5, 0.5, 0.5],
|
|
2905
|
+
smooth_shading=True,
|
|
2906
|
+
show_edges=True,
|
|
2907
|
+
edge_color=edge_color,
|
|
2908
|
+
edge_opacity=0.3
|
|
2909
|
+
)
|
|
2869
2910
|
|
|
2870
2911
|
# chiral labels: 3D コンフォマーを持つ場合はここで R/S を表示
|
|
2871
2912
|
if getattr(self, 'show_chiral_labels', False):
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: moleditpy
|
|
3
|
-
Version: 0.3.
|
|
4
|
-
Summary: A
|
|
3
|
+
Version: 0.3.7
|
|
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
|
|
7
7
|
Project-URL: Issues, https://github.com/HiroYokoyama/python_molecular_editor/issues
|
|
@@ -22,7 +22,11 @@ Requires-Dist: numpy
|
|
|
22
22
|
Requires-Dist: pyvista
|
|
23
23
|
Requires-Dist: pyvistaqt
|
|
24
24
|
|
|
25
|
-
#
|
|
25
|
+
# MoleditPy -- Python Molecular Editor
|
|
26
|
+
|
|
27
|
+
[](https://doi.org/10.5281/zenodo.17268533)
|
|
28
|
+
[](https://www.rdkit.org/)
|
|
29
|
+
|
|
26
30
|
|
|
27
31
|
Pythonで構築された、クロスプラットフォームかつシンプルで直感的な分子構造エディターです。2Dでの分子描画と、3D構造可視化ができます。DFT計算ソフト用のインプット用に構造ファイルのエクスポートをサポートします。
|
|
28
32
|
|
|
@@ -115,7 +119,7 @@ moleditpy
|
|
|
115
119
|
|
|
116
120
|
-----
|
|
117
121
|
|
|
118
|
-
## Windows ショートカットとファイル関連付けガイド
|
|
122
|
+
## Windows: ショートカットとファイル関連付けガイド
|
|
119
123
|
|
|
120
124
|
Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリックで開いたり、アイコン付きのショートカットからアプリケーションを起動したりするための詳細な設定手順です。
|
|
121
125
|
|
|
@@ -146,7 +150,7 @@ Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリ
|
|
|
146
150
|
|
|
147
151
|
1. **新規ショートカットの作成:** デスクトップなどの任意の場所を右クリックし、「新規作成」→\*\*「ショートカット」\*\*を選択します。
|
|
148
152
|
2. **実行ファイルのパスを入力:** 「項目の場所を入力してください」に、上記の実行ファイルのパスを入力し、「次へ」をクリックします。
|
|
149
|
-
3. **名前を指定:** ショートカットに任意の名前(例: `
|
|
153
|
+
3. **名前を指定:** ショートカットに任意の名前(例: `MoleditPy`)を付けて、「完了」をクリックします。
|
|
150
154
|
4. **アイコンの変更:**
|
|
151
155
|
* 作成されたショートカットを右クリックし、\*\*「プロパティ」\*\*を選択します。
|
|
152
156
|
* 「ショートカット」タブの\*\*「アイコンの変更...」\*\*ボタンをクリックします。
|
|
@@ -160,12 +164,12 @@ Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリ
|
|
|
160
164
|
1. **スタートメニューフォルダのパスを確認:** エクスプローラーのアドレスバーに以下のいずれかのパスを入力し、Enterキーを押します。
|
|
161
165
|
* **現在のユーザー専用 (推奨):** `%APPDATA%\Microsoft\Windows\Start Menu\Programs`
|
|
162
166
|
* **すべてのユーザー共通 (管理者権限が必要):** `%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs`
|
|
163
|
-
2. **ショートカットのコピーまたは移動:** 上記で開いたスタートメニューフォルダに、作成したショートカット(例: デスクトップ上の `
|
|
167
|
+
2. **ショートカットのコピーまたは移動:** 上記で開いたスタートメニューフォルダに、作成したショートカット(例: デスクトップ上の `MoleditPy` ショートカット)を**コピーまたは移動**します。(Ctrlキーを押しながらドラッグするとコピーされます。)
|
|
164
168
|
3. **確認:** スタートボタンをクリックし、プログラム一覧からショートカットに付けた名前が追加されていることを確認してください。
|
|
165
169
|
|
|
166
170
|
-----
|
|
167
171
|
|
|
168
|
-
## macOS
|
|
172
|
+
## macOS: Python CLIアプリをAutomator経由で.app化する方法
|
|
169
173
|
|
|
170
174
|
この手順では、`pip install moleditpy` でインストールしたPythonアプリをmacOS上で\*\*.appアプリケーション\*\*として使えるようにし、独自アイコンを設定します。
|
|
171
175
|
|
|
@@ -195,7 +199,7 @@ Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリ
|
|
|
195
199
|
### 4\. アプリとして保存
|
|
196
200
|
|
|
197
201
|
1. メニューから\*\*「ファイル」\*\* → **「保存」** を選択します。
|
|
198
|
-
2. 名前を **`
|
|
202
|
+
2. 名前を **`MoleditPy.app`** にします。
|
|
199
203
|
3. 保存場所は一時的にデスクトップなど任意で構いません。
|
|
200
204
|
|
|
201
205
|
### 5\. アプリケーションフォルダーへ移動
|
|
@@ -204,14 +208,14 @@ Windows環境でプロジェクトファイル(`.pmeraw`)をダブルクリ
|
|
|
204
208
|
|
|
205
209
|
**Finderからコピーする場合**
|
|
206
210
|
|
|
207
|
-
1. Finderで `
|
|
211
|
+
1. Finderで `MoleditPy.app` を選択し、`⌘ + C` でコピーします。
|
|
208
212
|
2. Finderメニューの「移動」→\*\*「アプリケーション」\*\* を開きます。
|
|
209
213
|
3. `⌘ + V` で貼り付けます。
|
|
210
214
|
|
|
211
215
|
**ターミナルからコピーする場合**
|
|
212
216
|
|
|
213
217
|
```bash
|
|
214
|
-
sudo cp -R ~/Desktop/
|
|
218
|
+
sudo cp -R ~/Desktop/MoleditPy.app /Applications/
|
|
215
219
|
```
|
|
216
220
|
|
|
217
221
|
### 6\. アイコンを設定
|
|
@@ -226,7 +230,7 @@ sudo cp -R ~/Desktop/moleditpy.app /Applications/
|
|
|
226
230
|
|
|
227
231
|
1. Finderで上記の `icon.png` を開きます。
|
|
228
232
|
2. 「プレビュー」で画像を開いた状態で `⌘ + A` で**全選択**、`⌘ + C` で**コピー**します。
|
|
229
|
-
3. Finderで `/Applications` フォルダー内の `
|
|
233
|
+
3. Finderで `/Applications` フォルダー内の `MoleditPy.app` を選択 → `⌘ + I`(情報を見る)を押します。
|
|
230
234
|
4. 左上の小さいアイコンをクリック(枠が出る) → `⌘ + V` で**貼り付け**ます。
|
|
231
235
|
これでアプリのアイコンが変更されます。
|
|
232
236
|
|
|
@@ -240,7 +244,7 @@ chmod +x /Users/<username>/Library/Python/<python_version>/bin/moleditpy
|
|
|
240
244
|
|
|
241
245
|
### 8\. 完了
|
|
242
246
|
|
|
243
|
-
これで `/Applications` にインストールされた **`
|
|
247
|
+
これで `/Applications` にインストールされた **`MoleditPy.app`** をダブルクリックするだけでPythonアプリが実行できます。
|
|
244
248
|
|
|
245
249
|
-----
|
|
246
250
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|