ipyvasp 0.9.1__py2.py3-none-any.whl → 0.9.2__py2.py3-none-any.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.
- ipyvasp/_lattice.py +10 -2
- ipyvasp/_version.py +1 -1
- ipyvasp/core/serializer.py +3 -3
- {ipyvasp-0.9.1.dist-info → ipyvasp-0.9.2.dist-info}/METADATA +1 -1
- {ipyvasp-0.9.1.dist-info → ipyvasp-0.9.2.dist-info}/RECORD +9 -9
- {ipyvasp-0.9.1.dist-info → ipyvasp-0.9.2.dist-info}/LICENSE +0 -0
- {ipyvasp-0.9.1.dist-info → ipyvasp-0.9.2.dist-info}/WHEEL +0 -0
- {ipyvasp-0.9.1.dist-info → ipyvasp-0.9.2.dist-info}/entry_points.txt +0 -0
- {ipyvasp-0.9.1.dist-info → ipyvasp-0.9.2.dist-info}/top_level.txt +0 -0
ipyvasp/_lattice.py
CHANGED
|
@@ -1640,6 +1640,7 @@ def iplot_lattice(
|
|
|
1640
1640
|
bond_kws=dict(line_width=4),
|
|
1641
1641
|
site_kws=dict(line_color="rgba(1,1,1,0)", line_width=0.001, opacity=1),
|
|
1642
1642
|
plot_cell=True,
|
|
1643
|
+
label_sites = False,
|
|
1643
1644
|
**kwargs,
|
|
1644
1645
|
):
|
|
1645
1646
|
"""Plotly's interactive plot of lattice.
|
|
@@ -1728,6 +1729,7 @@ def iplot_lattice(
|
|
|
1728
1729
|
line_color=unqc[i],
|
|
1729
1730
|
legendgroup="Bonds",
|
|
1730
1731
|
showlegend=showlegend,
|
|
1732
|
+
hoverinfo='skip',
|
|
1731
1733
|
name="Bonds",
|
|
1732
1734
|
**bond_kws,
|
|
1733
1735
|
))
|
|
@@ -1736,18 +1738,24 @@ def iplot_lattice(
|
|
|
1736
1738
|
**dict(line_color="rgba(1,1,1,0)", line_width=0.001, opacity=1),
|
|
1737
1739
|
**site_kws,
|
|
1738
1740
|
}
|
|
1741
|
+
|
|
1742
|
+
eqv_idxs = getattr(poscar_data.metadata, 'eqv_indices',np.array(range(poscar_data.positions.shape[0])))
|
|
1743
|
+
|
|
1739
1744
|
for (k, v), c, s in zip(uelems.items(), colors, sizes):
|
|
1740
1745
|
coords = poscar_data.coords[v]
|
|
1741
1746
|
labs = poscar_data.labels[v]
|
|
1747
|
+
idxs = eqv_idxs[v]
|
|
1748
|
+
hovertext = [f"<br>{x:7.3f} {y:7.3f} {z:7.3f}<br>Index: {idx} Label: {lab}" for lab,idx, (x,y,z) in zip(labs,idxs, poscar_data.positions[idxs])]
|
|
1742
1749
|
|
|
1743
1750
|
fig.add_trace(
|
|
1744
1751
|
go.Scatter3d(
|
|
1745
1752
|
x=coords[:, 0].T,
|
|
1746
1753
|
y=coords[:, 1].T,
|
|
1747
1754
|
z=coords[:, 2].T,
|
|
1748
|
-
mode="markers",
|
|
1755
|
+
mode="markers+text" if label_sites else "markers",
|
|
1749
1756
|
marker_color=c,
|
|
1750
|
-
hovertext=
|
|
1757
|
+
hovertext=hovertext,
|
|
1758
|
+
text=["{}<sub>{}</sub>".format(*l.split()) for l in labs] if label_sites else None,
|
|
1751
1759
|
marker_size=s,
|
|
1752
1760
|
name=k,
|
|
1753
1761
|
**site_kws,
|
ipyvasp/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.9.
|
|
1
|
+
__version__ = "0.9.2"
|
ipyvasp/core/serializer.py
CHANGED
|
@@ -338,7 +338,7 @@ class PoscarData(Dict2Data):
|
|
|
338
338
|
raise TypeError("type_or_indices should be a species type like 'Ga' or list-like of indices to pick positions.")
|
|
339
339
|
return points[type_or_indices]
|
|
340
340
|
|
|
341
|
-
def get_neighbors(self, k=5):
|
|
341
|
+
def get_neighbors(self, k=5, as_symbols=False):
|
|
342
342
|
"""Get the k nearest neighbors of each atom (including itself) in the lattice.
|
|
343
343
|
Returns array (N, k) of indices of atoms. The first index is the atom itself.
|
|
344
344
|
|
|
@@ -362,7 +362,7 @@ class PoscarData(Dict2Data):
|
|
|
362
362
|
tree = KDTree(cs)
|
|
363
363
|
_, inn = tree.query(cs, k=k)
|
|
364
364
|
output = (inn % N)[:N] # to get the index of the atom in the original list
|
|
365
|
-
return output
|
|
365
|
+
return self.symbols[output] if as_symbols else output
|
|
366
366
|
|
|
367
367
|
get_knn = get_neighbors # important alias
|
|
368
368
|
|
|
@@ -445,7 +445,7 @@ class PoscarData(Dict2Data):
|
|
|
445
445
|
for j in js:
|
|
446
446
|
bs = np.array([self.to_cartesian(self.positions[j] + p) for p in product([-1,0,1],[-1,0,1],[-1,0,1])])
|
|
447
447
|
ds = np.array([np.linalg.norm(a-b) for b in bs])
|
|
448
|
-
b = bs[ds.argsort()][0]
|
|
448
|
+
b = bs[ds.argsort()][0] # closest
|
|
449
449
|
t = tuple((self.to_fractional(b) - self.positions[j]).astype(int)) # keep track of translation vector
|
|
450
450
|
nears.append((j, b, t))
|
|
451
451
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
ipyvasp/__init__.py,sha256=7o41i5eYlNKg1Hsv0DLNFZ81GilxB02IXAJN-QiJQi0,1420
|
|
2
2
|
ipyvasp/__main__.py,sha256=eJV1TZSiT8mC_VqAeksNnBI2I8mKMiPkEIlwikbtOjI,216
|
|
3
3
|
ipyvasp/_enplots.py,sha256=D38paN8zqZgluNAwmCwcocd7-_h_T0HTGolI1eBkDes,37484
|
|
4
|
-
ipyvasp/_lattice.py,sha256=
|
|
5
|
-
ipyvasp/_version.py,sha256=
|
|
4
|
+
ipyvasp/_lattice.py,sha256=DN3VZVjQ5fbzUrbpft75ieaP5ddyr6mIuZRHOwrFrK8,103052
|
|
5
|
+
ipyvasp/_version.py,sha256=I3ASgj0LYAmGGQhqxkAYEEiiLOpQ1UAZGOd0bJAXSRw,23
|
|
6
6
|
ipyvasp/bsdos.py,sha256=ZtQji-W11UdFFicAoWZjlqVhI5tqYu_jpKyPPWKkeeo,30634
|
|
7
7
|
ipyvasp/cli.py,sha256=aWFEVhNmnW8eSOp5uh95JaDwLQ9K9nlCQcbnOSuhWgw,6844
|
|
8
8
|
ipyvasp/evals_dataframe.py,sha256=-sqxK7LPV6sYDO_XXmZ80FznOaXTkVdbqJKKvTUtMak,20637
|
|
@@ -15,11 +15,11 @@ ipyvasp/widgets.py,sha256=fZ2b7EYYxuaAVfklnLa0VJ00U9Uyd7SqXrzt0hbLOvI,45400
|
|
|
15
15
|
ipyvasp/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
ipyvasp/core/parser.py,sha256=C3CaZsJbPME_ttYlYy4DXeOdL7dnkXs-cHRwFZL6bio,38058
|
|
17
17
|
ipyvasp/core/plot_toolkit.py,sha256=8t5svyWbOm-PS7ZvIptnK6F46kp6uwoGNdohPv5dQKA,35962
|
|
18
|
-
ipyvasp/core/serializer.py,sha256=
|
|
18
|
+
ipyvasp/core/serializer.py,sha256=XpqnfVGsUXiN2CuVRPyqsSVouxRBO-UH6AnsHnPYvZY,36729
|
|
19
19
|
ipyvasp/core/spatial_toolkit.py,sha256=8DBYTiBFWJ7OBKuvOPw7UoEVCyNjJhSW0OcudjYZvAw,14748
|
|
20
|
-
ipyvasp-0.9.
|
|
21
|
-
ipyvasp-0.9.
|
|
22
|
-
ipyvasp-0.9.
|
|
23
|
-
ipyvasp-0.9.
|
|
24
|
-
ipyvasp-0.9.
|
|
25
|
-
ipyvasp-0.9.
|
|
20
|
+
ipyvasp-0.9.2.dist-info/LICENSE,sha256=F3SO5RiAZOMfmMGf1KOuk2g_c4ObvuBJhd9iBLDgXoQ,1263
|
|
21
|
+
ipyvasp-0.9.2.dist-info/METADATA,sha256=rbDpOJNtuinZ9AJi0pBcBTAYHLuoC_IbBvQagjXSHG4,2420
|
|
22
|
+
ipyvasp-0.9.2.dist-info/WHEEL,sha256=iYlv5fX357PQyRT2o6tw1bN-YcKFFHKqB_LwHO5wP-g,110
|
|
23
|
+
ipyvasp-0.9.2.dist-info/entry_points.txt,sha256=C7m0Sjmr14wFjflCkWXLzr5N6-cQj8uJC9n82mUtzt8,44
|
|
24
|
+
ipyvasp-0.9.2.dist-info/top_level.txt,sha256=ftziWlMWu_1VpDP1sRTFrkfBnWxAi393HYDVu4wRhUk,8
|
|
25
|
+
ipyvasp-0.9.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|