ipyvasp 0.8.1__py2.py3-none-any.whl → 0.8.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 CHANGED
@@ -1728,7 +1728,7 @@ def iplot_lattice(
1728
1728
  colors = [_atom_colors[elem] for elem in uelems.keys()]
1729
1729
  colors = ["rgb({},{},{})".format(*[int(_c * 255) for _c in c]) for c in colors]
1730
1730
 
1731
- _colors = np.array([colors[i] for i, vs in enumerate(uelems.values()) for v in vs])
1731
+ _colors = np.array([colors[i] for i, vs in enumerate(uelems.values()) for v in vs],dtype=object) # could be mixed color types
1732
1732
 
1733
1733
  if np.any(pairs):
1734
1734
  coords_p = coords[pairs] # paired points
@@ -1742,25 +1742,37 @@ def iplot_lattice(
1742
1742
  colors_n = [*colors_n, *_c] # same shape.
1743
1743
 
1744
1744
  coords_n = np.array(coords_n)
1745
- colors_n = np.array(colors_n)
1745
+ colors_n = np.array(colors_n, dtype=object)
1746
+
1747
+ # Instead of plotting for each pair, we can make only as little lines as types of atoms to speec up
1748
+ unqc = [] # mixed colors type can't be sorted otherwise
1749
+ for c in colors_n:
1750
+ if c not in unqc:
1751
+ unqc.append(c)
1752
+
1753
+ clabs = [unqc.index(c) for c in colors_n] # few colors categories
1754
+ corder = np.argsort(clabs) # coordinates order for those categories
1755
+
1756
+ groups = {0:[],1:[],2:[]}
1757
+ for co in corder:
1758
+ groups[clabs[co]].append(coords_n[co])
1759
+ groups[clabs[co]].append([[np.nan, np.nan, np.nan]])
1760
+
1761
+ for i in range(3):
1762
+ groups[i] = np.concatenate(groups[i], axis=0)
1746
1763
 
1747
1764
  bond_kws = {"line_width": 4, **bond_kws}
1748
1765
 
1749
- for (i, cp), c in zip(enumerate(coords_n), colors_n):
1766
+ for i, cp in groups.items():
1750
1767
  showlegend = True if i == 0 else False
1751
- fig.add_trace(
1752
- go.Scatter3d(
1753
- x=cp[:, 0].T,
1754
- y=cp[:, 1].T,
1755
- z=cp[:, 2].T,
1756
- mode="lines",
1757
- line_color=c,
1758
- legendgroup="Bonds",
1759
- showlegend=showlegend,
1760
- name="Bonds",
1761
- **bond_kws,
1762
- )
1763
- )
1768
+ fig.add_trace(go.Scatter3d(x=cp[:, 0].T, y=cp[:, 1].T, z=cp[:, 2].T,
1769
+ mode="lines",
1770
+ line_color=unqc[i],
1771
+ legendgroup="Bonds",
1772
+ showlegend=showlegend,
1773
+ name="Bonds",
1774
+ **bond_kws,
1775
+ ))
1764
1776
 
1765
1777
  site_kws = {
1766
1778
  **dict(line_color="rgba(1,1,1,0)", line_width=0.001, opacity=1),
ipyvasp/_version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.8.1"
1
+ __version__ = "0.8.2"
ipyvasp/lattice.py CHANGED
@@ -530,7 +530,7 @@ class POSCAR:
530
530
 
531
531
 
532
532
  def update_weas(self, handle):
533
- """Send result of any options to view on opened weas widget handle with default parameters becuase any operations
533
+ """Send result of any operation to view on opened weas widget handle with default parameters becuase any operations
534
534
  can be incompatible with presious state of POSCAR. VESTA color scheme is used here.
535
535
  Useful in Jupyterlab side panel to look operations results on POSCAR."""
536
536
  handle.from_ase(self.to_ase())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ipyvasp
3
- Version: 0.8.1
3
+ Version: 0.8.2
4
4
  Summary: A processing tool for VASP DFT input/output processing in Jupyter Notebook.
5
5
  Home-page: https://github.com/massgh/ipyvasp
6
6
  Author: Abdul Saboor
@@ -1,12 +1,12 @@
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=w2TMjj_joyx9Hh6w7bDaadRZWAZtDVnhrVv1LBbMl14,103718
5
- ipyvasp/_version.py,sha256=0lm9BoMiB5E8MMchhjjo1ZNAXLprgR2dERt6EhxaImk,23
4
+ ipyvasp/_lattice.py,sha256=c7IXlc9wgkXQhRMUASx6AYelvOUgY_kdC9UgCYWcqrY,104323
5
+ ipyvasp/_version.py,sha256=UcaL9hG0xAfKWNMY82a1It6J8RjG16fehQmQxqtxSuk,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
9
- ipyvasp/lattice.py,sha256=YUe2NRx3TqkWMgQ67-aGyGVWt3y_mbaVtqO9uPFB4iU,28466
9
+ ipyvasp/lattice.py,sha256=t_aIkfVtD9Thi0b3ACEtAYcTuzt0SGCtub7hKV-Q83c,28468
10
10
  ipyvasp/misc.py,sha256=SZJ_ePUR2-HEKYTEpDHVRVE7zpIQVTCjiuw0BCC9UTU,2349
11
11
  ipyvasp/potential.py,sha256=tzA73c5lkp6ahLSJchMrU043-QWaOV0nIOUA7VMmfKQ,11408
12
12
  ipyvasp/surface.py,sha256=MjE5oB0wW6Pca_C-xu8rN6OMH7lUEeNPNyM7Kz_Im-8,23766
@@ -17,9 +17,9 @@ ipyvasp/core/parser.py,sha256=C3CaZsJbPME_ttYlYy4DXeOdL7dnkXs-cHRwFZL6bio,38058
17
17
  ipyvasp/core/plot_toolkit.py,sha256=cktbPZTJ4K0_6-vKYqtQ1xIIPZg-gHJY5793M9XoYQ0,35754
18
18
  ipyvasp/core/serializer.py,sha256=cHGlaDEyhlfsNgy5SDMcZewc2DIy7uyMyCmsrvOAqlM,33539
19
19
  ipyvasp/core/spatial_toolkit.py,sha256=8DBYTiBFWJ7OBKuvOPw7UoEVCyNjJhSW0OcudjYZvAw,14748
20
- ipyvasp-0.8.1.dist-info/LICENSE,sha256=F3SO5RiAZOMfmMGf1KOuk2g_c4ObvuBJhd9iBLDgXoQ,1263
21
- ipyvasp-0.8.1.dist-info/METADATA,sha256=vZ0lf1cYIRWSJ2jVaP74T2rkDUMfw8JtTpA4FRg-_bc,2436
22
- ipyvasp-0.8.1.dist-info/WHEEL,sha256=iYlv5fX357PQyRT2o6tw1bN-YcKFFHKqB_LwHO5wP-g,110
23
- ipyvasp-0.8.1.dist-info/entry_points.txt,sha256=C7m0Sjmr14wFjflCkWXLzr5N6-cQj8uJC9n82mUtzt8,44
24
- ipyvasp-0.8.1.dist-info/top_level.txt,sha256=ftziWlMWu_1VpDP1sRTFrkfBnWxAi393HYDVu4wRhUk,8
25
- ipyvasp-0.8.1.dist-info/RECORD,,
20
+ ipyvasp-0.8.2.dist-info/LICENSE,sha256=F3SO5RiAZOMfmMGf1KOuk2g_c4ObvuBJhd9iBLDgXoQ,1263
21
+ ipyvasp-0.8.2.dist-info/METADATA,sha256=I8LjhKFTv6dbwOC6p0Sq8StMK_yZ4-29CXPFE1B09cE,2436
22
+ ipyvasp-0.8.2.dist-info/WHEEL,sha256=iYlv5fX357PQyRT2o6tw1bN-YcKFFHKqB_LwHO5wP-g,110
23
+ ipyvasp-0.8.2.dist-info/entry_points.txt,sha256=C7m0Sjmr14wFjflCkWXLzr5N6-cQj8uJC9n82mUtzt8,44
24
+ ipyvasp-0.8.2.dist-info/top_level.txt,sha256=ftziWlMWu_1VpDP1sRTFrkfBnWxAi393HYDVu4wRhUk,8
25
+ ipyvasp-0.8.2.dist-info/RECORD,,