ipyvasp 1.1.2__py2.py3-none-any.whl → 1.1.4__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 +1 -1
- ipyvasp/_version.py +1 -1
- ipyvasp/core/serializer.py +55 -13
- {ipyvasp-1.1.2.dist-info → ipyvasp-1.1.4.dist-info}/METADATA +1 -1
- {ipyvasp-1.1.2.dist-info → ipyvasp-1.1.4.dist-info}/RECORD +9 -9
- {ipyvasp-1.1.2.dist-info → ipyvasp-1.1.4.dist-info}/LICENSE +0 -0
- {ipyvasp-1.1.2.dist-info → ipyvasp-1.1.4.dist-info}/WHEEL +0 -0
- {ipyvasp-1.1.2.dist-info → ipyvasp-1.1.4.dist-info}/entry_points.txt +0 -0
- {ipyvasp-1.1.2.dist-info → ipyvasp-1.1.4.dist-info}/top_level.txt +0 -0
ipyvasp/_lattice.py
CHANGED
|
@@ -218,7 +218,7 @@ def periodic_table(selection=None):
|
|
|
218
218
|
names = np.array(names)[fidx]
|
|
219
219
|
|
|
220
220
|
# We are adding patches, because imshow does not properly appear in PDF of latex
|
|
221
|
-
ax = ptk.get_axes((7, 3.9),left=0.01,right=0.99,top=0.99,bottom=0.01)
|
|
221
|
+
ax = ptk.get_axes(1, (7, 3.9),left=0.01,right=0.99,top=0.99,bottom=0.01)
|
|
222
222
|
patches = np.array([Rectangle(offset,0.9 if i in [92,110] else 1,1) for i, offset in zip(fidx,offsets)])
|
|
223
223
|
pc = PatchCollection(patches, facecolors=fc, edgecolors=ec,linewidths=(0.7,))
|
|
224
224
|
ax.add_collection(pc)
|
ipyvasp/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.1.
|
|
1
|
+
__version__ = "1.1.4"
|
ipyvasp/core/serializer.py
CHANGED
|
@@ -766,16 +766,19 @@ class BrZoneData(Dict2Data):
|
|
|
766
766
|
d.update({"faces": faces, "vertices": vertices, "_specials": specials})
|
|
767
767
|
return self.__class__(d)
|
|
768
768
|
|
|
769
|
-
def tile(self, nxyz, filter=None):
|
|
770
|
-
"""Create a tiled array of BZ centers for visualization.
|
|
769
|
+
def tile(self, nxyz, filter=None, primitive=False):
|
|
770
|
+
"""Create a tiled rectangular array of BZ centers for visualization. Use in `center` parameter for BZ plotting.
|
|
771
771
|
|
|
772
772
|
Parameters
|
|
773
773
|
----------
|
|
774
774
|
nxyz : list or tuple of 3 ints
|
|
775
775
|
Number of tiles along each cartesian direction [nx, ny, nz].
|
|
776
776
|
Must be 3 positive integers.
|
|
777
|
+
If primitive = False, result is not guaranteed to be same size as ``nx * ny * nz`` due to shape distortion.
|
|
777
778
|
filter : callable, optional
|
|
778
|
-
Function filter(x,y,z) that takes cartesian coordinates and returns bool.
|
|
779
|
+
Function filter(x,y,z) that takes normalized (to 1) cartesian coordinates and returns bool.
|
|
780
|
+
primitive : bool
|
|
781
|
+
If True, tile points in basis rather than orthogonal geometry. Default is False.
|
|
779
782
|
|
|
780
783
|
Returns
|
|
781
784
|
-------
|
|
@@ -794,17 +797,56 @@ class BrZoneData(Dict2Data):
|
|
|
794
797
|
if not isinstance(n, int) or n < 1:
|
|
795
798
|
raise ValueError(f"nxyz[{i}] must be a positive integer")
|
|
796
799
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
800
|
+
if filter is not None and not callable(filter):
|
|
801
|
+
raise ValueError("filter must be callable")
|
|
802
|
+
|
|
803
|
+
# Tile in shape of cell if primitive
|
|
804
|
+
if primitive:
|
|
805
|
+
pts = np.indices(nxyz).reshape((3,-1)).T
|
|
806
|
+
if filter and len(pts) > 0:
|
|
807
|
+
# Per-dimension normalization for primitive
|
|
808
|
+
norms = np.array([max(1, n - 1) for n in nxyz])
|
|
809
|
+
mask = np.array([filter(*(p/norms)) for p in pts])
|
|
810
|
+
pts = pts[mask]
|
|
811
|
+
return pts
|
|
812
|
+
|
|
813
|
+
# Orthogonal/Cartesian-aligned case
|
|
814
|
+
target_span = np.linalg.norm(self.basis.sum(axis=0)) * (np.array(nxyz) - 1)
|
|
815
|
+
|
|
816
|
+
# 2. Map Cartesian box corners to Lattice Space
|
|
817
|
+
corners_cart = np.array([[i, j, k] for i in [0, 1] for j in [0, 1] for k in [0, 1]]) * target_span
|
|
818
|
+
corners_frac = self.to_fractional(corners_cart)
|
|
819
|
+
|
|
820
|
+
# 3. Find integer bounds (Must use +1 for inclusive arange)
|
|
821
|
+
n_min = np.floor(corners_frac.min(axis=0)).astype(int)
|
|
822
|
+
n_max = np.ceil(corners_frac.max(axis=0)).astype(int)
|
|
805
823
|
|
|
806
|
-
|
|
807
|
-
|
|
824
|
+
ranges = [np.arange(n_min[i], n_max[i] + 1) for i in range(3)]
|
|
825
|
+
grid_n = np.array(np.meshgrid(*ranges, indexing='ij')).T.reshape(-1, 3)
|
|
826
|
+
|
|
827
|
+
all_pts = self.to_cartesian(grid_n)
|
|
828
|
+
|
|
829
|
+
# 4. Clipping with a slightly more generous epsilon to prevent missing bridge points
|
|
830
|
+
eps = 1e-9
|
|
831
|
+
mask = (all_pts >= -eps).all(axis=1) & (all_pts <= target_span + eps).all(axis=1)
|
|
832
|
+
pts = all_pts[mask]
|
|
833
|
+
|
|
834
|
+
N = np.cumprod(nxyz)[-1]
|
|
835
|
+
if len(pts) > N: # box becomes too much inclusive at larger points, restrict that
|
|
836
|
+
dist = np.linalg.norm(pts - pts.mean(axis=0), axis=1)
|
|
837
|
+
pts = pts[np.argsort(dist)[:N]]
|
|
838
|
+
|
|
839
|
+
# 5. Apply Global Normalized filter (preserves geometry)
|
|
840
|
+
if filter and len(pts) > 0:
|
|
841
|
+
p_min, p_max = pts.min(axis=0), pts.max(axis=0)
|
|
842
|
+
global_range = np.max(p_max - p_min) or 1.0
|
|
843
|
+
norm_pts = (pts - p_min) / global_range
|
|
844
|
+
|
|
845
|
+
f_mask = np.array([filter(*p) for p in norm_pts])
|
|
846
|
+
pts = pts[f_mask]
|
|
847
|
+
|
|
848
|
+
pts = pts[np.lexsort((pts[:, 0], pts[:, 1], pts[:, 2]))] # reorder for easy reading of points
|
|
849
|
+
return self.to_fractional(pts).round(12) # no need to ceil or int here, that makes empty areas, just remove values like E-17
|
|
808
850
|
|
|
809
851
|
|
|
810
852
|
class CellData(Dict2Data):
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
ipyvasp/__init__.py,sha256=pzTqeKuf6sN2GQmaexmMgG677ggT3sxIFyQDXq_2whU,1422
|
|
2
2
|
ipyvasp/__main__.py,sha256=eJV1TZSiT8mC_VqAeksNnBI2I8mKMiPkEIlwikbtOjI,216
|
|
3
3
|
ipyvasp/_enplots.py,sha256=gJ7S9WBmrxvDEbmoccDRaJG01kpx9oNlRf7mozigbgY,37872
|
|
4
|
-
ipyvasp/_lattice.py,sha256=
|
|
5
|
-
ipyvasp/_version.py,sha256=
|
|
4
|
+
ipyvasp/_lattice.py,sha256=LW20S2p_jx4bth5JedFnsvAvw6iWT1wLMmoi0Acsz2Y,108120
|
|
5
|
+
ipyvasp/_version.py,sha256=PZhUTNgGE_in6n-SwcZzX-gYtmYPohHIX-3AQqOiJEY,23
|
|
6
6
|
ipyvasp/bsdos.py,sha256=hVHpxkdT2ImRsxwFvMSMHxRSo4LqDM90DnUhwTP8vcs,32192
|
|
7
7
|
ipyvasp/cli.py,sha256=-Lf-qdTvs7WyrA4ALNLaoqxMjLsZkXdPviyQps3ezqg,6880
|
|
8
8
|
ipyvasp/evals_dataframe.py,sha256=n2iSH4D4ZbrxlAV4yDTVHbcl3ycfD0zfQYmTBcxjfkE,20789
|
|
@@ -15,11 +15,11 @@ ipyvasp/widgets.py,sha256=Bpa4Y3Eopk_ZPFsVetfysClZP2q_2ONvmOwUol9vVGI,53154
|
|
|
15
15
|
ipyvasp/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
ipyvasp/core/parser.py,sha256=o-uHyL_w9W0pmxoSt3JmLwwmmT3WRHlHSs_NoiHO-hs,39401
|
|
17
17
|
ipyvasp/core/plot_toolkit.py,sha256=ru8-FLJp8-X2p_Ft0F3K68qNSUJhy3jQD_S2zW50FWg,40930
|
|
18
|
-
ipyvasp/core/serializer.py,sha256=
|
|
18
|
+
ipyvasp/core/serializer.py,sha256=JhtvuWjqBVSWzsDodUzsO_avTxC5yBH8NkFTM95-FEk,42385
|
|
19
19
|
ipyvasp/core/spatial_toolkit.py,sha256=dXowREhiFzBvvr5f_bApzFhf8IzjH2E2Ix90oCBUetY,14885
|
|
20
|
-
ipyvasp-1.1.
|
|
21
|
-
ipyvasp-1.1.
|
|
22
|
-
ipyvasp-1.1.
|
|
23
|
-
ipyvasp-1.1.
|
|
24
|
-
ipyvasp-1.1.
|
|
25
|
-
ipyvasp-1.1.
|
|
20
|
+
ipyvasp-1.1.4.dist-info/LICENSE,sha256=F3SO5RiAZOMfmMGf1KOuk2g_c4ObvuBJhd9iBLDgXoQ,1263
|
|
21
|
+
ipyvasp-1.1.4.dist-info/METADATA,sha256=pUPSVUeAInyhEuZ_XGLmVUc2ndKaW8SUtqGdvgU1Yus,3218
|
|
22
|
+
ipyvasp-1.1.4.dist-info/WHEEL,sha256=Kh9pAotZVRFj97E15yTA4iADqXdQfIVTHcNaZTjxeGM,110
|
|
23
|
+
ipyvasp-1.1.4.dist-info/entry_points.txt,sha256=aU-gGjQG2Q8XfxDlNc_8__cwfp8WG2K5ZgFPInTm2jg,45
|
|
24
|
+
ipyvasp-1.1.4.dist-info/top_level.txt,sha256=ftziWlMWu_1VpDP1sRTFrkfBnWxAi393HYDVu4wRhUk,8
|
|
25
|
+
ipyvasp-1.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|