cosmol-viewer 0.1.5.dev7__cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl → 0.1.7__cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
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.
Potentially problematic release.
This version of cosmol-viewer might be problematic. Click here for more details.
- cosmol_viewer/__init__.pyi +8 -8
- cosmol_viewer/cosmol_viewer.abi3.so +0 -0
- {cosmol_viewer-0.1.5.dev7.dist-info → cosmol_viewer-0.1.7.dist-info}/METADATA +35 -31
- cosmol_viewer-0.1.7.dist-info/RECORD +7 -0
- cosmol_viewer-0.1.5.dev7.dist-info/RECORD +0 -7
- {cosmol_viewer-0.1.5.dev7.dist-info → cosmol_viewer-0.1.7.dist-info}/WHEEL +0 -0
cosmol_viewer/__init__.pyi
CHANGED
|
@@ -5,7 +5,7 @@ def parse_sdf(
|
|
|
5
5
|
keep_h: bool = True,
|
|
6
6
|
multimodel: bool = True,
|
|
7
7
|
onemol: bool = False
|
|
8
|
-
) -> MoleculeData:
|
|
8
|
+
) -> "MoleculeData":
|
|
9
9
|
"""
|
|
10
10
|
Parse an SDF string into molecule data.
|
|
11
11
|
|
|
@@ -28,7 +28,7 @@ def parse_sdf(
|
|
|
28
28
|
|
|
29
29
|
def parse_mmcif(
|
|
30
30
|
mmcif: str
|
|
31
|
-
) -> ProteinData:
|
|
31
|
+
) -> "ProteinData":
|
|
32
32
|
"""
|
|
33
33
|
Parse an MMCIF string into protein data.
|
|
34
34
|
|
|
@@ -374,13 +374,13 @@ class Protein:
|
|
|
374
374
|
```
|
|
375
375
|
"""
|
|
376
376
|
|
|
377
|
-
def __init__(self,
|
|
377
|
+
def __init__(self, mmcif_data: "ProteinData") -> None: ...
|
|
378
378
|
def get_center(self) -> List[float]: ...
|
|
379
|
-
def centered(self) -> "
|
|
380
|
-
def color(self, color: List[float]) -> "
|
|
381
|
-
def color_rgba(self, color: List[float]) -> "
|
|
382
|
-
def opacity(self, opacity: float) -> "
|
|
383
|
-
def reset_color(self) -> "
|
|
379
|
+
def centered(self) -> "Protein": ...
|
|
380
|
+
def color(self, color: List[float]) -> "Protein": ...
|
|
381
|
+
def color_rgba(self, color: List[float]) -> "Protein": ...
|
|
382
|
+
def opacity(self, opacity: float) -> "Protein": ...
|
|
383
|
+
def reset_color(self) -> "Protein": ...
|
|
384
384
|
|
|
385
385
|
class ProteinData:
|
|
386
386
|
"""
|
|
Binary file
|
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cosmol-viewer
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: Molecular visualization tools
|
|
5
5
|
Author-email: 95028 <wjt@cosmol.org>
|
|
6
6
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
7
7
|
Project-URL: Repository, https://github.com/COSMol-repl/COSMol-viewer
|
|
8
8
|
|
|
9
9
|
# COSMol-viewer
|
|
10
|
+
A high-performance molecular viewer for Python and Rust, powered by a unified Rust core.
|
|
11
|
+
It supports both in-notebook visualization and native desktop rendering, with smooth playback for scientific animations.
|
|
10
12
|
|
|
11
13
|
<div align="center">
|
|
12
14
|
<a href="https://crates.io/crates/cosmol_viewer">
|
|
13
|
-
<img src="https://img.shields.io/crates/v/cosmol_viewer.svg" alt="crates.io Latest Release"/>
|
|
15
|
+
<img src="https://img.shields.io/crates/v/cosmol_viewer.svg" alt="crates.io Latest Release" />
|
|
14
16
|
</a>
|
|
15
17
|
<a href="https://pypi.org/project/cosmol_viewer/">
|
|
16
|
-
<img src="https://img.shields.io/pypi/v/cosmol_viewer.svg" alt="PyPi Latest Release"/>
|
|
18
|
+
<img src="https://img.shields.io/pypi/v/cosmol_viewer.svg" alt="PyPi Latest Release" />
|
|
17
19
|
</a>
|
|
18
20
|
<a href="https://cosmol-repl.github.io/COSMol-viewer">
|
|
19
|
-
<img src="https://img.shields.io/badge/docs-latest-blue.svg" alt="Documentation Status"/>
|
|
21
|
+
<img src="https://img.shields.io/badge/docs-latest-blue.svg" alt="Documentation Status" />
|
|
20
22
|
</a>
|
|
21
23
|
</div>
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
COSMol-viewer is a compact, cross-platform renderer for molecular and geometric scenes.
|
|
26
|
+
Unlike purely notebook-bound solutions such as py3Dmol, COSMol-viewer runs everywhere:
|
|
25
27
|
|
|
28
|
+
- Native desktop window (Python or Rust) via `egui`
|
|
29
|
+
- Jupyter / IPython notebook via WASM backend
|
|
30
|
+
- Rust applications
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- **Static rendering + update** — push individual scene updates from your application or simulation.
|
|
30
|
-
- **Play (recommended for demonstrations & smooth playback)** — precompute frames and hand the sequence to the viewer to play back with optional interpolation (`smooth`).
|
|
32
|
+
All implementations share the same Rust rendering engine, ensuring consistent performance and visual output.
|
|
31
33
|
|
|
32
34
|
---
|
|
33
35
|
|
|
34
36
|
## Quick concepts
|
|
35
37
|
|
|
36
|
-
- **Scene**: container for shapes (molecules,
|
|
38
|
+
- **Scene**: container for shapes (molecules, proteins, spheres, etc.).
|
|
37
39
|
- **Viewer.render(scene, ...)**: create a static viewer bound to a canvas (native or notebook). Good for static visualization.
|
|
38
|
-
- **viewer.update(scene)**: push incremental changes (real-time / streaming use-cases).
|
|
40
|
+
- **viewer.update(scene)**: push incremental changes after `Viewer.render()` (real-time / streaming use-cases).
|
|
39
41
|
- **Viewer.play(frames, interval, loops, width, height, smooth)**: *recommended* for precomputed animations and demonstrations. The viewer takes care of playback timing and looping.
|
|
40
42
|
|
|
41
43
|
**Why prefer `play` for demos?**
|
|
@@ -48,27 +50,23 @@ A compact, high-performance renderer for molecular and scientific shapes with tw
|
|
|
48
50
|
|
|
49
51
|
---
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
# Usage
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```
|
|
55
|
+
## python
|
|
56
|
+
See examples in [Google Colab](https://colab.research.google.com/drive/1Sw72QWjQh_sbbY43jGyBOfF1AQCycmIx?usp=sharing).
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
Install with `pip install cosmol-viewer`
|
|
58
59
|
|
|
59
|
-
## Quick Start
|
|
60
|
-
See examples in [Google Colab](https://colab.research.google.com/drive/1Sw72QWjQh_sbbY43jGyBOfF1AQCycmIx?usp=sharing).
|
|
61
60
|
### 1. Static molecular rendering
|
|
62
61
|
|
|
63
62
|
```python
|
|
64
63
|
from cosmol_viewer import Scene, Viewer, parse_sdf, Molecules
|
|
64
|
+
|
|
65
|
+
mol_data = parse_sdf(open("molecule.sdf", "r", encoding="utf-8").read())
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
sdf = f.read()
|
|
68
|
-
mol = Molecules(parse_sdf(sdf)).centered()
|
|
67
|
+
mol = Molecules(mol_data).centered()
|
|
69
68
|
|
|
70
69
|
scene = Scene()
|
|
71
|
-
scene.scale(0.1)
|
|
72
70
|
scene.add_shape(mol, "mol")
|
|
73
71
|
|
|
74
72
|
viewer = Viewer.render(scene, width=600, height=400)
|
|
@@ -81,9 +79,6 @@ _ = input() # Keep the viewer open until you decide to close
|
|
|
81
79
|
|
|
82
80
|
```python
|
|
83
81
|
from cosmol_viewer import Scene, Viewer, parse_sdf, Molecules
|
|
84
|
-
import time
|
|
85
|
-
|
|
86
|
-
interval = 0.033 # ~30 FPS
|
|
87
82
|
|
|
88
83
|
frames = []
|
|
89
84
|
|
|
@@ -93,15 +88,24 @@ for i in range(1, 10):
|
|
|
93
88
|
mol = Molecules(parse_sdf(sdf)).centered()
|
|
94
89
|
|
|
95
90
|
scene = Scene()
|
|
96
|
-
scene.scale(0.1)
|
|
97
91
|
scene.add_shape(mol, "mol")
|
|
98
|
-
|
|
99
92
|
frames.append(scene)
|
|
100
93
|
|
|
101
|
-
Viewer.play(frames, interval=
|
|
94
|
+
Viewer.play(frames, interval=0.033, loops=-1, width=800, height=500, smooth=True) # loops=-1 for infinite repeat
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
more examples can be found in the [examples](https://github.com/COSMol-repl/COSMol-viewer/tree/main/cosmol_viewer/examples) folder:
|
|
98
|
+
```bash
|
|
99
|
+
cd cosmol_viewer
|
|
100
|
+
python .\examples\render_protein.py
|
|
102
101
|
```
|
|
103
102
|
|
|
104
|
-
|
|
103
|
+
# Documentation
|
|
104
|
+
|
|
105
|
+
Please check out our documentation at [here](https://cosmol-repl.github.io/COSMol-viewer/).
|
|
106
|
+
|
|
107
|
+
---
|
|
105
108
|
|
|
106
|
-
|
|
109
|
+
# Contact
|
|
107
110
|
|
|
111
|
+
For any questions, issues, or suggestions, please contact [wjt@cosmol.org](mailto:wjt@cosmol.org) or open an issue in the repository. We will review and address them as promptly as possible.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
cosmol_viewer-0.1.7.dist-info/METADATA,sha256=vcEi0GjgyKTUmhvB-LJxpoqdUE6JzQKf8W1zte1ESVs,3984
|
|
2
|
+
cosmol_viewer-0.1.7.dist-info/WHEEL,sha256=oB91FzNpC-hO8c8ewOPvbQZBthpYN_59_Trh5rKisIg,139
|
|
3
|
+
cosmol_viewer/__init__.py,sha256=K33zoYpHqUVvpFdMVxmCtw4uKj9ZXrGuQD4D4DuUmjk,135
|
|
4
|
+
cosmol_viewer/__init__.pyi,sha256=dHeDzQd2wiBI2j6byAn6bxnVRxXNGVRBDYLaHPYVr4c,10210
|
|
5
|
+
cosmol_viewer/cosmol_viewer.abi3.so,sha256=mqNEkOROmnWhd4kx8xQ040MG8XjawSgRvuY2z_6ifII,14092820
|
|
6
|
+
cosmol_viewer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
cosmol_viewer-0.1.7.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
cosmol_viewer-0.1.5.dev7.dist-info/METADATA,sha256=qaTJlkdyqV0wercZDDVmYbUY1x_UXNX8UuhBC8uCBAk,3579
|
|
2
|
-
cosmol_viewer-0.1.5.dev7.dist-info/WHEEL,sha256=oB91FzNpC-hO8c8ewOPvbQZBthpYN_59_Trh5rKisIg,139
|
|
3
|
-
cosmol_viewer/__init__.py,sha256=K33zoYpHqUVvpFdMVxmCtw4uKj9ZXrGuQD4D4DuUmjk,135
|
|
4
|
-
cosmol_viewer/__init__.pyi,sha256=fNOQlMLuOiY6IJxHG8hmdJxeaSbaz4Vn45f3oi17Gyg,10220
|
|
5
|
-
cosmol_viewer/cosmol_viewer.abi3.so,sha256=v5k_up9PYWf9jccaRx54yW8qwVIxrG_ISXYUeSzNOf0,29500808
|
|
6
|
-
cosmol_viewer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
cosmol_viewer-0.1.5.dev7.dist-info/RECORD,,
|
|
File without changes
|