pyiraspa 0.1.0__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.
pyiraspa-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 David Dubbeldam, Jocelyne Vreede, Sofia Calero, and Thijs J.H. Vlugt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,96 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyiraspa
3
+ Version: 0.1.0
4
+ Summary: Jupyter frontend for iRASPA-WebGPU (WebGPU crystallographic viewer)
5
+ Author: David Dubbeldam, Jocelyne Vreede, Sofia Calero, Thijs J.H. Vlugt
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/iraspa/iRASPA-WebGPU
8
+ Project-URL: Repository, https://github.com/iraspa/iRASPA-WebGPU
9
+ Project-URL: Issues, https://github.com/iraspa/iRASPA-WebGPU/issues
10
+ Keywords: crystallography,molecular-visualization,webgpu,jupyter,cif,mof,iraspa
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Framework :: IPython
13
+ Classifier: Framework :: Jupyter
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
19
+ Classifier: Topic :: Scientific/Engineering :: Visualization
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: ipython
24
+ Dynamic: license-file
25
+
26
+ # pyiraspa
27
+
28
+ Jupyter frontend for **iRASPA-WebGPU**, a WebGPU crystallographic viewer
29
+ inspired by [iRASPA](https://github.com/iRASPA/iRASPA-QT), with a
30
+ py3Dmol-style Python API. Reads CIF/mmCIF (with space-group expansion), XYZ,
31
+ POSCAR/CONTCAR, PDB, Gaussian cube and CHGCAR.
32
+
33
+ ## Install
34
+
35
+ ```bash
36
+ pip install pyiraspa
37
+ ```
38
+
39
+ The JavaScript viewer is bundled in the package; no Node toolchain is needed.
40
+ Requires a browser with **WebGPU** support (Chrome/Edge 113+, Safari 18+).
41
+
42
+ ## Usage
43
+
44
+ ```python
45
+ import pyiraspa
46
+ v = pyiraspa.view(width=640, height=480)
47
+ v.addModel(open("structure.cif").read(), "cif")
48
+ v.setStyle({"sphere": {"scale": 0.25}, "stick": {"radius": 0.12}})
49
+ v.addUnitCell()
50
+ v.zoomTo()
51
+ v
52
+ ```
53
+
54
+ ## Crystal builder (SymmetryKit)
55
+
56
+ Build an asymmetric unit; the viewer expands the space group:
57
+
58
+ ```python
59
+ from pyiraspa import Crystal, view
60
+
61
+ s = Crystal(
62
+ cell=(11.8671, 11.8671, 11.8671),
63
+ spacegroup=221, # or "Pm-3m"
64
+ sites=[
65
+ ("Si", 0.3683, 0.1847, 0.0),
66
+ ("O", 0.5, 0.2179, 0.0),
67
+ ("O", 0.2939, 0.2939, 0.0),
68
+ ("O", 0.3429, 0.1098, 0.1098),
69
+ ],
70
+ )
71
+
72
+ v = view(width=900, height=500)
73
+ v.addCrystal(s) # or v.addModel(s) — native JS SymmetryKit expand
74
+ v.setStyle({"sphere": {"scale": 1.0}, "stick": {}})
75
+ v.replicateUnitCell(1, 1, 1)
76
+ v.addUnitCell()
77
+ v.zoomTo()
78
+ v
79
+ ```
80
+
81
+ Expand atoms in Python (same SymmetryKit DB as the viewer):
82
+
83
+ ```python
84
+ frac = s.expand() # fractional after symmetry
85
+ cart = s.atoms() # Cartesian Å
86
+ ```
87
+
88
+ ## Development install
89
+
90
+ From a checkout of the repository, rebuild the JS bundle and install in
91
+ editable mode:
92
+
93
+ ```bash
94
+ cd packages/iraspa-webgpu && npm install && npm run build
95
+ cd ../../python/pyiraspa && pip install -e .
96
+ ```
@@ -0,0 +1,71 @@
1
+ # pyiraspa
2
+
3
+ Jupyter frontend for **iRASPA-WebGPU**, a WebGPU crystallographic viewer
4
+ inspired by [iRASPA](https://github.com/iRASPA/iRASPA-QT), with a
5
+ py3Dmol-style Python API. Reads CIF/mmCIF (with space-group expansion), XYZ,
6
+ POSCAR/CONTCAR, PDB, Gaussian cube and CHGCAR.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ pip install pyiraspa
12
+ ```
13
+
14
+ The JavaScript viewer is bundled in the package; no Node toolchain is needed.
15
+ Requires a browser with **WebGPU** support (Chrome/Edge 113+, Safari 18+).
16
+
17
+ ## Usage
18
+
19
+ ```python
20
+ import pyiraspa
21
+ v = pyiraspa.view(width=640, height=480)
22
+ v.addModel(open("structure.cif").read(), "cif")
23
+ v.setStyle({"sphere": {"scale": 0.25}, "stick": {"radius": 0.12}})
24
+ v.addUnitCell()
25
+ v.zoomTo()
26
+ v
27
+ ```
28
+
29
+ ## Crystal builder (SymmetryKit)
30
+
31
+ Build an asymmetric unit; the viewer expands the space group:
32
+
33
+ ```python
34
+ from pyiraspa import Crystal, view
35
+
36
+ s = Crystal(
37
+ cell=(11.8671, 11.8671, 11.8671),
38
+ spacegroup=221, # or "Pm-3m"
39
+ sites=[
40
+ ("Si", 0.3683, 0.1847, 0.0),
41
+ ("O", 0.5, 0.2179, 0.0),
42
+ ("O", 0.2939, 0.2939, 0.0),
43
+ ("O", 0.3429, 0.1098, 0.1098),
44
+ ],
45
+ )
46
+
47
+ v = view(width=900, height=500)
48
+ v.addCrystal(s) # or v.addModel(s) — native JS SymmetryKit expand
49
+ v.setStyle({"sphere": {"scale": 1.0}, "stick": {}})
50
+ v.replicateUnitCell(1, 1, 1)
51
+ v.addUnitCell()
52
+ v.zoomTo()
53
+ v
54
+ ```
55
+
56
+ Expand atoms in Python (same SymmetryKit DB as the viewer):
57
+
58
+ ```python
59
+ frac = s.expand() # fractional after symmetry
60
+ cart = s.atoms() # Cartesian Å
61
+ ```
62
+
63
+ ## Development install
64
+
65
+ From a checkout of the repository, rebuild the JS bundle and install in
66
+ editable mode:
67
+
68
+ ```bash
69
+ cd packages/iraspa-webgpu && npm install && npm run build
70
+ cd ../../python/pyiraspa && pip install -e .
71
+ ```