surface-construct 0.12.2__tar.gz → 0.12.4__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 (38) hide show
  1. {surface_construct-0.12.2/surface_construct.egg-info → surface_construct-0.12.4}/PKG-INFO +1 -1
  2. {surface_construct-0.12.2 → surface_construct-0.12.4}/setup.py +1 -1
  3. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/structures/adsorbate.py +5 -4
  4. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/structures/surface_grid.py +1 -1
  5. {surface_construct-0.12.2 → surface_construct-0.12.4/surface_construct.egg-info}/PKG-INFO +1 -1
  6. {surface_construct-0.12.2 → surface_construct-0.12.4}/tests/test_surface_grid.py +2 -1
  7. {surface_construct-0.12.2 → surface_construct-0.12.4}/tests/test_task.py +27 -0
  8. {surface_construct-0.12.2 → surface_construct-0.12.4}/LICENSE +0 -0
  9. {surface_construct-0.12.2 → surface_construct-0.12.4}/README.md +0 -0
  10. {surface_construct-0.12.2 → surface_construct-0.12.4}/setup.cfg +0 -0
  11. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/__init__.py +0 -0
  12. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/db.py +0 -0
  13. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/default_parameter.py +0 -0
  14. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/sg_sampler.py +0 -0
  15. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/structures/__init__.py +0 -0
  16. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/structures/combiner.py +0 -0
  17. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/structures/pymsym_test.py +0 -0
  18. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/structures/surface.py +0 -0
  19. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/tasks/__init__.py +0 -0
  20. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/tasks/afm.py +0 -0
  21. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/tasks/sitesampling.py +0 -0
  22. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/tasks/taskbase.py +0 -0
  23. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/tasks/terminations.py +0 -0
  24. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/utils/__init__.py +0 -0
  25. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/utils/atoms.py +0 -0
  26. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/utils/geometry.py +0 -0
  27. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/utils/pymsym_wrapper.py +0 -0
  28. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/utils/spglib_wrapper.py +0 -0
  29. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct/utils/weight_functions.py +0 -0
  30. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct.egg-info/SOURCES.txt +0 -0
  31. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct.egg-info/dependency_links.txt +0 -0
  32. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct.egg-info/requires.txt +0 -0
  33. {surface_construct-0.12.2 → surface_construct-0.12.4}/surface_construct.egg-info/top_level.txt +0 -0
  34. {surface_construct-0.12.2 → surface_construct-0.12.4}/tests/test_adsorbate.py +0 -0
  35. {surface_construct-0.12.2 → surface_construct-0.12.4}/tests/test_combiner.py +0 -0
  36. {surface_construct-0.12.2 → surface_construct-0.12.4}/tests/test_sampling1.py +0 -0
  37. {surface_construct-0.12.2 → surface_construct-0.12.4}/tests/test_sampling2.py +0 -0
  38. {surface_construct-0.12.2 → surface_construct-0.12.4}/tests/test_simple_surface.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: surface_construct
3
- Version: 0.12.2
3
+ Version: 0.12.4
4
4
  Summary: Surface construction and surface reaction sampling tools.
5
5
  Home-page: https://gitee.com/pjren/surface_construct/
6
6
  Author: ren
@@ -15,7 +15,7 @@ install_requires = [
15
15
 
16
16
  setup(
17
17
  name='surface_construct',
18
- version='0.12.2',
18
+ version='0.12.4',
19
19
  packages=find_packages(),
20
20
  url='https://gitee.com/pjren/surface_construct/',
21
21
  license='GPL',
@@ -139,9 +139,10 @@ class Adsorbate:
139
139
  for ids in self.dock_point_indices for i in ids])
140
140
  return self._rads
141
141
 
142
+ atoms = self.atoms.copy()
142
143
  if not self.is_regulated:
