Changeset 2433


Ignore:
Timestamp:
03/05/15 11:55:57 (9 years ago)
Author:
labetoulle
Message:

cleaning

Location:
TOOLS/ConsoGENCMIP6
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/ConsoGENCMIP6/bin/conso_gencmip6.py

    r2426 r2433  
    391391 
    392392  exit(0) 
     393 
  • TOOLS/ConsoGENCMIP6/bin/gencmip6.py

    r2431 r2433  
    184184      missing_values="nan", 
    185185    ) 
    186     # print(data) 
    187     # print(type(data)) 
    188     # print(data.shape) 
    189     # print(data.size) 
    190186    dates, utheos = zip(*data) 
    191187 
     
    207203    else: 
    208204      self.date_init = dt.datetime(self.deadline.year, 1, 1) 
     205 
     206    delta = self.deadline - self.date_init 
     207    self.days = delta.days + 1 
    209208 
    210209 
     
    245244if __name__ == '__main__': 
    246245  pass 
     246 
  • TOOLS/ConsoGENCMIP6/bin/plot_bilan.py

    r2430 r2433  
    180180  ax_conso.bar(xcoord, consos, align="center", color="linen", 
    181181               linewidth=line_width, label="conso (heures)") 
    182   # ax_conso.plot(xcoord, conso_per_day, line_style, color="blue", 
    183   #               linewidth=1, markersize=8, alpha=0.5, 
    184   #               # solid_capstyle="round", solid_joinstyle="round", 
    185   #               label="conso journaliÚre idéale (heures)") 
    186   ax_conso.axhline(y=conso_per_day[0], color="blue", alpha=0.5, 
     182  ax_conso.axhline(y=conso_per_day, color="blue", alpha=0.5, 
    187183                   label="conso journaliÚre idéale (heures)") 
    188184 
     
    365361  consos    = np.array(consos, dtype=float) 
    366362 
    367   conso_per_day = np.array([gencmip6.alloc / nb_items 
    368                               for item in selected_items], dtype=float) 
     363  conso_per_day = gencmip6.alloc / gencmip6.days 
    369364 
    370365  theo_uses = np.array([100.*item.theo_use for item in selected_items], 
     
    418413 
    419414  exit(0) 
     415 
  • TOOLS/ConsoGENCMIP6/bin/plot_jobs.py

    r2431 r2433  
    166166 
    167167######################################## 
    168 def plot_data(ax, xcoord, xlabels, run_jobs, pen_jobs): 
     168def plot_data(ax, xcoord, xlabels, run_jobs, pen_jobs, conso_per_day): 
    169169  """ 
    170170  """ 
     171  line_width = 0. 
    171172 
    172173  ax.bar(xcoord, run_jobs, align="center", color="lightgreen", 
    173          linewidth=0.1, label="running jobs cores") 
     174         linewidth=line_width, label="jobs running") 
    174175  ax.bar(xcoord, pen_jobs, bottom=run_jobs, align="center", 
    175          color="indianred", linewidth=0.1, label="pending jobs cores") 
     176         color="indianred", linewidth=line_width, label="jobs pending") 
     177 
     178  ax.axhline(y=conso_per_day, color="blue", alpha=0.5, 
     179             label="conso journaliÚre idéale") 
    176180 
    177181 
     
    192196  xcoord_maj = [x for x, l in zip(xcoord, xlabels) 
    193197                   if l.hour == 0 or l.hour == 12] 
    194   xlabels_maj = ["{:%d-%m-%d %Hh}".format(l) for l in xlabels 
     198  xlabels_maj = ["{:%d-%m %Hh}".format(l) for l in xlabels 
    195199                 if l.hour == 0 or l.hour == 12] 
    196200  ax.set_xticks(xcoord, minor=True) 
     
    285289      full_data = np.append(full_data, values=data) 
    286290 
    287   # print(full_data) 
    288   # print(full_data.size) 
    289  
    290291  # .. Get project info .. 
    291292  # ====================== 
     
    324325 
    325326  xcoord   = np.linspace(1, nb_items, num=nb_items) 
    326   xlabels  = np.array([date for date, run, pen in full_data]) 
    327   # xlabels  = ["{:%d-%m-%d %H:%M}".format(date) 
    328   #             for date, run, pen in full_data] 
    329  
    330   run_jobs = np.array([run for date, run, pen in full_data], 
    331                         dtype=int) 
    332   pen_jobs = np.array([pen for date, run, pen in full_data], 
    333                         dtype=int) 
    334  
    335   print(xcoord, xlabels) 
    336   print(run_jobs) 
    337   print(pen_jobs) 
     327  if full_data.size > 1: 
     328    xlabels  = np.array([date for date, run, pen in full_data]) 
     329    run_jobs = np.array([run for date, run, pen in full_data], 
     330                          dtype=int) 
     331    pen_jobs = np.array([pen for date, run, pen in full_data], 
     332                          dtype=int) 
     333  else: 
     334    xlabels , run_jobs, pen_jobs = full_data.tolist() 
     335    xlabels = list(xlabels) 
     336    run_jobs = list(run_jobs ) 
     337    pen_jobs = list(pen_jobs ) 
    338338 
    339339  # cumul     = np.array([item.conso for item in selected_items], 
     
    344344  # consos    = np.array(consos, dtype=float) 
    345345 
    346   # conso_per_day = np.array([gencmip6.alloc / nb_items 
    347   #                             for item in selected_items], dtype=float) 
     346  conso_per_day = gencmip6.alloc / (gencmip6.days * 24.) 
    348347 
    349348  # theo_uses = np.array([100.*item.theo_use for item in selected_items], 
     
    362361  # ... Plot data ... 
    363362  # ----------------- 
    364   plot_data(ax, xcoord, xlabels, run_jobs, pen_jobs) 
     363  plot_data(ax, xcoord, xlabels, run_jobs, pen_jobs, conso_per_day) 
    365364 
    366365  # # ... Tweak figure ... 
     
    396395 
    397396  exit(0) 
     397 
  • TOOLS/ConsoGENCMIP6/bin/plot_login.py

    r2430 r2433  
    271271 
    272272  exit(0) 
     273 
  • TOOLS/ConsoGENCMIP6/bin/plot_store.py

    r2430 r2433  
    305305 
    306306  exit(0) 
     307 
  • TOOLS/ConsoGENCMIP6/launch_conso.sh

    r2429 r2433  
    7373 
    7474printf "\nEnd of script OK\n" 
     75 
Note: See TracChangeset for help on using the changeset viewer.