SAMBA-ilum 1.1.0.118__tar.gz → 1.1.0.120__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 (71) hide show
  1. {samba_ilum-1.1.0.118/SAMBA_ilum.egg-info → samba_ilum-1.1.0.120}/PKG-INFO +1 -1
  2. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120/SAMBA_ilum.egg-info}/PKG-INFO +1 -1
  3. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/SAMBA_ilum.egg-info/SOURCES.txt +1 -0
  4. samba_ilum-1.1.0.120/samba_ilum/__init__.py +1 -0
  5. samba_ilum-1.1.0.120/samba_ilum/__main__.py +8 -0
  6. samba_ilum-1.1.0.120/samba_ilum/main_code.py +313 -0
  7. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/setup.py +1 -1
  8. samba_ilum-1.1.0.118/samba_ilum/__init__.py +0 -5
  9. samba_ilum-1.1.0.118/samba_ilum/__main__.py +0 -317
  10. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/LICENSE.txt +0 -0
  11. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/MANIFEST.in +0 -0
  12. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/README.md +0 -0
  13. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/SAMBA_ilum.egg-info/dependency_links.txt +0 -0
  14. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/SAMBA_ilum.egg-info/entry_points.txt +0 -0
  15. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/SAMBA_ilum.egg-info/requires.txt +0 -0
  16. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/SAMBA_ilum.egg-info/top_level.txt +0 -0
  17. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/BZ_2D.py +0 -0
  18. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/HeteroStructure_Generator.py +0 -0
  19. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/Hubbard_U_values.txt +0 -0
  20. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/INCAR_a-scan +0 -0
  21. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/INCAR_bader +0 -0
  22. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/INCAR_bader.SO +0 -0
  23. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/INCAR_bands +0 -0
  24. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/INCAR_bands.SO +0 -0
  25. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/INCAR_dos +0 -0
  26. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/INCAR_dos.SO +0 -0
  27. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/INCAR_relax +0 -0
  28. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/INCAR_scf +0 -0
  29. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/INCAR_scf.SO +0 -0
  30. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/INCAR_xy-scan +0 -0
  31. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/INCAR_xyz-scan +0 -0
  32. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/INCAR_z-scan +0 -0
  33. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/SAMBA_HeteroStructure.input +0 -0
  34. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/SAMBA_WorkFlow.input +0 -0
  35. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.bands +0 -0
  36. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.chgcar +0 -0
  37. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.dos +0 -0
  38. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.location +0 -0
  39. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.locpot +0 -0
  40. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.orbitals +0 -0
  41. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.spin +0 -0
  42. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/INPUTS/vdw_kernel.bindat +0 -0
  43. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/_info_pseudo.py +0 -0
  44. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/a-scan.py +0 -0
  45. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/a-scan_analysis.py +0 -0
  46. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/bader +0 -0
  47. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/bader_poscar.py +0 -0
  48. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/bader_update.py +0 -0
  49. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/cell_check.py +0 -0
  50. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/charge_transfer.py +0 -0
  51. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/chgsum.pl +0 -0
  52. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/contcar_update.py +0 -0
  53. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/data-base_json.py +0 -0
  54. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/data-base_union.py +0 -0
  55. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/energy_scan.py +0 -0
  56. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/hubbard_correction.py +0 -0
  57. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/job.py +0 -0
  58. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/kpoints.py +0 -0
  59. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/lattice_plot3d.py +0 -0
  60. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/make_files.py +0 -0
  61. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/output.py +0 -0
  62. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/poscar_fix_direct_coord.py +0 -0
  63. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/potcar.py +0 -0
  64. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/vdW_DF.py +0 -0
  65. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/xy-scan.py +0 -0
  66. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/xy-scan_analysis.py +0 -0
  67. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/xyz-scan.py +0 -0
  68. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/xyz-scan_analysis.py +0 -0
  69. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/z-scan.py +0 -0
  70. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/samba_ilum/src/z-scan_analysis.py +0 -0
  71. {samba_ilum-1.1.0.118 → samba_ilum-1.1.0.120}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: SAMBA_ilum
3
- Version: 1.1.0.118
3
+ Version: 1.1.0.120
4
4
  Summary: ...
5
5
  Author: Augusto de Lelis Araujo
6
6
  Author-email: augusto-lelis@outlook.com
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: SAMBA_ilum
3
- Version: 1.1.0.118
3
+ Version: 1.1.0.120
4
4
  Summary: ...
5
5
  Author: Augusto de Lelis Araujo
6
6
  Author-email: augusto-lelis@outlook.com
@@ -11,6 +11,7 @@ SAMBA_ilum.egg-info/requires.txt
11
11
  SAMBA_ilum.egg-info/top_level.txt
12
12
  samba_ilum/__init__.py
13
13
  samba_ilum/__main__.py
