surface-construct 0.12.8__tar.gz → 0.13.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.
Files changed (39) hide show
  1. {surface_construct-0.12.8/surface_construct.egg-info → surface_construct-0.13.0}/PKG-INFO +6 -2
  2. {surface_construct-0.12.8 → surface_construct-0.13.0}/README.md +3 -0
  3. {surface_construct-0.12.8 → surface_construct-0.13.0}/setup.py +4 -3
  4. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/structures/surface.py +5 -5
  5. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/tasks/sitesampling.py +16 -7
  6. {surface_construct-0.12.8 → surface_construct-0.13.0/surface_construct.egg-info}/PKG-INFO +6 -2
  7. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct.egg-info/requires.txt +2 -1
  8. {surface_construct-0.12.8 → surface_construct-0.13.0}/tests/test_simple_surface.py +1 -1
  9. {surface_construct-0.12.8 → surface_construct-0.13.0}/LICENSE +0 -0
  10. {surface_construct-0.12.8 → surface_construct-0.13.0}/setup.cfg +0 -0
  11. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/__init__.py +0 -0
  12. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/db.py +0 -0
  13. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/default_parameter.py +0 -0
  14. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/sg_sampler.py +0 -0
  15. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/structures/__init__.py +0 -0
  16. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/structures/adsorbate.py +0 -0
  17. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/structures/combiner.py +0 -0
  18. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/structures/pymsym_test.py +0 -0
  19. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/structures/surface_grid.py +0 -0
  20. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/tasks/__init__.py +0 -0
  21. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/tasks/afm.py +0 -0
  22. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/tasks/taskbase.py +0 -0
  23. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/tasks/terminations.py +0 -0
  24. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/tasks/vipsitetask.py +0 -0
  25. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/utils/__init__.py +0 -0
  26. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/utils/atoms.py +0 -0
  27. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/utils/geometry.py +0 -0
  28. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/utils/pymsym_wrapper.py +0 -0
  29. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/utils/spglib_wrapper.py +0 -0
  30. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct/utils/weight_functions.py +0 -0
  31. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct.egg-info/SOURCES.txt +0 -0
  32. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct.egg-info/dependency_links.txt +0 -0
  33. {surface_construct-0.12.8 → surface_construct-0.13.0}/surface_construct.egg-info/top_level.txt +0 -0
  34. {surface_construct-0.12.8 → surface_construct-0.13.0}/tests/test_adsorbate.py +0 -0
  35. {surface_construct-0.12.8 → surface_construct-0.13.0}/tests/test_combiner.py +0 -0
  36. {surface_construct-0.12.8 → surface_construct-0.13.0}/tests/test_sampling1.py +0 -0
  37. {surface_construct-0.12.8 → surface_construct-0.13.0}/tests/test_sampling2.py +0 -0
  38. {surface_construct-0.12.8 → surface_construct-0.13.0}/tests/test_surface_grid.py +0 -0
  39. {surface_construct-0.12.8 → surface_construct-0.13.0}/tests/test_task.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: surface_construct
3
- Version: 0.12.8
3
+ Version: 0.13.0
4
4
  Summary: Surface construction and surface reaction sampling tools.
5
5
  Home-page: https://gitee.com/pjren/surface_construct/
6
6
  Author: ren
@@ -14,9 +14,10 @@ Requires-Dist: ase
14
14
  Requires-Dist: networkx
15
15
  Requires-Dist: spglib
16
16
  Requires-Dist: pandas
17
- Requires-Dist: tqdm
17
+ Requires-Dist: pymsym
18
18
  Requires-Dist: scikit-learn
19
19
  Requires-Dist: scikit-image
20
+ Requires-Dist: setuptools
20
21
  Dynamic: author
21
22
  Dynamic: author-email
22
23
  Dynamic: classifier
@@ -157,6 +158,9 @@ $$
157
158
 
158
159
  **TODO**
159
160
 
161
+ * 在 sg 中增加 mask points, 在采样和fit 中不考虑,在画图时候额外赋值
162
+ * 使用 FAISS 加速向量计算,距离,聚类等
163
+ * sitesampling 增加 include 和exclude ,可以根据位点-类型和位点-原子序号进行排除格点
160
164
  * 计算位点 SALI (Structure-Activity Landscape Index),量化 activity cliffs,SALI = |ΔActivity| / (1 − Similarity)
161
165
  * 新增 PathSampler,用于在相邻的关键格点之间的扩散路径进行采样,使用 ase.neb.idpp 方法进行采样,使用 Delaunay 剖分找到相邻位点的路径。
162
166
  * Low-Energy Region Explorer 方法借鉴[^LoreX]: 划分能量区域, 进行 Delaunay 划分,合并较小的区域为较大的区域。然后针对低能的区域进行额外采样。也可以适用不同的方法,低精度进行低能高能区域识别,然后高精度方法加强。
@@ -127,6 +127,9 @@ $$
127
127
 
