Spaces:
Runtime error
Runtime error
Andrei tomut
commited on
Commit
•
1fcd924
1
Parent(s):
c8c4db0
oh
Browse files- .idea/latmatcher.iml +1 -1
- .idea/misc.xml +1 -1
- Example_LatmatherExample.py +10 -4
- app.py +1 -1
- backend/__pycache__/__init__.cpython-310.pyc +0 -0
- backend/__pycache__/__init__.cpython-38.pyc +0 -0
- backend/db_utils/__pycache__/__init__.cpython-310.pyc +0 -0
- backend/db_utils/__pycache__/parse_c2db.cpython-310.pyc +0 -0
- backend/db_utils/__pycache__/parse_jarvis.cpython-310.pyc +0 -0
- backend/db_utils/__pycache__/structure_database.cpython-310.pyc +0 -0
- backend/db_utils/__pycache__/structure_propriety.cpython-310.pyc +0 -0
- backend/db_utils/__pycache__/utils.cpython-310.pyc +0 -0
- backend/db_utils/vasp_utils/__pycache__/__init__.cpython-310.pyc +0 -0
- backend/db_utils/vasp_utils/__pycache__/band_structure.cpython-310.pyc +0 -0
- backend/latmathcher/__pycache__/__init__.cpython-310.pyc +0 -0
- backend/latmathcher/__pycache__/__init__.cpython-38.pyc +0 -0
- backend/latmathcher/__pycache__/geometry.cpython-310.pyc +0 -0
- backend/latmathcher/__pycache__/geometry.cpython-38.pyc +0 -0
- backend/latmathcher/__pycache__/latmatcher.cpython-310.pyc +0 -0
- backend/latmathcher/__pycache__/latmatcher.cpython-38.pyc +0 -0
- backend/latmathcher/__pycache__/pipeline.cpython-310.pyc +0 -0
- backend/latmathcher/__pycache__/pipeline.cpython-38.pyc +0 -0
- backend/latmathcher/__pycache__/plots.cpython-310.pyc +0 -0
- backend/latmathcher/__pycache__/utils.cpython-310.pyc +0 -0
- interface_connection/latmatcher_interface.py +5 -3
.idea/latmatcher.iml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<module type="PYTHON_MODULE" version="4">
|
3 |
<component name="NewModuleRootManager">
|
4 |
<content url="file://$MODULE_DIR$" />
|
5 |
-
<orderEntry type="
|
6 |
<orderEntry type="sourceFolder" forTests="false" />
|
7 |
</component>
|
8 |
<component name="PyDocumentationSettings">
|
|
|
2 |
<module type="PYTHON_MODULE" version="4">
|
3 |
<component name="NewModuleRootManager">
|
4 |
<content url="file://$MODULE_DIR$" />
|
5 |
+
<orderEntry type="jdk" jdkName="BespokeMaterialsConda" jdkType="Python SDK" />
|
6 |
<orderEntry type="sourceFolder" forTests="false" />
|
7 |
</component>
|
8 |
<component name="PyDocumentationSettings">
|
.idea/misc.xml
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<project version="4">
|
3 |
-
<component name="ProjectRootManager" version="2" project-jdk-name="
|
4 |
</project>
|
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<project version="4">
|
3 |
+
<component name="ProjectRootManager" version="2" project-jdk-name="BespokeMaterialsConda" project-jdk-type="Python SDK" />
|
4 |
</project>
|
Example_LatmatherExample.py
CHANGED
@@ -10,10 +10,16 @@ import matplotlib.pyplot as plt
|
|
10 |
import matplotlib.patches as patches
|
11 |
|
12 |
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
-
filepathA = "EXAMPLES/WSe2-1cfbe6183886.json"
|
15 |
-
filepathB = "EXAMPLES/C2-a6735a4a3797.json"
|
16 |
|
|
|
|
|
|
|
17 |
|
18 |
A_structure = from_c2db_structure(read_c2db_json(filepathA))
|
19 |
B_structure = from_c2db_structure(read_c2db_json(filepathB))
|
@@ -21,12 +27,12 @@ B_structure = from_c2db_structure(read_c2db_json(filepathB))
|
|
21 |
min_supercel = PipelineLatMatch(A_structure["cell"],B_structure["cell"],
|
22 |
Aatoms3D=structure_ato_list(A_structure),
|
23 |
Batoms3D=structure_ato_list(B_structure),
|
24 |
-
dim=(10, 10), optimize_angle=True, optimize_strain=True)
|
25 |
|
26 |
|
27 |
print(min_supercel.Alat)
|
28 |
print(min_supercel.Blat)
|
29 |
-
new_structure = min_supercel.get_new_structure()
|
30 |
|
31 |
|
32 |
|
|
|
10 |
import matplotlib.patches as patches
|
11 |
|
12 |
|
13 |
+
#
|
14 |
+
# filepathA = "EXAMPLES/1WSe2-1.xyz"
|
15 |
+
# filepathB = "EXAMPLES/2C2-1.xyz"
|
16 |
+
filepathA = "/Users/voicutomut/Documents/GitLab/bespoke-interface/DB_experiments/C2DB_json_colection/WSe2-1cfbe6183886.json"
|
17 |
+
filepathB = "/Users/voicutomut/Documents/GitLab/bespoke-interface/DB_experiments/C2DB_json_colection/C2-a6735a4a3797.json"
|
18 |
|
|
|
|
|
19 |
|
20 |
+
A_structure = from_c2db_structure(read_c2db_json(filepathA))
|
21 |
+
B_structure = from_c2db_structure(read_c2db_json(filepathB))
|
22 |
+
print("Astr:",A_structure)
|
23 |
|
24 |
A_structure = from_c2db_structure(read_c2db_json(filepathA))
|
25 |
B_structure = from_c2db_structure(read_c2db_json(filepathB))
|
|
|
27 |
min_supercel = PipelineLatMatch(A_structure["cell"],B_structure["cell"],
|
28 |
Aatoms3D=structure_ato_list(A_structure),
|
29 |
Batoms3D=structure_ato_list(B_structure),
|
30 |
+
dim=(10, 10), optimize_angle=True, optimize_strain=True,)
|
31 |
|
32 |
|
33 |
print(min_supercel.Alat)
|
34 |
print(min_supercel.Blat)
|
35 |
+
new_structure = min_supercel.get_new_structure( dist=[0,0,0.1])
|
36 |
|
37 |
|
38 |
|
app.py
CHANGED
@@ -18,7 +18,7 @@ with gr.Blocks() as latmatcher:
|
|
18 |
example_file_b = gr.File(label="example file:",value="EXAMPLES/2C-1.xyz" )
|
19 |
file_material_b = gr.File(label="material B file", )
|
20 |
|
21 |
-
max_angle = gr.Slider(0, 180, label=" min Angle:", step=1, value=
|
22 |
max_strain = gr.Slider(0, 1, label=" max Strain:", step=0.05)
|
23 |
inter_distance = gr.Slider(-0.05, 10, label=" Inter-layer distance:",info="If set to -0.05 is computed automatically.", step=0.05)
|
24 |
|
|
|
18 |
example_file_b = gr.File(label="example file:",value="EXAMPLES/2C-1.xyz" )
|
19 |
file_material_b = gr.File(label="material B file", )
|
20 |
|
21 |
+
max_angle = gr.Slider(0, 180, label=" min Angle:", step=1, value=5)
|
22 |
max_strain = gr.Slider(0, 1, label=" max Strain:", step=0.05)
|
23 |
inter_distance = gr.Slider(-0.05, 10, label=" Inter-layer distance:",info="If set to -0.05 is computed automatically.", step=0.05)
|
24 |
|
backend/__pycache__/__init__.cpython-310.pyc
CHANGED
Binary files a/backend/__pycache__/__init__.cpython-310.pyc and b/backend/__pycache__/__init__.cpython-310.pyc differ
|
|
backend/__pycache__/__init__.cpython-38.pyc
ADDED
Binary file (156 Bytes). View file
|
|
backend/db_utils/__pycache__/__init__.cpython-310.pyc
CHANGED
Binary files a/backend/db_utils/__pycache__/__init__.cpython-310.pyc and b/backend/db_utils/__pycache__/__init__.cpython-310.pyc differ
|
|
backend/db_utils/__pycache__/parse_c2db.cpython-310.pyc
CHANGED
Binary files a/backend/db_utils/__pycache__/parse_c2db.cpython-310.pyc and b/backend/db_utils/__pycache__/parse_c2db.cpython-310.pyc differ
|
|
backend/db_utils/__pycache__/parse_jarvis.cpython-310.pyc
CHANGED
Binary files a/backend/db_utils/__pycache__/parse_jarvis.cpython-310.pyc and b/backend/db_utils/__pycache__/parse_jarvis.cpython-310.pyc differ
|
|
backend/db_utils/__pycache__/structure_database.cpython-310.pyc
CHANGED
Binary files a/backend/db_utils/__pycache__/structure_database.cpython-310.pyc and b/backend/db_utils/__pycache__/structure_database.cpython-310.pyc differ
|
|
backend/db_utils/__pycache__/structure_propriety.cpython-310.pyc
CHANGED
Binary files a/backend/db_utils/__pycache__/structure_propriety.cpython-310.pyc and b/backend/db_utils/__pycache__/structure_propriety.cpython-310.pyc differ
|
|
backend/db_utils/__pycache__/utils.cpython-310.pyc
CHANGED
Binary files a/backend/db_utils/__pycache__/utils.cpython-310.pyc and b/backend/db_utils/__pycache__/utils.cpython-310.pyc differ
|
|
backend/db_utils/vasp_utils/__pycache__/__init__.cpython-310.pyc
CHANGED
Binary files a/backend/db_utils/vasp_utils/__pycache__/__init__.cpython-310.pyc and b/backend/db_utils/vasp_utils/__pycache__/__init__.cpython-310.pyc differ
|
|
backend/db_utils/vasp_utils/__pycache__/band_structure.cpython-310.pyc
CHANGED
Binary files a/backend/db_utils/vasp_utils/__pycache__/band_structure.cpython-310.pyc and b/backend/db_utils/vasp_utils/__pycache__/band_structure.cpython-310.pyc differ
|
|
backend/latmathcher/__pycache__/__init__.cpython-310.pyc
CHANGED
Binary files a/backend/latmathcher/__pycache__/__init__.cpython-310.pyc and b/backend/latmathcher/__pycache__/__init__.cpython-310.pyc differ
|
|
backend/latmathcher/__pycache__/__init__.cpython-38.pyc
ADDED
Binary file (332 Bytes). View file
|
|
backend/latmathcher/__pycache__/geometry.cpython-310.pyc
CHANGED
Binary files a/backend/latmathcher/__pycache__/geometry.cpython-310.pyc and b/backend/latmathcher/__pycache__/geometry.cpython-310.pyc differ
|
|
backend/latmathcher/__pycache__/geometry.cpython-38.pyc
ADDED
Binary file (1.94 kB). View file
|
|
backend/latmathcher/__pycache__/latmatcher.cpython-310.pyc
ADDED
Binary file (5.47 kB). View file
|
|
backend/latmathcher/__pycache__/latmatcher.cpython-38.pyc
ADDED
Binary file (5.5 kB). View file
|
|
backend/latmathcher/__pycache__/pipeline.cpython-310.pyc
ADDED
Binary file (6.61 kB). View file
|
|
backend/latmathcher/__pycache__/pipeline.cpython-38.pyc
ADDED
Binary file (6.62 kB). View file
|
|
backend/latmathcher/__pycache__/plots.cpython-310.pyc
CHANGED
Binary files a/backend/latmathcher/__pycache__/plots.cpython-310.pyc and b/backend/latmathcher/__pycache__/plots.cpython-310.pyc differ
|
|
backend/latmathcher/__pycache__/utils.cpython-310.pyc
ADDED
Binary file (682 Bytes). View file
|
|
interface_connection/latmatcher_interface.py
CHANGED
@@ -82,6 +82,7 @@ def compute_supercell_a(file_material_a, file_material_b,inter_distance , max_an
|
|
82 |
B_cell=B_structure["cell"]
|
83 |
|
84 |
inter_distance=[0,0,inter_distance]
|
|
|
85 |
super_xyz, min_supercel, new_structure= compute_supercell(A_cell, B_cell, A_structure, B_structure, inter_distance,
|
86 |
max_angle, max_strain )
|
87 |
rez=min_supercel.rez
|
@@ -107,8 +108,9 @@ def compute_supercell_a(file_material_a, file_material_b,inter_distance , max_an
|
|
107 |
atoms= atoms_to_greed(super_xyz, lat_v=min_supercel.sc_vec3, dim=(3,3,0))
|
108 |
xyz_content_dd=generate_xyz_text(atoms)
|
109 |
|
|
|
110 |
plot=plot_supercel(super_xyz, min_supercel)
|
111 |
-
return file12, str(rez[
|
112 |
|
113 |
def compute_supercell_b():
|
114 |
pass
|
@@ -137,8 +139,8 @@ def plot_supercel(super_xyz, min_supercel):
|
|
137 |
y = [0.0, min_supercel.sc_vec3[1][0], min_supercel.sc_vec3[1][0] + min_supercel.sc_vec3[1][1],
|
138 |
min_supercel.sc_vec3[1][1], 0.0]
|
139 |
plt.gca().add_patch(patches.Polygon(xy=list(zip(x, y)), fill=True, alpha=0.4, color="green"))
|
140 |
-
plt.ylim(min(y)*3, max(y)*3)
|
141 |
-
plt.xlim(min(x)*3, max(x)*3)
|
142 |
# super_a = [super_xyz[i] for i in range(len(new_structure["host_guest"])) if
|
143 |
# new_structure["host_guest"][i] == "host"]
|
144 |
# super_b = [super_xyz[i] for i in range(len(new_structure["host_guest"])) if
|
|
|
82 |
B_cell=B_structure["cell"]
|
83 |
|
84 |
inter_distance=[0,0,inter_distance]
|
85 |
+
|
86 |
super_xyz, min_supercel, new_structure= compute_supercell(A_cell, B_cell, A_structure, B_structure, inter_distance,
|
87 |
max_angle, max_strain )
|
88 |
rez=min_supercel.rez
|
|
|
108 |
atoms= atoms_to_greed(super_xyz, lat_v=min_supercel.sc_vec3, dim=(3,3,0))
|
109 |
xyz_content_dd=generate_xyz_text(atoms)
|
110 |
|
111 |
+
# plot_atom_list(atoms, marker=".")
|
112 |
plot=plot_supercel(super_xyz, min_supercel)
|
113 |
+
return file12, str(rez[2]), str((rez[0], rez[1])),plot, xyz_content_dd
|
114 |
|
115 |
def compute_supercell_b():
|
116 |
pass
|
|
|
139 |
y = [0.0, min_supercel.sc_vec3[1][0], min_supercel.sc_vec3[1][0] + min_supercel.sc_vec3[1][1],
|
140 |
min_supercel.sc_vec3[1][1], 0.0]
|
141 |
plt.gca().add_patch(patches.Polygon(xy=list(zip(x, y)), fill=True, alpha=0.4, color="green"))
|
142 |
+
plt.ylim(min(y)*3+1, max(y)*3+1)
|
143 |
+
plt.xlim(min(x)*3+1, max(x)*3+1)
|
144 |
# super_a = [super_xyz[i] for i in range(len(new_structure["host_guest"])) if
|
145 |
# new_structure["host_guest"][i] == "host"]
|
146 |
# super_b = [super_xyz[i] for i in range(len(new_structure["host_guest"])) if
|