143
- self.regulate()
144
- positions = self.atoms.positions
144
+ atoms_regulate(atoms)
145
+ positions = atoms.positions
145
146
  dim_length = np.array([
146
147
  max(positions[:,0]) - min(positions[:,0]),
147
148
  max(positions[:,1]) - min(positions[:,1]),
@@ -150,8 +151,8 @@ class Adsorbate:
150
151
  shortest_dim = np.argmin(dim_length)
151
152
  idx0 =np.argmin(positions[:,shortest_dim])
152
153
  idx1 =np.argmax(positions[:,shortest_dim])
153
- num0 = self.atoms.numbers[idx0]
154
- num1 = self.atoms.numbers[idx1]
154
+ num0 = atoms.numbers[idx0]
155
+ num1 = atoms.numbers[idx1]
155
156
  self._rads = (dim_length[shortest_dim] + radii[num0] + radii[num1]) / 2
156
157
  return self._rads
157
158
 
@@ -1158,7 +1158,7 @@ def combine_sg_vector(*sg_lst):
1158
1158
  idx_down = idx_up + sg.vlen
1159
1159
  old_idx_up, old_idx_down = old_idx*sg.vlen, (old_idx+1)*sg.vlen
1160
1160
  vector[:, idx_up:idx_down] = sg._raw_vector[:, old_idx_up:old_idx_down]
1161
- vectors_lst.append(vector)
1161
+ vectors_lst.append(vector)
1162
1162
 
1163
1163
  vector_combine = np.concatenate(vectors_lst, axis=0)
1164
1164
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: surface_construct
3
- Version: 0.12.2
3
+ Version: 0.12.4
4
4
  Summary: Surface construction and surface reaction sampling tools.
5
5
  Home-page: https://gitee.com/pjren/surface_construct/
6
6
  Author: ren
@@ -144,4 +144,5 @@ class TestSurfaceGrid:
144
144
  assert sg_obj2.vector.shape[1] == 30
145
145
 
146
146
  comb_vector = combine_sg_vector(sg_obj1, sg_obj2)
147
- assert comb_vector.shape[1] == 75
147
+ assert comb_vector.shape[1] == 75
148
+ assert comb_vector.shape[0] == sg_obj1.vector.shape[0] + sg_obj2.vector.shape[0]
@@ -85,6 +85,33 @@ class TestTask:
85
85
  task_obj.run()
86
86
  print('Done')
87
87
 
88
+ def test_H2O_CuO_Cu(self):
89
+ """
90
+ Water on CuO/Cu surface
91
+ :return:
92
+ """
93
+ shutil.copyfile('../atoms_files/CuCHO_lasp.in', 'lasp.in')
94
+ shutil.copyfile('../atoms_files/CuCHO.pot', 'CuCHO.pot')
95
+ atoms = ase.io.read('../atoms_files/CuOx-Cu100-CONTCAR')
96
+ atoms.calc = Lasp()
97
+ ads_atoms = ase.Atoms('H2O',[[0.,0.,-1.],[0.,0.86,0.5],[0.,0.,0.]])
98
+ ads_obj = Adsorbate(ads_atoms,rtype='vdw_radii')
99
+ sg_obj = SurfaceGrid(atoms,rsub='vdw_radii',rads=ads_obj.rads)
100
+ ads_grid_comb = AdsGridCombiner(sg_obj, ads_obj)
101
+ sampler =[
102
+ {
103
+ 'surface': "KeyPointSGSampler", # 表面采样方法
104
+ }, # 第一步采样
105
+ {
106
+ 'size': 3, # 采样大小
107
+ 'surface': ("MaxDiversitySGSampler", "MinEnergySGSampler", "MaxSigmaSGSampler"), # 表面采样方法
108
+ 'weight': (0.4, 0.3, 0.3), # 表面采样方法的权重
109
+ } # 第二步采样
110
+ ]
111
+ task_obj = SurfaceSiteSampleTask(combiner=ads_grid_comb, sampler=sampler, optimizer=LBFGS)
112
+ task_obj.run()
113
+ print('Done')
114
+
88
115
  def test_C4H9_Ru(self):
89
116
  adsatoms = ase.io.read('../atoms_files/C4H9.xyz')
90
117
  adsatoms.append(Atom('X', adsatoms.positions[0])) # Add dock point with same pos with atoms[0]