diff --git a/content/dataset.html b/content/dataset.html index 91b41355..31b7b07d 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) } }) @@ -189,8 +189,7 @@ draft: false if (!isLast) { await reloadSelect(afters.prop("name")) } - const fillArray = ["molecule"] - if (fillArray.includes(afters.prop("name"))) { + if (afters.prop("name") ==="molecule"){ selectSelectAll(afters.first()) } } @@ -291,13 +290,14 @@ 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; } } async function reloadStat() { + const publis = await publiDB.loadAsync() processingIndicator.isActive = true var stb = $("#stat_table > tbody") $("#graph_div").empty() @@ -306,10 +306,12 @@ 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) + const SetName = publis.findSetNameFromDOI(doi,true) if (!(sdatdic.has(key))) { sdatdic.set(key, new Map()) } - const myT1s = T1ref.get(d.DOI == null ? "" : d.DOI.string).get(d.molecule) + const myT1s = T1ref.get(SetName).get(d.molecule) for (const exc of d.excitations) { var allowT1 = false const T1Key = JSON.stringify((exc.initial, exc.final)) @@ -322,7 +324,7 @@ draft: false allowT1 = true } } - const key2 = JSON.stringify([d.molecule, exc.initial, exc.final, exc.cVertExcitationKind]) + const key2 = JSON.stringify([d.molecule, exc.initial, exc.final, exc.VertExcitationKind]) const keydic = sdatdic.get(key) if ((!exc.isUnsafe || window.filterParams.unsafe) && ((exc.type & window.filterParams.exType) !== 0) && ((exc.VertExcitationKind & window.filterParams.exVertKind) !== 0) && allowT1) { if (!(keydic.has(key2))) { @@ -406,6 +408,7 @@ draft: false } } doiCache.clear() + const publis = await publiDB.loadAsync() processingIndicator.isActive = true window.filtData = window.dats getAllSelect().each(function () { @@ -420,14 +423,15 @@ 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) { - window.T1ref.set(doi, new Map()) + const setName = publis.findSetNameFromDOI(doi,true) + window.T1ref.set(setName, new Map()) for (const mol of mols) { - window.T1ref.get(doi).set(mol, new Map()) - var TBESortdat = window.dats.filter(d => (d.DOI === null ? "" : d.DOI.string) === doi && d.molecule === mol).sort((d1, d2) => { + window.T1ref.get(setName).set(mol, new Map()) + 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) { @@ -445,13 +449,13 @@ draft: false }) if (TBESortdat.length > 0 && TBESortdat[0].method.isTBE) { for (const exc of TBESortdat[0].excitations) { - window.T1ref.get(doi).get(mol).set(JSON.stringify((exc.initial, exc.final)), exc.T1) + window.T1ref.get(setName).get(mol).set(JSON.stringify((exc.initial, exc.final)), exc.T1) } } } } $(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 = $("