128
128
  **TODO**
129
129
 
130
+ * 在 sg 中增加 mask points, 在采样和fit 中不考虑,在画图时候额外赋值
131
+ * 使用 FAISS 加速向量计算,距离,聚类等
132
+ * sitesampling 增加 include 和exclude ,可以根据位点-类型和位点-原子序号进行排除格点
130
133
  * 计算位点 SALI (Structure-Activity Landscape Index),量化 activity cliffs,SALI = |ΔActivity| / (1 − Similarity)
131
134
  * 新增 PathSampler,用于在相邻的关键格点之间的扩散路径进行采样,使用 ase.neb.idpp 方法进行采样,使用 Delaunay 剖分找到相邻位点的路径。
132
135
  * Low-Energy Region Explorer 方法借鉴[^LoreX]: 划分能量区域, 进行 Delaunay 划分,合并较小的区域为较大的区域。然后针对低能的区域进行额外采样。也可以适用不同的方法,低精度进行低能高能区域识别,然后高精度方法加强。
@@ -8,14 +8,15 @@ install_requires = [
8
8
  'networkx',
9
9
  'spglib',
10
10
  'pandas',
11
- 'tqdm',
11
+ 'pymsym',
12
12
  'scikit-learn',
13
- 'scikit-image'
13
+ 'scikit-image',
14
+ 'setuptools',
14
15
  ]
15
16
 
16
17
  setup(
17
18
  name='surface_construct',
18
- version='0.12.8',
19
+ version='0.13.0',
19
20
  packages=find_packages(),
20
21
  url='https://gitee.com/pjren/surface_construct/',
21
22
  license='GPL',
@@ -5,7 +5,7 @@ import ase.build.surface
5
5
  import numpy as np
6
6
  import pandas as pd
7
7
  import spglib
8
- from tqdm import tqdm
8
+
9
9
 
10
10
  from surface_construct.utils.atoms import topo_identity,dist_identity, get_atoms_topo_id, bondvalence, \
11
11
  refined_atoms, atoms2spg, coprime_factor, adj_matrix, topodist_matrix, atoms2graph, coordnum_adj
@@ -413,7 +413,7 @@ class Slab(object):
413
413
 
414
414
  if unique:
415
415
  terminations_dict = {termination.get_identity(id_type=id_type): termination
416
- for termination in tqdm(terminations)}
416
+ for termination in terminations}
417
417
  print("Unique terminations count, ", len(terminations_dict))
418
418
  return terminations_dict
419
419
  # terminations = list(terminations_dict.values())
@@ -730,7 +730,7 @@ def get_terminations_score(terminations, cus=True):
730
730
  if cus:
731
731
  cuses = []
732
732
  termination_ids = []
733
- for i, t in tqdm(enumerate(terminations)):
733
+ for i, t in enumerate(terminations):
734
734
  cus = t.get_cus_cn()
735
735
  # idata = pd.DataFrame(cus, index=[len(data) + idx for idx in range(len(cus))])
736
736
  termination_ids += [i] * len(cus)
@@ -742,7 +742,7 @@ def get_terminations_score(terminations, cus=True):
742
742
  data_sum_by_termination = data_by_termination.sum()
743
743
  else:
744
744
  data_sum_by_termination = pd.DataFrame()
745
- dsuc_list = [round(t.dsuc(), 2) for t in tqdm(terminations)]
745
+ dsuc_list = [round(t.dsuc(), 2) for t in terminations]
746
746
  data_sum_by_termination['DSUC'] = dsuc_list
747
747
  return data_sum_by_termination
748
748
 
@@ -751,7 +751,7 @@ def all_surface_parameters(crystal, cellmax=20, max_hkl=(3, 3, 3)):
751
751
  """
752
752
  Extract all the surface parameters for given crystal. 数据用于 seaborn 作图
753
753
  :param crystal: Crytal object
754
- :param cellmax: the maximum of cell length when multiple the unit cell
754
+ :param cellmax: the maximum of cell length when multiply the unit cell
755
755
  :param max_hkl: tuple or int, (hmax,kmax,lmax)
756
756
  :return:
757
757
  """
@@ -19,7 +19,8 @@ from scan_ts import FixAtomsComXY
19
19
 
20
20
  from .taskbase import TaskBase
21
21
  from ..sg_sampler import name2sampler
22
-
22
+ from ..structures.combiner import AdsGridCombiner
23
+ from ase.optimize.optimize import Optimizer
23
24
 
24
25
  class SurfaceSiteSampleTask(TaskBase):
25
26
  """
@@ -30,7 +31,10 @@ class SurfaceSiteSampleTask(TaskBase):
30
31
 
31
32
  """
32
33
  pkl_content = ['combiner']
