diff --git a/content/dataset.html b/content/dataset.html
index 9c72af9c..4716fab5 100644
--- a/content/dataset.html
+++ b/content/dataset.html
@@ -112,6 +112,7 @@ draft: false
for (mol of uniq(subset.map(d => d.molecule))) {
const submol = subset.filter(d => d.molecule === mol)
const source = await submol.findAsync(async (d) => {
+// const source = submol.find((d) => {
if (db.sets.get(d.set.name)[d.set.index] === "10.1021/acs.jctc.8b01205") {
return d.method.name === "CASPT2" && d.method.basis === "aug-cc-pVDZ"
} else {
diff --git a/static/js/data.js b/static/js/data.js
index f711d035..7b1d9e6a 100644
--- a/static/js/data.js
+++ b/static/js/data.js
@@ -279,9 +279,9 @@ class dataFileBase {
switch (trueTypeOf(file)) {
case String.name:
file = getFullDataPath(file)
- const maxAge= (DebugMode.Enabled,0,600)
+ // const maxAge= (DebugMode.Enabled,0,600)
// var str = await getTextFromFileUrlAsync(file,{"Cache-Control":`max-age=${maxAge}`})
- var str = await getTextFromFileUrl(file)
+ var str = await getTextFromFileUrl(file) //TODO
break;
case File.name:
var str = await getTextFromUploadedFileAsync(file)
@@ -291,6 +291,20 @@ class dataFileBase {
dat.sourceFile = new websiteFile(file)
return dat
}
+ static load(file, kind = undefined) {
+ switch (trueTypeOf(file)) {
+ case String.name:
+ file = getFullDataPath(file)
+ var str = getTextFromFileUrl(file)
+ break;
+ case File.name:
+ var str = (async () => await getTextFromUploadedFileAsync(file))().then(x=>x)
+ break
+ }
+ var dat = this.loadString(str, kind);
+ dat.sourceFile = new websiteFile(file)
+ return dat
+ }
_OnReadMetaPair(key, value) {
switch (key) {
case "molecule":
diff --git a/static/js/loadAllData.js b/static/js/loadAllData.js
index afc0d766..94158493 100644
--- a/static/js/loadAllData.js
+++ b/static/js/loadAllData.js
@@ -4,9 +4,11 @@ async function loadAllData() {
fluo: [],
};
for (const f of getAbsFilesName()) {
+// dic.abs.push(VertDataFile.load(f,VertExcitationKinds.Absorbtion))
dic.abs.push(await VertDataFile.loadAsync(f,VertExcitationKinds.Absorbtion))
}
for (const f of getFluoFilesName()) {
+// dic.fluo.push(VertDataFile.load(f,VertExcitationKinds.Fluorescence))
dic.fluo.push(await VertDataFile.loadAsync(f,VertExcitationKinds.Fluorescence))
}
return dic;
diff --git a/static/js/uniq.js b/static/js/uniq.js
index d492b157..9c69bf9c 100644
--- a/static/js/uniq.js
+++ b/static/js/uniq.js
@@ -1,8 +1,11 @@
function uniq(array)
{
- return uniqueArray = array.filter((obj1,index) => {
- return index === array.findIndex(obj2 => {
- return JSON.stringify(obj1) === JSON.stringify(obj2);
- });
- });
-}
\ No newline at end of file
+ if (array.length == 0) return [];
+ var sortedArray = array.sort().map( x => [x, JSON.stringify(x)] );
+ var uniqueArray = [ sortedArray[0][0] ];
+ for (let i=1 ; i