14
+ samba_ilum/main_code.py
14
15
  samba_ilum/src/BZ_2D.py
15
16
  samba_ilum/src/HeteroStructure_Generator.py
16
17
  samba_ilum/src/_info_pseudo.py
@@ -0,0 +1 @@
1
+ # SAMBA_ilum Copyright (C) 2025 - Closed source
@@ -0,0 +1,8 @@
1
+ # SAMBA_ilum Copyright (C) 2025 - Closed source
2
+
3
+ def main():
4
+ import os
5
+ path_code = os.path.dirname(os.path.realpath(__file__))
6
+ exec(open(path_code + '/main_code.py').read())
7
+ if __name__ == '__main__':
8
+ main()
@@ -0,0 +1,313 @@
1
+ # SAMBA_ilum Copyright (C) 2025 - Closed source
2
+
3
+ import numpy as np
4
+ import subprocess
5
+ import itertools
6
+ import shutil
7
+ import time
8
+ import sys
9
+ import os
10
+
11
+ #----------------
12
+ dir_codes = 'src'
13
+ dir_files = os.getcwd()
14
+ os.chdir(os.path.dirname(os.path.realpath(__file__)))
15
+ dir_samba = os.path.dirname(os.path.realpath(__file__))
16
+ print(f'{dir_samba}')
17
+ #--------------------
18
+
19
+ version = '1.1.0.120'
20
+
21
+ print(" ")
22
+ print("=============================================================")
23
+ print(f'SAMBA_ilum v{version} Copyright (C) 2025 --------------------')
24
+ print("Closed source: Adalberto Fazzio's research group (Ilum|CNPEM)")
25
+ print("Author: Augusto de Lelis Araujo -----------------------------")
26
+ print("=============================================================")
27
+ print(" ")
28
+ print(" _____ ___ __ _______ ___ _ __ ")
29
+ print(" / ___// | / |/ / __ )/ | (_) /_ ______ ___ ")
30
+ print(""" \__ \/ /| | / /|_/ / __ / /| | / / / / / / __ `___\ """)
31
+ print(" ___/ / ___ |/ / / / /_/ / ___ | / / / /_/ / / / / / /")
32
+ print("/____/_/ |_/_/ /_/_____/_/ |_| /_/_/\__,_/_/ /_/ /_/ ")
33
+ print(f'Simulation and Automated Methods for Bilayer Analysis v{version}')
34
+ print(" ")
35
+
36
+ #------------------------------------------------
37
+ # Checking for updates for SAMBA ----------------
38
+ #------------------------------------------------
39
+ try:
40
+ url = f"https://pypi.org/pypi/{'samba_ilum'}/json"
41
+ response = requests.get(url)
42
+ dados = response.json()
43
+ current_version = dados['info']['version']; current_version = str(current_version)
44
+ if (current_version != version):
45
+ print(" ")
46
+ print("--------------------------------------------------------------")
47
+ print(" !!!!! Your SAMBA version is out of date !!!!! ")
48
+ print("--------------------------------------------------------------")
49
+ print(" To update, close the SAMBA and enter into the terminal: ")
50
+ print(" pip install --upgrade samba ")
51
+ print("--------------------------------------------------------------")
52
+ print(" ")
53
+ print(" ")
54
+ ...
55
+ except Exception as e:
56
+ print("--------------------------------------------------------------")
57
+ print(" !!!! Unable to verify the current version of SAMBA !!!! ")
58
+ print("--------------------------------------------------------------")
59
+ print(" ")
60
+
61
+
62
+ # ------------------------------------------------------------------------------
63
+ # Checking if the "run.input" file exists --------------------------------------
64
+ # ------------------------------------------------------------------------------
65
+ run_input = 'not'
66
+ #----------------
67
+ if os.path.isfile(dir_files + '/run.input'): run_input = 'yes'
68
+ else: run_input = 'not'
69
+ # ----------------------
70
+ if (run_input == 'yes'):
71
+ run = open(dir_files + '/run.input', "r")
72
+ VTemp = run.readline().split()
73
+ if (len(VTemp) == 3): tarefa = int(VTemp[2])
74
+
75
+
76
+ if(run_input == 'not'):
77
+ print("######################################################################")
78
+ print("# What do you want to run? ===========================================")
79
+ print("# ====================================================================")
80
+ print("# [0] Generate SAMBA execution inputs ")
81
+ print("# --------------------------------------------------------------------")
82
+ print("# [1] Heterostructure Generator ")
83
+ print("# [2] WorkFlow: High Throughput DFT (inputs + job) ")
84
+ print("# --------------------------------------------------------------------")
85
+ print("# [3] Customize internal WorkFlow inputs (INPUTS folder) ")
86
+ print("######################################################################")
87
+ print("A tutorial on how to use the SAMBA is available on GitHub at the link:")
88
+ print("https://github.com/Augusto-de-Lelis-Araujo/SAMBA/blob/main/README.md ")
89
+ print("######################################################################")
90
+ tarefa = input(" "); tarefa = int(tarefa)
91
+ print(" ")
92
+
93
+
94
+ if (tarefa == 0):
95
+ shutil.copyfile(dir_codes + '/INPUTS/SAMBA_WorkFlow.input', dir_files + '/SAMBA_WorkFlow.input')
96
+ shutil.copyfile(dir_codes + '/INPUTS/SAMBA_HeteroStructure.input', dir_files + '/SAMBA_HeteroStructure.input')
97
+
98
+
99
+ if (tarefa == 1):
100
+ #--------------------------------------------------------------------------------------------------
101
+ # Checking if the "SAMBA_HeteroStructure.input" file exists, if it does not exist it is created ---
102
+ #--------------------------------------------------------------------------------------------------
103
+ if os.path.isfile(dir_files + '/SAMBA_HeteroStructure.input'):
104
+ 0 == 0
105
+ else:
106
+ shutil.copyfile(dir_codes + '/SAMBA_HeteroStructure.input', dir_files + '/SAMBA_HeteroStructure.input')
107
+ #------------------------------------------------------------------------------------------------------
108
+ print(" ")
109
+ print("==============================================================")
110
+ print("Generated SAMBA_HeteroStructure.input file !!! ===============")
111
+ print("--------------------------------------------------------------")
112
+ print("Configure the SAMBA_HeteroStructure.input file and run the ---")
113
+ print(" code again ---")
114
+ print("==============================================================")
115
+ print(" ")
116
+ #--------------------------------------------------------
117
+ confirmacao = input (" "); confirmacao = str(confirmacao)
118
+ sys.exit()
119
+ #---------
120
+
121
+ #------------------------------------------------------------
122
+ exec(open(dir_files + '/SAMBA_HeteroStructure.input').read())
123
+ #------------------------------------------------------------
124
+ separacao1 = separation_1
125
+ separacao2 = separation_2
126
+ #------------------------
127
+ if (loop_ht == 0):
128
+ Lattice1 = Lattice1.replace(".vasp","") + ".vasp"
129
+ Lattice2 = Lattice2.replace(".vasp","") + ".vasp"
130
+ Lattice3 = Lattice3.replace(".vasp","") + ".vasp"
131
+ #---------------------------------------------------
132
+
133
+ #=============================================================
134
+ # Fixing the coordinates of POSCAR files in direct form ======
135
+ #=============================================================
136
+ dir_files_in = dir_poscar
137
+ exec(open(dir_codes + '/poscar_fix_direct_coord.py').read())
138
+ #=============================================================
139
+ # Checking the structure of POSCAR files, regarding the ======
140
+ # rotation angle in relation to the z-axis ===================
141
+ #=============================================================
142
+ exec(open(dir_codes + '/cell_check.py').read())
143
+ #=============================================================
144
+
145
+ if (loop_ht == 1):
146
+ #--------------
147
+ n_Lattice = 2
148
+ #--------------------------------------------------------------------------
149
+ # Checking for existence of non-empty file 'check_list_loop.txt' ----------
150
+ #--------------------------------------------------------------------------
151
+ temp_check = 0
152
+ #-------------
153
+ check_list_dir = dir_files + '/check_list_loop.txt'
154
+ if os.path.exists(check_list_dir) and os.path.getsize(check_list_dir) != 0:
155
+ check = np.loadtxt(check_list_dir, dtype='str'); check.shape
156
+ n_ht = check[:,0]; mat1 = check[:,1]; mat2 = check[:,2]
157
+ temp_check = 1
158
+ #------------------------------
159
+ if (temp_check == 0): nloop = 0
160
+ if (temp_check == 1): nloop = len(mat1)
161
+ #--------------------------------------
162
+ temp_dir = dir_files + '/' + dir_poscar
163
+ files0 = [name for name in os.listdir(temp_dir) if os.path.isfile(os.path.join(temp_dir, name))] # Listando os arquivos dentro do diretório "dir_poscar"
164
+ files = sorted(files0)
165
+ #---------------------------------------------------------------------
166
+ # bilayer_materials = list(itertools.combinations(files, 2))
167
+ # for material in files: bilayer_materials.append((material, material))
168
+ #---------------------------------------------------------------------
169
+ bilayer_materials = []
170
+ for material1 in files:
171
+ for material2 in files:
172
+ bilayer_materials.append((material1, material2))
173
+ #-------------------------------------------------------
174
+ vistos = set()
175
+ new_bilayer_materials = [] # List to store unique elements
176
+ for elemento in bilayer_materials:
177
+ elem_ordenado = tuple(sorted(elemento)) # Sorts the elements (ignoring permutations)
178
+ if elem_ordenado not in vistos:
179
+ new_bilayer_materials.append(elemento) # Adding elements that do not have permutations
180
+ vistos.add(elem_ordenado)
181
+ bilayer_materials = new_bilayer_materials # Saving the new list with the permutations removed
182
+ #-------------------------------------------------------
183
+ for loop in range(len(bilayer_materials)):
184
+ Lattice1 = bilayer_materials[loop][0]
185
+ Lattice2 = bilayer_materials[loop][1]
186
+ Lattice3 = ''
187
+ #------
188
+ run = 1
189
+ #-------------------
190
+ if (temp_check == 1):
191
+ for mnt in range(len(mat1)):
192
+ temp0_mat1 = str(mat1[mnt]); temp0_mat2 = str(mat2[mnt])
193
+ temp1_mat1 = Lattice1.replace('.vasp', ''); temp1_mat2 = Lattice2.replace('.vasp', '')
194
+ if ( (temp0_mat1 == temp1_mat1 and temp0_mat2 == temp1_mat2) or (temp0_mat1 == temp1_mat2 and temp0_mat2 == temp1_mat1) ): run = 0
195
+ #---------------------------------------------------------------------------------------------------------------------------------
196
+
197
+ if ( temp_check == 0 or (temp_check == 1 and run == 1) ):
198
+ #------------------------------------------------------------------
199
+ # Heterostructure loop check_list ---------------------------------
200
+ #------------------------------------------------------------------
201
+ nloop += +1
202
+ if (nloop >= 0 and nloop < 10): nloop2 = '000' + str(nloop)
203
+ if (nloop >= 10 and nloop < 100): nloop2 = '00' + str(nloop)
204
+ if (nloop >= 100 and nloop < 1000): nloop2 = '0' + str(nloop)
205
+ if (nloop > 1000): nloop2 = str(nloop)
206
+ dir_loop = str(nloop2) + '--' + Lattice1.replace('.vasp', '') + '--' + Lattice2.replace('.vasp', '')
207
+ #---------------------------------------------------------------------------------------------------
208
+ check_list = open(dir_files + '/check_list_loop.txt', 'a')
209
+ t_Lattice1 = Lattice1.replace('.vasp', ' '); t_Lattice2 = Lattice2.replace('.vasp', ' ')
210
+ if (n_Lattice == 2):
211
+ check_list.write(f'{nloop2} {t_Lattice1} {t_Lattice2} \n')
212
+ if (n_Lattice == 3):
213
+ t_Lattice3 = Lattice3.replace('.vasp', ' ')
214
+ check_list.write(f'{nloop2} {t_Lattice1} {t_Lattice2} {t_Lattice3} \n')
215
+ check_list.close()
216
+ #-----------------
217
+
218
+ try:
219
+ exec(open(dir_codes + '/HeteroStructure_Generator.py').read())
220
+ ...
221
+ except SystemExit as e: 0 == 0
222
+ except Exception as e: 0 == 0
223
+ #----------------------------
224
+
225
+ if (loop_ht == 0): exec(open(dir_codes + '/HeteroStructure_Generator.py').read())
226
+
227
+
228
+ if (tarefa == 2):
229
+ #-------------------------------------------------------------------------------------------
230
+ # Checking if the "SAMBA_WorkFlow.input" file exists, if it does not exist it is created ---
231
+ #-------------------------------------------------------------------------------------------
232
+ if os.path.isfile(dir_files + '/SAMBA_WorkFlow.input'):
233
+ 0 == 0
234
+ else:
235
+ shutil.copyfile(dir_codes + '/SAMBA_WorkFlow.input', dir_files + '/SAMBA_WorkFlow.input')
236
+ #----------------------------------------------------------------------------------------
237
+ print(" ")
238
+ print("==============================================================")
239
+ print("SAMBA_WorkFlow.input file generated !!! ======================")
240
+ print("--------------------------------------------------------------")
241
+ print("Configure the SAMBA_WorkFlow.input file and run the code again")
242
+ print("==============================================================")
243
+ print(" ")
244
+ #--------------------------------------------------------
245
+ confirmacao = input (" "); confirmacao = str(confirmacao)
246
+ sys.exit()
247
+ #---------
248
+
249
+ #----------------------------------------------------
250
+ # Checking if the "WorkFlow_INPUTS" folder exists ---
251
+ #----------------------------------------------------
252
+ if os.path.isdir(dir_files + '/WorkFlow_INPUTS'):
253
+ dir_inputs = dir_files + '/WorkFlow_INPUTS'
254
+ else:
255
+ dir_inputs = dir_codes + '/INPUTS'
256
+ #------------------------------------------------------
257
+ dir_inputs_vasprocar = dir_inputs + '/inputs_VASProcar'
258
+ #------------------------------------------------------
259
+
260
+ #------------------------------------------------
261
+ # Checking if the "POTCAR" folder exists --------
262
+ #------------------------------------------------
263
+ if os.path.isdir(dir_files + '/POTCAR'):
264
+ 0 == 0
265
+ else:
266
+ print('')
267
+ print('Warning: -----------------------------------------')
268
+ print('Missing POTCAR folder and POTCAR_[ion] files -----')
269
+ print('Enter and then press [ENTER] to continue ---------')
270
+ print('--------------------------------------------------')
271
+ confirmacao = input (" "); confirmacao = str(confirmacao)
272
+ #------------------------------------
273
+ dir_pseudo = dir_files + '/POTCAR'
274
+ shutil.copyfile(dir_codes + '/_info_pseudo.py', dir_pseudo + '/_info_pseudo.py')
275
+ os.chdir(dir_pseudo)
276
+ exec(open(dir_pseudo + '/_info_pseudo.py').read())
277
+ os.chdir(dir_samba)
278
+ #------------------
279
+
280
+ #-----------------------------------------------------
281
+ exec(open(dir_files + '/SAMBA_WorkFlow.input').read())
282
+ #-----------------------------------------------------
283
+ vacuo = vacuum
284
+ #-------------
285
+ dir_out = dir_files + '/' + dir_o
286
+ #----------------------------------
287
+ task = []
288
+ for i in range(len(tasks)):
289
+ if (tasks[i] == 'a-scan' or tasks[i] == 'z-scan' or tasks[i] == 'xy-scan' or tasks[i] == 'xyz-scan' or tasks[i] == 'relax'): task.append(tasks[i])
290
+ for j in range(len(type)):
291
+ if (type[j] == 'sem_SO'): rot = ''
292
+ if (type[j] == 'com_SO'): rot = '.SO'
293
+ if (tasks[i] != 'a-scan' and tasks[i] != 'z-scan' and tasks[i] != 'xy-scan' and tasks[i] != 'xyz-scan' and tasks[i] != 'relax'): task.append(tasks[i] + rot)
294
+ #--------------------------------------------------------------------------------------------------------------------------------------------------------------------
295
+
296
+ #=============================================================
297
+ # Fixing the coordinates of POSCAR files in direct form ======
298
+ #=============================================================
299
+ dir_files_in = 'Structures'
300
+ exec(open(dir_codes + '/poscar_fix_direct_coord.py').read())
301
+ #=============================================================
302
+ exec(open(dir_codes + '/make_files.py').read())
303
+ #=============================================================
304
+
305
+
306
+ if (tarefa == 3): shutil.copytree(dir_codes + '/INPUTS', dir_files + '/WorkFlow_INPUTS')
307
+
308
+
309
+ print(" ")
310
+ print("=============")
311
+ print("Completed ===")
312
+ print("=============")
313
+ print(" ")
@@ -6,7 +6,7 @@ import json
6
6
 
