Skip to content

Commit

Permalink
Revert "fix: add modelconfiguration to zipfile"
Browse files Browse the repository at this point in the history
This reverts commit 8b5e9c9.
  • Loading branch information
mosoriob committed Feb 29, 2020
1 parent d2f4d23 commit df9f826
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/classes/localex/local-execution-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,14 @@ const _downloadAndUnzipToDirectory = (url: string, modeldir: string, compname: s
});
}

const _downloadWCM = async (url: string, model: Model, prefs: MintPreferences) => {
// Get the name of the model configuration
let model_configuation = Model.model_configuration
const _downloadWCM = async (url: string, prefs: MintPreferences) => {
// Get zip file name from url
let plainurl = url.replace(/\?.*$/, '');
let zipfile = plainurl.replace(/.+\//, "");
let compname = zipfile.replace(/\.zip/i, "");

let codedir = prefs.localex.codedir;
let modeldir = codedir + "/" + model_configuration + "_" + compname;
let modeldir = codedir + "/" + compname;
if(!fs.existsSync(modeldir + "/src")) {
await _downloadAndUnzipToDirectory(url, modeldir, compname);
}
Expand Down Expand Up @@ -201,7 +199,7 @@ export const getModelCacheDirectory = (url: string, prefs: MintPreferences) => {
}

export const loadModelWCM = async(url: string, model: Model, prefs: MintPreferences) => {
let modeldir = await _downloadWCM(url, model, prefs);
let modeldir = await _downloadWCM(url, prefs);
let details = _getModelDetails(model, modeldir);
// If we cannot get the details from just the model cache, then try to get it from the yaml
if(!details) {
Expand Down Expand Up @@ -432,4 +430,4 @@ export const runModelEnsemblesLocally =
export const fetchLocalRunLog = (ensembleid:string, prefs: MintPreferences) => {
let logstdout = prefs.localex.logdir + "/" + ensembleid + ".log";
return fs.readFileSync(logstdout).toString();
}
}

0 comments on commit df9f826

Please # to comment.