From 0b09a9871339e1b86f9233befd5ac51de782fc83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Fri, 4 Sep 2020 14:59:39 +0200 Subject: [PATCH] Remove DOI class --- content/dataset.html | 26 +++++++++++++------------- content/publications.html | 2 +- static/js/data.js | 22 ++-------------------- 3 files changed, 16 insertions(+), 34 deletions(-) diff --git a/content/dataset.html b/content/dataset.html index 24a0c1ea..0f8cd4e3 100644 --- a/content/dataset.html +++ b/content/dataset.html @@ -99,12 +99,12 @@ draft: false var data = await loadAllData() window.defaultDats = [] for (const sub of Object.values(data)) { - for (const doi of uniq(sub.map(d => (d.DOI == null ? "" : d.DOI.string)))) { - const subdoi = sub.filter(d => (d.DOI == null ? "" : d.DOI.string) === doi) + for (const doi of new Set(sub.map(d => d.DOI))) { + const subdoi = sub.filter(d => (d.DOI == null ? "" : d.DOI) === doi) for (mol of uniq(subdoi.map(d => d.molecule))) { const submol = subdoi.filter(d => d.molecule === mol) const source = submol.find((d) => { - if ((d.DOI == null ? "" : d.DOI.string) === "10.1021/acs.jctc.8b01205") { + if ((d.DOI == null ? "" : d.DOI) === "10.1021/acs.jctc.8b01205") { return d.method.name === "CASPT2" && d.method.basis === "aug-cc-pVDZ" } else { return d.method.isTBE @@ -120,7 +120,7 @@ draft: false window.defaultDats = window.defaultDats.concat(sub) } - await doiCache.addRange(Array.from(new Set(window.defaultDats.filter(d => d.DOI !== null).map(d => d.DOI.string)))) + await doiCache.addRange(Array.from(new Set(window.defaultDats.filter(d => d.DOI !== null).map(d => d.DOI)))) window.defaultDats = window.defaultDats.sort((datfa, datfb) => { const DOIa = datfa.DOI const DOIb = datfb.DOI @@ -134,8 +134,8 @@ draft: false return -1 } else { - const puba = doiCache.get(DOIa.string).format('data', { format: 'object' })[0] - const pubb = doiCache.get(DOIb.string).format('data', { format: 'object' })[0] + const puba = doiCache.get(DOIa).format('data', { format: 'object' })[0] + const pubb = doiCache.get(DOIb).format('data', { format: 'object' })[0] return pubUtils.getIssuedDate(puba) - pubUtils.getIssuedDate(pubb) } }) @@ -290,7 +290,7 @@ draft: false case "basis": return data.method.basis case "DOI": - return data.DOI === null ? "" : data.DOI.string + return data.DOI === null ? "" : data.DOI default: return data[name] break; @@ -306,7 +306,7 @@ draft: false var sdatdic = new Map() for (const d of window.filtData) { const key = JSON.stringify(d.method) - const doi = (d.DOI == null ? "" : d.DOI.string) + const doi = (d.DOI == null ? "" : d.DOI) const SetName = publis.findSetNameFromDOI(doi,true) if (!(sdatdic.has(key))) { sdatdic.set(key, new Map()) @@ -423,7 +423,7 @@ draft: false }) }) window.T1ref = new Map() - var dois = new Set(window.filtData.map((d) => d.DOI === null ? "" : d.DOI.string)) + var dois = new Set(window.filtData.map((d) => d.DOI === null ? "" : d.DOI)) var mols = new Set(window.filtData.map((d) => d.molecule)) await window.doiCache.addRange(dois) for (const doi of dois) { @@ -431,7 +431,7 @@ draft: false window.T1ref.set(setName, new Map()) for (const mol of mols) { window.T1ref.get(setName).set(mol, new Map()) - var TBESortdat = window.dats.filter(d => (d.DOI === null ? "" : d.DOI.string) === doi && d.molecule === mol).sort((d1, d2) => { + var TBESortdat = window.dats.filter(d => (d.DOI === null ? "" : d.DOI) === doi && d.molecule === mol).sort((d1, d2) => { if (d1.method.isTBE && !d2.method.isTBE) { return -1 } else if (!d1.method.isTBE && d2.method.isTBE) { @@ -455,7 +455,7 @@ draft: false } } $(sel_ref).empty() - for (const el of uniq(window.filtData.map(d => [d.method, (d.DOI === null ? null : d.DOI.string)]))) { + for (const el of uniq(window.filtData.map(d => [d.method, (d.DOI === null ? null : d.DOI)]))) { op = $("