Skip to content

Commit c1469d1

Browse files
committed
Git merge complete
1 parent b0dd462 commit c1469d1

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

mcse/io/write.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from ase.data import vdw_radii,atomic_numbers,covalent_radii,chemical_symbols
1616

1717
from mcse import Structure
18-
from mcse.io.check import mcse_ext
18+
from mcse.io.check import mcse_ext,extension2format,format2extension
1919

2020
# Acceptable file formats listed here
2121
ase_file_formats = [x for x in ase_all_formats.keys()]
@@ -156,7 +156,7 @@ def wrapper_write_struct(path, struct, file_format='json', overwrite=False):
156156
elif file_format == 'geometry' or \
157157
file_format == 'geo' or \
158158
file_format == 'aims':
159-
output_geo(path, struct, overwrite=overwrite)
159+
output_ase(path, struct, file_format="aims", overwrite=overwrite)
160160
elif file_format == "torch":
161161
output_torch(path, struct, overwrite=overwrite)
162162
else:
@@ -184,18 +184,6 @@ def output_struct(file_path, struct, overwrite=False):
184184
check_overwrite(file_path, overwrite=overwrite)
185185
with open(file_path,'w') as f:
186186
f.write(struct.dumps())
187-
188-
189-
def output_geo(file_path, struct, overwrite=False):
190-
"""
191-
Output Structure as FHI-aims geometry file using built in functionality.
192-
"""
193-
# Fix file path with in extension
194-
file_path = file_ext(file_path, "in")
195-
# Checking overwrite
196-
check_overwrite(file_path, overwrite=overwrite)
197-
with open(file_path,'w') as f:
198-
f.write(struct.get_aims())
199187

200188

201189
def output_ase(file_path, struct, file_format, overwrite=False):
@@ -249,6 +237,11 @@ def file_ext(file_path, file_ext):
249237
## Otherwise, don't know how to handle file ext
250238
## so do nothing
251239
pass
240+
241+
### Check that the given file_ext is formatted properly
242+
if file_ext not in extension2format:
243+
if file_ext in format2extension:
244+
file_ext = format2extension[file_ext]
252245

253246
# Add specified file extension
254247
file_name = file_name + "."+ file_ext

mcse/molecules/unique.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ def unique_by_rmsd(struct_dict, tol=0.1):
157157
for j in range(i+1,num_mol):
158158
molecule_0 = molecule_struct_list[i]
159159
molecule_1 = molecule_struct_list[j]
160-
_,_,_,temp_rmsd = rmsd(molecule_0, molecule_1)
160+
if molecule_0.formula != molecule_1.formula:
161+
temp_rmsd = 100
162+
else:
163+
_,_,_,temp_rmsd = rmsd(molecule_0, molecule_1)
161164
difference_matrix[i,j] = temp_rmsd
162165
difference_matrix[j,i] = temp_rmsd
163166

0 commit comments

Comments
 (0)