Andrei tomut commited on
Commit
a0c085b
1 Parent(s): a117bb5
app.py CHANGED
@@ -6,7 +6,7 @@ import gradio as gr
6
  from interface_connection import compute_supercell_a, compute_supercell_b
7
  with gr.Blocks() as latmatcher:
8
  gr.Markdown(
9
- "## LatMattcher.\n Please drop your XYZ files here to compute the minimum supercell.")
10
 
11
  with gr.Tabs():
12
  with gr.TabItem(label="file"):
 
6
  from interface_connection import compute_supercell_a, compute_supercell_b
7
  with gr.Blocks() as latmatcher:
8
  gr.Markdown(
9
+ "\n Please drop your XYZ files here to compute the minimum supercell.")
10
 
11
  with gr.Tabs():
12
  with gr.TabItem(label="file"):
interface_connection/latmatcher_interface.py CHANGED
@@ -43,8 +43,9 @@ def compute_supercell_a(file_material_a, file_material_b,inter_distance , max_an
43
  create_directory("DB/LatMatcher")
44
  new_directory = db_latmatcher_path + "/{}__ma{}__ms{}_on{}".format(ip, max_angle, max_strain,
45
  len(os.listdir(db_latmatcher_path)))
46
- if not os.path.exists(new_directory):
47
- os.makedirs(new_directory)
 
48
  path_to_move = new_directory
49
 
50
  file1 = process_file(file_material_a, path_to_move+"/")
@@ -100,13 +101,13 @@ def compute_supercell_a(file_material_a, file_material_b,inter_distance , max_an
100
 
101
 
102
  # Write the content to a file
103
- # with open(file12, 'w') as file:
104
- # file.write(xyz_content)
105
  atoms= atoms_to_greed(super_xyz, lat_v=min_supercel.sc_vec3, dim=(5,5,0))
106
- xyz_content=generate_xyz_text(atoms)
107
 
108
  plot=plot_supercel(super_xyz, min_supercel)
109
- return file12, str(rez[0]), str((rez[1], rez[2])),plot, xyz_content
110
 
111
  def compute_supercell_b():
112
  pass
 
43
  create_directory("DB/LatMatcher")
44
  new_directory = db_latmatcher_path + "/{}__ma{}__ms{}_on{}".format(ip, max_angle, max_strain,
45
  len(os.listdir(db_latmatcher_path)))
46
+ create_directory(new_directory)
47
+
48
+
49
  path_to_move = new_directory
50
 
51
  file1 = process_file(file_material_a, path_to_move+"/")
 
101
 
102
 
103
  # Write the content to a file
104
+ with open(file12, 'w') as file:
105
+ file.write(xyz_content)
106
  atoms= atoms_to_greed(super_xyz, lat_v=min_supercel.sc_vec3, dim=(5,5,0))
107
+ xyz_content_dd=generate_xyz_text(atoms)
108
 
109
  plot=plot_supercel(super_xyz, min_supercel)
110
+ return file12, str(rez[0]), str((rez[1], rez[2])),plot, xyz_content_dd
111
 
112
  def compute_supercell_b():
113
  pass