From 605d20492c69dbff185b6c0ad71a25e2176fe1d7 Mon Sep 17 00:00:00 2001 From: mveril Date: Mon, 7 Dec 2020 15:41:39 +0100 Subject: [PATCH] Avoid duplicated geometries on export (#8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- content/dataset.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/dataset.html b/content/dataset.html index 7868eb96..fae5d552 100644 --- a/content/dataset.html +++ b/content/dataset.html @@ -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) }