mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-08-25 13:41:50 +02:00
Avoid duplicated geometries on export (#8)
* Fix broken link * Fix bug in indexDB * Fix sourceFile for each geometry * Replaces Array by Set in exportGeoms to avoid duplicates Co-authored-by: Mickaël Véril <mveril@irsamc.ups-tlse.fr>
This commit is contained in:
parent
4baaaa0fc2
commit
605d20492c
@ -713,13 +713,13 @@ draft: false
|
||||
const molecule =geom.parseMetadata().molecule
|
||||
if (mols.has(molecule)) {
|
||||
if (!geomDic.has(molecule)) {
|
||||
geomDic.set(molecule,[])
|
||||
geomDic.set(molecule,new Set())
|
||||
}
|
||||
geomDic.get(molecule).push(geom.toXYZ())
|
||||
geomDic.get(molecule).add(geom.toXYZ())
|
||||
}
|
||||
}
|
||||
for (const [molecule,geometries] of geomDic) {
|
||||
const xyz=geometries.join("\n\n")
|
||||
const xyz=Array.from(geometries).join("\n\n")
|
||||
var blob=new Blob([xyz],{type: 'chemical/x-xyz'})
|
||||
zip.file(`${mhchemCE.extract(molecule).toLowerCase().replace(" ","_")}.xyz`,blob)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user