10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-24 13:23:40 +01:00

Remove DOI class

This commit is contained in:
Mickaël Véril 2020-09-04 14:59:39 +02:00
parent e21750c8b0
commit 0b09a98713
3 changed files with 16 additions and 34 deletions

View File

@ -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 = $("<option/>", {
value: JSON.stringify(el)
}).text(el[0])
@ -474,7 +474,7 @@ draft: false
var CurrentsetName = undefined
for (const doi of doiCache.keys()) {
paperdata = window.filtData.filter((d) => {
return (d.DOI === null ? "" : d.DOI.string) == doi
return (d.DOI === null ? "" : d.DOI) == doi
})
var methods = uniq(paperdata.map(d => d.method))
const sortedMethods = methods.sort((a, b) => {
@ -515,7 +515,7 @@ draft: false
adjustSticky();
datadic = new Map()
for (const dat of paperdata) {
const doi = (dat.DOI == null ? "" : dat.DOI.string)
const doi = (dat.DOI == null ? "" : dat.DOI)
const setName = publis.findSetNameFromDOI(doi)
const key1 = dat.molecule;
const myT1s = T1ref.get(setName).get(dat.molecule)

View File

@ -20,7 +20,7 @@ draft: false
window.onload = async function () {
var div = document.getElementById("publis_div")
const Cite = require("citation-js")
const sdois = uniq(Object.values(await loadAllData()).flat().filter(d => d.DOI !== null).map(d => d.DOI.string))
const sdois = uniq(Object.values(await loadAllData()).flat().filter(d => d.DOI !== null).map(d => d.DOI))
const spubliscite = await Cite.async(sdois)
const uospublis = spubliscite.format('data', { format: 'object' })
const spublis = uospublis.sort((puba, pubb) => pubUtils.getIssuedDate(puba) - pubUtils.getIssuedDate(pubb))

View File

@ -115,24 +115,6 @@ class state {
return tex;
};
}
class DOI {
constructor(doistring) {
this.string = doistring
};
static fromString(str) {
return new DOI(str)
}
toString() {
var str = this.string;
if (this.IsSupporting) {
str += " " + "(SI)"
}
return str
};
get url() {
return new URL(this.string, 'https://doi.org').toString()
}
}
class excitationBase {
constructor(initial, final, type = '', T1 = null) {
@ -247,7 +229,7 @@ class dataFileBase {
this.method = method.fromString(value)
break;
case "doi":
this.DOI = DOI.fromString(value);
this.DOI = value
break;
}
}
@ -320,7 +302,7 @@ class dataFileBase {
}
});
console.assert(double.length === 0, "Double found", double, dat.molecule, dat.method.toString())
if (dat.DOI!== null && dat.DOI.string !== "10.1021/acs.jctc.8b01205") {
if (dat.DOI!== null && dat.DOI !== "10.1021/acs.jctc.8b01205") {
for (const ex of dat.excitations) {
console.assert(Number.isNaN(ex.T1.valueOf()) | ex.T1 > 50 | ex.isUnsafe == true, "Must be unsafe", dat, ex)
}