7
7
  setup(
8
8
  name = "SAMBA_ilum",
9
- version = "1.1.0.118",
9
+ version = "1.1.0.120",
10
10
  packages=['samba_ilum', 'samba_ilum.src'],
11
11
  include_package_data=True,
12
12
  entry_points={'console_scripts': ['samba_ilum = samba_ilum.__main__:main']},
@@ -1,5 +0,0 @@
1
- # SAMBA_ilum Copyright (C) 2025 - Closed source
2
-
3
-
4
-
5
-
@@ -1,317 +0,0 @@
1
- # SAMBA_ilum Copyright (C) 2025 - Closed source
2
-
3
- def main():
4
- import numpy as np
5
- import subprocess
6
- import itertools
7
- import shutil
8
- import time
9
- import sys
10
- import os
11
-
12
- #----------------
13
- dir_codes = 'src'
14
- dir_files = os.getcwd()
15
- os.chdir(os.path.dirname(os.path.realpath(__file__)))
16
- dir_samba = os.path.dirname(os.path.realpath(__file__))
17
- print(f'{dir_samba}')
18
- #--------------------
19
-
20
- version = '1.1.0.118'
21
-
22
- print(" ")
23
- print("=============================================================")
24
- print(f'SAMBA_ilum v{version} Copyright (C) 2025 --------------------')
25
- print("Closed source: Adalberto Fazzio's research group (Ilum|CNPEM)")
26
- print("Author: Augusto de Lelis Araujo -----------------------------")
27
- print("=============================================================")
28
- print(" ")
29
- print(" _____ ___ __ _______ ___ _ __ ")
30
- print(" / ___// | / |/ / __ )/ | (_) /_ ______ ___ ")
31
- print(""" \__ \/ /| | / /|_/ / __ / /| | / / / / / / __ `___\ """)
32
- print(" ___/ / ___ |/ / / / /_/ / ___ | / / / /_/ / / / / / /")
33
- print("/____/_/ |_/_/ /_/_____/_/ |_| /_/_/\__,_/_/ /_/ /_/ ")
34
- print(f'Simulation and Automated Methods for Bilayer Analysis v{version}')
35
- print(" ")
36
-
37
- #------------------------------------------------
38
- # Checking for updates for SAMBA ----------------
39
- #------------------------------------------------
40
- try:
41
- url = f"https://pypi.org/pypi/{'samba_ilum'}/json"
42
- response = requests.get(url)
43
- dados = response.json()
44
- current_version = dados['info']['version']; current_version = str(current_version)
45
- if (current_version != version):
46
- print(" ")
47
- print("--------------------------------------------------------------")
48
- print(" !!!!! Your SAMBA version is out of date !!!!! ")
49
- print("--------------------------------------------------------------")
50
- print(" To update, close the SAMBA and enter into the terminal: ")
51
- print(" pip install --upgrade samba ")
52
- print("--------------------------------------------------------------")
53
- print(" ")
54
- print(" ")
55
- ...
56
- except Exception as e:
57
- print("--------------------------------------------------------------")
58
- print(" !!!! Unable to verify the current version of SAMBA !!!! ")
59
- print("--------------------------------------------------------------")
60
- print(" ")
61
-
62
-
63
- # ------------------------------------------------------------------------------
64
- # Checking if the "run.input" file exists --------------------------------------
65
- # ------------------------------------------------------------------------------
66
- run_input = 'not'
67
- #----------------
68
- if os.path.isfile(dir_files + '/run.input'): run_input = 'yes'
69
- else: run_input = 'not'
70
- # ----------------------
71
- if (run_input == 'yes'):
72
- run = open(dir_files + '/run.input', "r")
73
- VTemp = run.readline().split()
74
- if (len(VTemp) == 3): tarefa = int(VTemp[2])
75
-
76
-
77
- if(run_input == 'not'):
78
- print("######################################################################")
79
- print("# What do you want to run? ===========================================")
80
- print("# ====================================================================")
81
- print("# [0] Generate SAMBA execution inputs ")
82
- print("# --------------------------------------------------------------------")
83
- print("# [1] Heterostructure Generator ")
84
- print("# [2] WorkFlow: High Throughput DFT (inputs + job) ")
85
- print("# --------------------------------------------------------------------")
86
- print("# [3] Customize internal WorkFlow inputs (INPUTS folder) ")
87
- print("######################################################################")
88
- print("A tutorial on how to use the SAMBA is available on GitHub at the link:")
89
- print("https://github.com/Augusto-de-Lelis-Araujo/SAMBA/blob/main/README.md ")
90
- print("######################################################################")
91
- tarefa = input(" "); tarefa = int(tarefa)
92
- print(" ")
93
-
94
-
95
- if (tarefa == 0):
96
- shutil.copyfile(dir_codes + '/INPUTS/SAMBA_WorkFlow.input', dir_files + '/SAMBA_WorkFlow.input')
97
- shutil.copyfile(dir_codes + '/INPUTS/SAMBA_HeteroStructure.input', dir_files + '/SAMBA_HeteroStructure.input')
98
-
99
-
100
- if (tarefa == 1):
101
- #--------------------------------------------------------------------------------------------------
102
- # Checking if the "SAMBA_HeteroStructure.input" file exists, if it does not exist it is created ---
103
- #--------------------------------------------------------------------------------------------------
104
- if os.path.isfile(dir_files + '/SAMBA_HeteroStructure.input'):
105
- 0 == 0
106
- else:
107
- shutil.copyfile(dir_codes + '/SAMBA_HeteroStructure.input', dir_files + '/SAMBA_HeteroStructure.input')
108
- #------------------------------------------------------------------------------------------------------
109
- print(" ")
110
- print("==============================================================")
111
- print("Generated SAMBA_HeteroStructure.input file !!! ===============")
112
- print("--------------------------------------------------------------")
113
- print("Configure the SAMBA_HeteroStructure.input file and run the ---")
114
- print(" code again ---")
115
- print("==============================================================")
116
- print(" ")
117
- #--------------------------------------------------------
118
- confirmacao = input (" "); confirmacao = str(confirmacao)
119
- sys.exit()
120
- #---------
121
-
122
- #------------------------------------------------------------
123
- exec(open(dir_files + '/SAMBA_HeteroStructure.input').read())
124
- #------------------------------------------------------------
125
- separacao1 = separation_1
126
- separacao2 = separation_2
127
- #------------------------
128
- if (loop_ht == 0):
129
- Lattice1 = Lattice1.replace(".vasp","") + ".vasp"
130
- Lattice2 = Lattice2.replace(".vasp","") + ".vasp"
131
- Lattice3 = Lattice3.replace(".vasp","") + ".vasp"
132
- #---------------------------------------------------
133
-
134
- #=============================================================
135
- # Fixing the coordinates of POSCAR files in direct form ======
136
- #=============================================================
137
- dir_files_in = dir_poscar
138
- exec(open(dir_codes + '/poscar_fix_direct_coord.py').read())
139
- #=============================================================
140
- # Checking the structure of POSCAR files, regarding the ======
141
- # rotation angle in relation to the z-axis ===================
142
- #=============================================================
143
- exec(open(dir_codes + '/cell_check.py').read())
144
- #=============================================================
145
-
146
- if (loop_ht == 1):
147
- #--------------
148
- n_Lattice = 2
149
- #--------------------------------------------------------------------------
150
- # Checking for existence of non-empty file 'check_list_loop.txt' ----------
151
- #--------------------------------------------------------------------------
152
- temp_check = 0
153
- #-------------
154
- check_list_dir = dir_files + '/check_list_loop.txt'
155
- if os.path.exists(check_list_dir) and os.path.getsize(check_list_dir) != 0:
156
- check = np.loadtxt(check_list_dir, dtype='str'); check.shape
157
- n_ht = check[:,0]; mat1 = check[:,1]; mat2 = check[:,2]
158
- temp_check = 1
159
- #------------------------------
160
- if (temp_check == 0): nloop = 0
161
- if (temp_check == 1): nloop = len(mat1)
162
- #--------------------------------------
163
- temp_dir = dir_files + '/' + dir_poscar
164
- files0 = [name for name in os.listdir(temp_dir) if os.path.isfile(os.path.join(temp_dir, name))] # Listando os arquivos dentro do diretório "dir_poscar"
165
- files = sorted(files0)
166
- #---------------------------------------------------------------------
167
- # bilayer_materials = list(itertools.combinations(files, 2))
168
- # for material in files: bilayer_materials.append((material, material))
169
- #---------------------------------------------------------------------
170
- bilayer_materials = []
171
- for material1 in files:
172
- for material2 in files:
173
- bilayer_materials.append((material1, material2))
174
- #-------------------------------------------------------
175
- vistos = set()
176
- new_bilayer_materials = [] # List to store unique elements
177
- for elemento in bilayer_materials:
178
- elem_ordenado = tuple(sorted(elemento)) # Sorts the elements (ignoring permutations)
179
- if elem_ordenado not in vistos:
180
- new_bilayer_materials.append(elemento) # Adding elements that do not have permutations
181
- vistos.add(elem_ordenado)
182
- bilayer_materials = new_bilayer_materials # Saving the new list with the permutations removed
183
- #-------------------------------------------------------
184
- for loop in range(len(bilayer_materials)):
185
- Lattice1 = bilayer_materials[loop][0]
186
- Lattice2 = bilayer_materials[loop][1]
187
- Lattice3 = ''
188
- #------
189
- run = 1
190
- #-------------------
191
- if (temp_check == 1):
192
- for mnt in range(len(mat1)):
193
- temp0_mat1 = str(mat1[mnt]); temp0_mat2 = str(mat2[mnt])
194
- temp1_mat1 = Lattice1.replace('.vasp', ''); temp1_mat2 = Lattice2.replace('.vasp', '')
195
- if ( (temp0_mat1 == temp1_mat1 and temp0_mat2 == temp1_mat2) or (temp0_mat1 == temp1_mat2 and temp0_mat2 == temp1_mat1) ): run = 0
196
- #---------------------------------------------------------------------------------------------------------------------------------
197
-
198
- if ( temp_check == 0 or (temp_check == 1 and run == 1) ):
199
- #------------------------------------------------------------------
200
- # Heterostructure loop check_list ---------------------------------
201
- #------------------------------------------------------------------
202
- nloop += +1
203
- if (nloop >= 0 and nloop < 10): nloop2 = '000' + str(nloop)
204
- if (nloop >= 10 and nloop < 100): nloop2 = '00' + str(nloop)
205
- if (nloop >= 100 and nloop < 1000): nloop2 = '0' + str(nloop)
206
- if (nloop > 1000): nloop2 = str(nloop)
207
- dir_loop = str(nloop2) + '--' + Lattice1.replace('.vasp', '') + '--' + Lattice2.replace('.vasp', '')
208
- #---------------------------------------------------------------------------------------------------
209
- check_list = open(dir_files + '/check_list_loop.txt', 'a')
210
- t_Lattice1 = Lattice1.replace('.vasp', ' '); t_Lattice2 = Lattice2.replace('.vasp', ' ')
211
- if (n_Lattice == 2):
212
- check_list.write(f'{nloop2} {t_Lattice1} {t_Lattice2} \n')
213
- if (n_Lattice == 3):
214
- t_Lattice3 = Lattice3.replace('.vasp', ' ')
215
- check_list.write(f'{nloop2} {t_Lattice1} {t_Lattice2} {t_Lattice3} \n')
216
- check_list.close()
217
- #-----------------
218
-
219
- try:
220
- exec(open(dir_codes + '/HeteroStructure_Generator.py').read())
221
- ...
222
- except SystemExit as e: 0 == 0
223
- except Exception as e: 0 == 0
224
- #----------------------------
225
-
226
- if (loop_ht == 0): exec(open(dir_codes + '/HeteroStructure_Generator.py').read())
227
-
228
-
229
- if (tarefa == 2):
230
- #-------------------------------------------------------------------------------------------
231
- # Checking if the "SAMBA_WorkFlow.input" file exists, if it does not exist it is created ---
232
- #-------------------------------------------------------------------------------------------
233
- if os.path.isfile(dir_files + '/SAMBA_WorkFlow.input'):
234
- 0 == 0
235
- else:
236
- shutil.copyfile(dir_codes + '/SAMBA_WorkFlow.input', dir_files + '/SAMBA_WorkFlow.input')
237
- #----------------------------------------------------------------------------------------
238
- print(" ")
239
- print("==============================================================")
240
- print("SAMBA_WorkFlow.input file generated !!! ======================")
241
- print("--------------------------------------------------------------")
242
- print("Configure the SAMBA_WorkFlow.input file and run the code again")
243
- print("==============================================================")
244
- print(" ")
245
- #--------------------------------------------------------
246
- confirmacao = input (" "); confirmacao = str(confirmacao)
247
- sys.exit()
248
- #---------
249
-
250
- #----------------------------------------------------
251
- # Checking if the "WorkFlow_INPUTS" folder exists ---
252
- #----------------------------------------------------
253
- if os.path.isdir(dir_files + '/WorkFlow_INPUTS'):
254
- dir_inputs = dir_files + '/WorkFlow_INPUTS'
255
- else:
256
- dir_inputs = dir_codes + '/INPUTS'
257
- #------------------------------------------------------
258
- dir_inputs_vasprocar = dir_inputs + '/inputs_VASProcar'
259
- #------------------------------------------------------
260
-
261
- #------------------------------------------------
262
- # Checking if the "POTCAR" folder exists --------
263
- #------------------------------------------------
264
- if os.path.isdir(dir_files + '/POTCAR'):
265
- 0 == 0
266
- else:
267
- print('')
268
- print('Warning: -----------------------------------------')
269
- print('Missing POTCAR folder and POTCAR_[ion] files -----')
270
- print('Enter and then press [ENTER] to continue ---------')
271
- print('--------------------------------------------------')
272
- confirmacao = input (" "); confirmacao = str(confirmacao)
273
- #------------------------------------
274
- dir_pseudo = dir_files + '/POTCAR'
275
- shutil.copyfile(dir_codes + '/_info_pseudo.py', dir_pseudo + '/_info_pseudo.py')
276
- os.chdir(dir_pseudo)
277
- exec(open(dir_pseudo + '/_info_pseudo.py').read())
278
- os.chdir(dir_samba)
279
- #------------------
280
-
281
- #-----------------------------------------------------
282
- exec(open(dir_files + '/SAMBA_WorkFlow.input').read())
283
- #-----------------------------------------------------
284
- vacuo = vacuum
285
- #-------------
286
- dir_out = dir_files + '/' + dir_o
287
- #----------------------------------
288
- task = []
289
- for i in range(len(tasks)):
290
- if (tasks[i] == 'a-scan' or tasks[i] == 'z-scan' or tasks[i] == 'xy-scan' or tasks[i] == 'xyz-scan' or tasks[i] == 'relax'): task.append(tasks[i])
291
- for j in range(len(type)):
292
- if (type[j] == 'sem_SO'): rot = ''
293
- if (type[j] == 'com_SO'): rot = '.SO'
294
- if (tasks[i] != 'a-scan' and tasks[i] != 'z-scan' and tasks[i] != 'xy-scan' and tasks[i] != 'xyz-scan' and tasks[i] != 'relax'): task.append(tasks[i] + rot)
295
- #--------------------------------------------------------------------------------------------------------------------------------------------------------------------
296
-
297
- #=============================================================
298
- # Fixing the coordinates of POSCAR files in direct form ======
299
- #=============================================================
300
- dir_files_in = 'Structures'
301
- exec(open(dir_codes + '/poscar_fix_direct_coord.py').read())
302
- #=============================================================
303
- exec(open(dir_codes + '/make_files.py').read())
304
- #=============================================================
305
-
306
-
307
- if (tarefa == 3): shutil.copytree(dir_codes + '/INPUTS', dir_files + '/WorkFlow_INPUTS')
308
-
309
-
310
- print(" ")
311
- print("=============")
312
- print("Completed ===")
313
- print("=============")
314
- print(" ")
315
-
316
- if __name__ == '__main__':
317
- main()
File without changes
File without changes