33
- def __init__(self, combiner=None, optimizer=None, sampler=None, **kwargs):
34
+ def __init__(self, combiner:AdsGridCombiner=None,
35
+ optimizer:Optimizer=None,
36
+ sampler:dict=None,
37
+ **kwargs):
34
38
  """
35
39
 
36
40
  :param combiner:
@@ -71,7 +75,15 @@ class SurfaceSiteSampleTask(TaskBase):
71
75
  msg.append(f"Optimizer: None")
72
76
  else:
73
77
  msg.append(f"Optimizer: {self.optimizer.__name__}")
74
- # TODO: calculator 信息
78
+ opt_kwargs = self.kwargs.get('opt_kwargs', None)
79
+ if opt_kwargs is None:
80
+ msg.append(" opt_kwargs : None")
81
+ else:
82
+ msg += [f' {k} : {v}' for k, v in opt_kwargs.items()]
83
+ # calculator 信息
84
+ msg.append(f"Calculator: {self.combiner.calc.__class__.__name__}")
85
+ msg += [f' {k} : {v}' for k,v in self.combiner.calc.todict()]
86
+
75
87
  msg.append(f"Sampling Method: ")
76
88
  for i, s in enumerate(self.sampler):
77
89
  msg.append(f" The {i+1}-th sampler:")
@@ -79,8 +91,7 @@ class SurfaceSiteSampleTask(TaskBase):
79
91
  msg.append(f" Surface Sampler: {s.get('surface')}")
80
92
  msg.append(f" Surface Sampler weight: {s.get('weight',1.0)}")
81
93
  msg.append("Other kwargs:")
82
- for k,v in self.kwargs.items():
83
- msg.append(f' {k} : {v}')
94
+ msg += [f' {k} : {v}' for k,v in self.kwargs.items()]
84
95
 
85
96
  msg.append("\nResult:")
86
97
  msg.append(" time sample_idx x y z E0/eV converged")
@@ -179,8 +190,6 @@ class SurfaceSiteSampleTask(TaskBase):
179
190
  for isampler in self.sampler:
180
191
  size = isampler.get("size", 1)
181
192
  sg_sampler = isampler.get("surface")
182
- if type(sg_sampler) in (tuple, list) and len(sg_sampler) == 1:
183
- sg_sampler = sg_sampler[0]
184
193
  if type(sg_sampler) == str:
185
194
  sg_sampler_obj = name2sampler(sg_sampler)
186
195
  if sg_sampler in ('InitialSGSampler', 'KeyPointSGSampler'): # 一次性采N样,其余都是一次一个点
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: surface_construct
3
- Version: 0.12.8
3
+ Version: 0.13.0
4
4
  Summary: Surface construction and surface reaction sampling tools.
5
5
  Home-page: https://gitee.com/pjren/surface_construct/
6
6
  Author: ren
@@ -14,9 +14,10 @@ Requires-Dist: ase
14
14
  Requires-Dist: networkx
15
15
  Requires-Dist: spglib
16
16
  Requires-Dist: pandas
17
- Requires-Dist: tqdm
17
+ Requires-Dist: pymsym
18
18
  Requires-Dist: scikit-learn
19
19
  Requires-Dist: scikit-image
20
+ Requires-Dist: setuptools
20
21
  Dynamic: author
21
22
  Dynamic: author-email
22
23
  Dynamic: classifier
@@ -157,6 +158,9 @@ $$
157
158
 
158
159
  **TODO**
159
160
 
161
+ * 在 sg 中增加 mask points, 在采样和fit 中不考虑,在画图时候额外赋值
162
+ * 使用 FAISS 加速向量计算,距离,聚类等
163
+ * sitesampling 增加 include 和exclude ,可以根据位点-类型和位点-原子序号进行排除格点
160
164
  * 计算位点 SALI (Structure-Activity Landscape Index),量化 activity cliffs,SALI = |ΔActivity| / (1 − Similarity)
161
165
  * 新增 PathSampler,用于在相邻的关键格点之间的扩散路径进行采样,使用 ase.neb.idpp 方法进行采样,使用 Delaunay 剖分找到相邻位点的路径。
162
166
  * Low-Energy Region Explorer 方法借鉴[^LoreX]: 划分能量区域, 进行 Delaunay 划分,合并较小的区域为较大的区域。然后针对低能的区域进行额外采样。也可以适用不同的方法,低精度进行低能高能区域识别,然后高精度方法加强。
@@ -2,6 +2,7 @@ ase
2
2
  networkx
3
3
  spglib
4
4
  pandas
5
- tqdm
5
+ pymsym
6
6
  scikit-learn
7
7
  scikit-image
8
+ setuptools
@@ -11,7 +11,7 @@ class TestSimpleSurface:
11
11
  slab1 = Slab(s)
12
12
  superslab1 = slab1.supercell((3,3))
13
13
  terms = superslab1.get_all_terminations(unique=True)
14
- atoms_list = [t.atoms for t in terms.values]
14
+ atoms_list = [t.atoms for t in terms.values()]
15
15
 
16
16
  slab2 = Slab(s, from_last=True)
17
17
  superslab2 = slab2.supercell((3,3))