diff --git a/wetb/prepost/Simulations.py b/wetb/prepost/Simulations.py index ae64512c9c80d489a75c427ee6a8104bdd9e9526..cad98acd013e3a662db1d2b0acd72995807d6c01 100755 --- a/wetb/prepost/Simulations.py +++ b/wetb/prepost/Simulations.py @@ -1118,7 +1118,7 @@ def post_launch(cases, save_iter=False, silent=False, suffix=None, # file. If it is a directory, it will check all that is in the dir run_dir = cases[k]['[run_dir]'] log_dir = cases[k]['[log_dir]'] - errorlogs.PathToLogs = os.path.join(run_dir, log_dir, kk) + errorlogs.PathToLogs = os.path.join(run_dir, log_dir) try: errorlogs.check(save_iter=save_iter) if not silent: @@ -1809,6 +1809,12 @@ class HtcMaster(object): htc = self.master_str + # FIXME: HAWC2 always outputs result and logfile in lower case, so + # force case_id/Case id. to be lower case + self.tags['[case_id]'] = self.tags['[case_id]'].lower() + if '[Case id.]' in self.tags: + self.tags['[Case id.]'] = self.tags['[Case id.]'].lower() + # and now replace all the tags in the htc master file # when iterating over a dict, it will give the key, given in the # corresponding format (string keys as strings, int keys as ints...) @@ -2626,7 +2632,8 @@ class PBS(object): run_dir = case['[run_dir]'] res_dir = case['[res_dir]'] log_dir = case['[log_dir]'] - cname_ = cname.replace('.htc', '') + # FIXME: HAWC2 outputs result and logfile always in lower cases + cname_ = cname.replace('.htc', '').lower() f_log = os.path.join(run_dir, log_dir, cname_) f_res = os.path.join(run_dir, res_dir, cname_) if not os.path.exists(f_log + '.log'): @@ -2729,14 +2736,13 @@ class ErrorLogs(windIO.LogFile): # walk trough the files present in the folder path for fname in FileList[0][2]: - fname_lower = fname.lower() # progress indicator if NrFiles > 1: if not self.silent: print('progress: ' + str(i) + '/' + str(NrFiles)) # open the current log file - f_log = os.path.join(self.PathToLogs, str(fname_lower)) + f_log = os.path.join(self.PathToLogs, fname) if self.cases is not None: case = self.cases[fname.replace('.log', '.htc')] @@ -3615,7 +3621,7 @@ class Cases(object): respath = os.path.join(case['[run_dir]'], case['[res_dir]']) resfile = case['[case_id]'] - self.res = windIO.LoadResults(respath, resfile) + self.res = windIO.LoadResults(respath, resfile.lower()) if not _slice: _slice = np.r_[0:len(self.res.sig)] self.time = self.res.sig[_slice,0] @@ -3677,12 +3683,6 @@ class Cases(object): #return cases - def force_lower_case_id(self): - tmp_cases = {} - for cname, case in self.cases.items(): - tmp_cases[cname.lower()] = case.copy() - self.cases = tmp_cases - def _get_cases_dict(self, post_dir, sim_id): """ Load the pickled dictionary containing all the cases and their @@ -3699,8 +3699,6 @@ class Cases(object): self.cases = load_pickled_file(os.path.join(post_dir, sim_id + '.pkl')) self.cases_fail = {} - self.force_lower_case_id() - if self.rem_failed: try: self.load_failed(sim_id) diff --git a/wetb/prepost/dlctemplate.py b/wetb/prepost/dlctemplate.py index a1621cd396b58bd0a5ea41957b92fc327204f03d..fdc21f63a0b024f5abc6ef294c35683eccef59e1 100755 --- a/wetb/prepost/dlctemplate.py +++ b/wetb/prepost/dlctemplate.py @@ -279,7 +279,6 @@ def post_launch(sim_id, statistics=True, rem_failed=True, check_logs=True, config['Weibull']['Vref'] = 50 config['nn_shaft'] = 4 cc = sim.Cases(POST_DIR, sim_id, rem_failed=rem_failed, config=config) - cc.force_lower_case_id() if force_dir: for case in cc.cases: