Changeset 2849 for TOOLS/ConsoGENCMIP6/bin
- Timestamp:
- 05/12/16 16:43:10 (8 years ago)
- Location:
- TOOLS/ConsoGENCMIP6/bin
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/ConsoGENCMIP6/bin/plot_bilan.py
r2717 r2849 46 46 skip_header=1, 47 47 converters={ 48 0: string_to_date, 49 1: string_to_float, 50 2: string_to_percent, 51 3: string_to_percent, 52 4: string_to_float, 53 5: string_to_float, 54 6: string_to_float, 55 7: string_to_float, 48 0: string_to_date, 49 1: string_to_float, 50 2: string_to_percent, 51 3: string_to_percent, 52 4: string_to_float, 53 5: string_to_float, 54 6: string_to_float, 55 7: string_to_float, 56 8: string_to_float, 57 9: string_to_float, 58 10: string_to_float, 59 11: string_to_float, 56 60 }, 57 61 missing_values="nan", … … 62 66 63 67 for date, conso, real_use, theo_use, \ 64 run_mean, pen_mean, run_std, pen_std in data: 68 run_mean, pen_mean, run_std, pen_std, \ 69 _, _, _, _ in data: 65 70 if date in self: 66 71 self.add_item( -
TOOLS/ConsoGENCMIP6/bin/plot_bilan_jobs.py
r2717 r2849 46 46 skip_header=1, 47 47 converters={ 48 0: string_to_date, 49 1: string_to_float, 50 2: string_to_percent, 51 3: string_to_percent, 52 4: string_to_float, 53 5: string_to_float, 54 6: string_to_float, 55 7: string_to_float, 48 0: string_to_date, 49 1: string_to_float, 50 2: string_to_percent, 51 3: string_to_percent, 52 4: string_to_float, 53 5: string_to_float, 54 6: string_to_float, 55 7: string_to_float, 56 8: string_to_float, 57 9: string_to_float, 58 10: string_to_float, 59 11: string_to_float, 56 60 }, 57 61 missing_values="nan", … … 62 66 63 67 for date, conso, real_use, theo_use, \ 64 run_mean, pen_mean, run_std, pen_std in data: 68 run_mean, pen_mean, run_std, pen_std, \ 69 _, _, _, _ in data: 65 70 if date in self: 66 71 self.add_item( -
TOOLS/ConsoGENCMIP6/bin/plot_jobs.py
r2717 r2849 196 196 label="jobs running" 197 197 ) 198 if args.mode == "machine": 199 label = "jobs pending\n(Ressources & Priority)" 200 else: 201 label = "jobs pending" 198 202 ax.bar( 199 203 xcoord, pen_jobs, bottom=run_jobs, width=width, 200 204 linewidth=line_width, align="center", 201 205 color="firebrick", antialiased=True, 202 label="jobs pending" 203 ) 204 # ax.step( 205 # xcoord, run_jobs, where="mid", 206 # linewidth=1, color="black", label="jobs running" 207 # ) 208 # ax.step( 209 # xcoord, pen_jobs+run_jobs, where="mid", 210 # linewidth=1, color="black", label="jobs running" 211 # ) 206 label=label 207 ) 212 208 213 209 … … 223 219 # ---------------------------- 224 220 multialloc = False 225 if conso_per_day_2: 226 date_inter = projet.date_init + dt.timedelta(days=projet.days//2) 227 if projet.date_init in dates: 228 xi = dates.index(projet.date_init) 229 else: 230 xi = 0 231 232 if projet.deadline in dates: 233 xf = dates.index(projet.deadline) 234 else: 235 xf = len(dates) 236 237 if date_inter in dates: 238 xn = dates.index(date_inter) 239 yi = conso_per_day 240 yf = conso_per_day_2 241 multialloc = True 242 else: 243 if dates[-1] < date_inter: 244 xn = xf 221 222 if args.mode == "machine": 223 xi = 0 224 xn = xi 225 xf = len(dates) 226 yi = 80000. 227 yf = yi 228 else: 229 if conso_per_day_2: 230 date_inter = projet.date_init + dt.timedelta(days=projet.days//2) 231 if projet.date_init in dates: 232 xi = dates.index(projet.date_init) 233 else: 234 xi = 0 235 236 if projet.deadline in dates: 237 xf = dates.index(projet.deadline) 238 else: 239 xf = len(dates) 240 241 if date_inter in dates: 242 xn = dates.index(date_inter) 245 243 yi = conso_per_day 246 yf = conso_per_day247 elif dates[0] > date_inter:248 xn = xi249 yi = conso_per_day_2250 244 yf = conso_per_day_2 245 multialloc = True 246 else: 247 if dates[-1] < date_inter: 248 xn = xf 249 yi = conso_per_day 250 yf = conso_per_day 251 elif dates[0] > date_inter: 252 xn = xi 253 yi = conso_per_day_2 254 yf = conso_per_day_2 251 255 252 256 # ... Config axes ... … … 294 298 295 299 yticks = list(ax.get_yticks()) 296 yticks.append(conso_per_day) 297 if multialloc: 298 yticks.append(conso_per_day_2) 300 if args.mode == "machine": 301 yticks.append(yi) 302 else: 303 yticks.append(conso_per_day) 304 if multialloc: 305 yticks.append(conso_per_day_2) 299 306 ax.set_yticks(yticks) 300 301 307 302 308 for x, d in zip(xcoord, dates): … … 339 345 parser.add_argument("-d", "--dods", action="store_true", 340 346 help="copy output on dods") 347 parser.add_argument("-m", "--mode", action="store", 348 choices=["project", "machine"], 349 default="project", 350 help="copy output on dods") 341 351 342 352 return parser.parse_args() … … 375 385 get_input_files(DIR["SAVEDATA"], [OUT["PARAM"], OUT["UTHEO"]]) 376 386 377 file_list = glob.glob(os.path.join(DIR["SAVEDATA"], 378 "OUT_JOBS_PENDING_*")) 379 380 img_name = "jobs" 387 if args.mode == "project": 388 pattern = "OUT_JOBS_PENDING_" 389 else: 390 pattern = "OUT_JOBS_PEN_FULL_" 391 file_list = glob.glob( 392 os.path.join(DIR["SAVEDATA"], pattern + "*") 393 ) 394 395 img_name = "jobs_{}".format(args.mode) 381 396 382 397 today = dt.datetime.today()
Note: See TracChangeset
for help on using the changeset viewer.