Changeset 2413 for TOOLS


Ignore:
Timestamp:
02/10/15 12:25:07 (9 years ago)
Author:
labetoulle
Message:

Move all scripts to the same dir to use common configuration files

Location:
TOOLS/ConsoGENCMIP6/bin
Files:
3 added
1 edited
8 moved

Legend:

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

    r2412 r2413  
    77# standard library imports 
    88from argparse import ArgumentParser 
     9import json 
     10import shutil 
     11import os 
    912import os.path 
    10 import shutil 
    11 import json 
    12  
    13  
    14 ######################################## 
    15 def parse_myproject(filename, project): 
    16  
     13import subprocess 
     14# import datetime as dt 
     15 
     16# Application library imports 
     17from gencmip6 import * 
     18from gencmip6_path import * 
     19 
     20 
     21######################################## 
     22def get_storedir(login): 
     23 
     24  command = ["ccc_home", "-A", "-u", login] 
     25  try : 
     26    res = subprocess.check_output(command) 
     27  except Exception as rc : 
     28    # print(rc) 
     29    res = None 
     30 
     31  return res 
     32 
     33 
     34######################################## 
     35def get_dirsize(dirname): 
     36 
     37  command = ["du", "-sbh", dirname] 
     38  try : 
     39    res = float(subprocess.check_output(command)) 
     40  except Exception as rc : 
     41    print(rc) 
     42    res = None 
     43 
     44  return res 
     45 
     46 
     47# ######################################## 
     48# def get_dirlist(dirname): 
     49 
     50 
     51#   return output 
     52 
     53 
     54######################################## 
     55def parse_myproject(filename): 
     56 
     57  project = {} 
     58  project["project"] = "gencmip6" 
    1759  logins  = {} 
     60 
     61  if where_we_run() == "curie": 
     62    try : 
     63      res = subprocess.check_output("ccc_myproject") 
     64    except Exception as rc : 
     65      print(rc) 
     66      exit() 
     67    with open(os.path.join(DIR["DATA"], OUT_CCCMP), "w") as fileout: 
     68      fileout.write(res) 
    1869 
    1970  with open(filename, "r") as filein: 
     
    2374      if project["project"] in ligne: 
    2475        today = ligne.split()[-1] 
     76        today = string_to_date(today) 
     77 
    2578        break 
    2679 
     
    2982      next(filein) 
    3083 
    31     # Login list 
     84    # Login list, until blank line 
    3285    for ligne in filein: 
    3386      if not ligne.strip(): 
     
    3689      logins[login] = float(conso) 
    3790 
    38     # Skip all the rest until we find total 
     91    # Skip until we find consumed time (hours) 
    3992    for ligne in filein: 
    4093      if "Total" in ligne: 
     
    4295        break 
    4396 
    44     # Skip all the rest until we find deadline 
     97    # Skip until we find allocated time (hours) 
    4598    for ligne in filein: 
    4699      if "Allocated" in ligne: 
     
    48101        break 
    49102 
    50     # Skip all the rest until we find deadline 
     103    # Skip until we find theoratical use (%) 
    51104    for ligne in filein: 
    52105      if "Suggested use at this time" in ligne: 
     
    54107        break 
    55108 
    56     # Skip all the rest until we find deadline 
     109    # Skip until we find real use (%) 
    57110    for ligne in filein: 
    58111      if "Real use at this time" in ligne: 
     
    60113        break 
    61114 
    62     # Skip all the rest until we find deadline 
     115    # Skip until we find deadline 
    63116    for ligne in filein: 
    64117      if "Project deadline" in ligne: 
     
    66119        break 
    67120 
    68   return today, total, utheo, ureal, logins 
     121  return project, logins, today, total, utheo, ureal 
    69122 
    70123 
     
    94147                 "theo_use(%)", 
    95148               ) 
    96   result_str = "{:10s} {:12.2f} {:11.2f} {:11.2f}\n".format( 
     149  result_str = "{:%Y-%m-%d} {:12.2f} {:11.2f} {:11.2f}\n".format( 
    97150                 today, 
    98151                 total, 
     
    124177                 "theo_use(%)", 
    125178               ) 
    126   result_str = "{:10s} {:11.2f}\n".format( 
     179  result_str = "{:%Y-%m-%d} {:11.2f}\n".format( 
    127180                 today, 
    128181                 utheo, 
     
    162215 
    163216    for key in sorted(logins): 
    164       result_str = "{:10s} {:10s} {:12.2f}\n".format( 
     217      result_str = "{:%Y-%m-%d} {:10s} {:12.2f}\n".format( 
    165218                     today, 
    166219                     key, 
     
    174227 
    175228######################################## 
    176 def write_store(filename): 
     229def write_store(filename, logins): 
    177230  """ 
    178231  volume cree sur STORE 
     
    182235  """ 
    183236 
    184   pass 
     237  items = (login for login, conso in logins.iteritems() 
     238                  if conso > 0.) 
     239 
     240  for login in items: 
     241    storedir = get_storedir(login) 
     242    if not storedir: 
     243      break 
     244    igcm_out = os.path.join(storedir, "IGCM_OUT") 
     245 
     246    for dirname in os.listdir(igcm_out): 
     247      print(dirname, get_dirsize(dirname)) 
    185248 
    186249 
     
    207270  if args.verbose: 
    208271    print(os.path.basename(__file__)) 
     272    print(where_we_run()) 
    209273    print(args) 
    210274 
    211   # Files and directories 
    212   # ===================== 
    213   LOCAL_DIR = os.path.join( 
    214     "/ccc", "cont003", "home", "dsm", "p86ipsl", "ConsoGENCMIP6", "output" 
    215     # "/home_local", "slipsl", "ConsoGENCMIP6", "output" 
    216   ) 
    217   SAVE_DIR  = os.path.join( 
    218     "/ccc", "work", "cont003", "dsm", "p86ipsl", "ConsoGENCMIP6", 
    219     # "/home_local", "slipsl", "ConsoGENCMIP6", "save" 
    220   ) 
     275  # # Files and directories 
     276  # # ===================== 
     277  # if where_we_run() == "curie": 
     278  #   LOCAL_DIR = os.path.join( 
     279  #     "/ccc", 
     280  #     "cont003", 
     281  #     "home", 
     282  #     "dsm", 
     283  #     "p86ipsl", 
     284  #     "ConsoGENCMIP6", 
     285  #     "output" 
     286  #   ) 
     287  #   SAVE_DIR  = os.path.join( 
     288  #     "/ccc", 
     289  #     "work", 
     290  #     "cont003", 
     291  #     "dsm", 
     292  #     "p86ipsl", 
     293  #     "ConsoGENCMIP6", 
     294  #   ) 
     295  # # elif where_we_run() == "ipsl": 
     296  # #   LOCAL_DIR = os.path.join( 
     297  # #     "/home_local", 
     298  # #     "slipsl", 
     299  # #     "ConsoGENCMIP6", 
     300  # #     "output" 
     301  # #   ) 
     302  # #   SAVE_DIR  = os.path.join( 
     303  # #     "/home_local", 
     304  # #     "slipsl", 
     305  # #     "ConsoGENCMIP6", 
     306  # #     "save" 
     307  # #   ) 
     308  # else: 
     309  #   LOCAL_DIR = os.path.join( 
     310  #     "..", 
     311  #     "output" 
     312  #   ) 
     313  #   SAVE_DIR  = os.path.join( 
     314  #     "..", 
     315  #     "save" 
     316  #   ) 
     317 
     318  # LOCAL_DIR = os.path.abspath(LOCAL_DIR) 
     319  # SAVE_DIR  = os.path.abspath(SAVE_DIR) 
    221320 
    222321  OUT_PARAM = "OUT_CONSO_PARAM" 
     
    225324  OUT_LOGIN = "OUT_CONSO_LOGIN" 
    226325  OUT_STORE = "OUT_CONSO_STORE" 
     326  OUT_CCCMP = "ccc_myproject.dat" 
    227327 
    228328  if args.verbose: 
    229     print(LOCAL_DIR) 
    230     print(SAVE_DIR) 
    231  
    232   ccc_myproject = "ccc_myproject.dat" 
    233  
    234   project = {} 
    235   project["project"] = "gencmip6" 
    236  
    237   (today, total, utheo, ureal, logins) = \ 
    238       parse_myproject( 
    239         os.path.join(LOCAL_DIR, ccc_myproject), 
    240         project 
    241       ) 
     329    # print(LOCAL_DIR) 
     330    # print(SAVE_DIR) 
     331    print(DIR["DATA"]) 
     332    print(DIR["SAVE"]) 
     333 
     334  (project, logins, today, total, utheo, ureal) = \ 
     335      parse_myproject(os.path.join(DIR["DATA"], OUT_CCCMP)) 
    242336 
    243337  if args.verbose: 
     
    251345  # 1- Parametres du projet 
    252346  # ----------------------- 
    253   write_param(os.path.join(LOCAL_DIR, OUT_PARAM), project) 
     347  write_param(os.path.join(DIR["DATA"], OUT_PARAM), project) 
    254348 
    255349  # 2- Conso totale par jour 
    256350  # ------------------------ 
    257351  write_bilan( 
    258     os.path.join(LOCAL_DIR, OUT_BILAN), 
     352    os.path.join(DIR["DATA"], OUT_BILAN), 
    259353    today, 
    260354    total, 
     
    265359  # 2b- Conso théorique par jour 
    266360  # ---------------------------- 
    267   write_utheo(os.path.join(LOCAL_DIR, OUT_UTHEO), today, utheo) 
     361  write_utheo(os.path.join(DIR["DATA"], OUT_UTHEO), today, utheo) 
    268362 
    269363  # 3- Conso par login (HOME) 
    270364  # ------------------------- 
    271   write_login(os.path.join(LOCAL_DIR, OUT_LOGIN), today, logins) 
     365  write_login(os.path.join(DIR["DATA"], OUT_LOGIN), today, logins) 
    272366 
    273367  # 4- volume cree sur STORE 
    274368  # ------------------------ 
    275   write_store(os.path.join(LOCAL_DIR, OUT_STORE)) 
     369  # if where_we_run() == "curie": 
     370  #   write_store(os.path.join(DIR["DATA"], OUT_STORE)) 
     371  write_store(os.path.join(DIR["DATA"], OUT_STORE), logins) 
    276372 
    277373  # Save files (on WORKDIR) 
    278374  # ======================= 
    279375  if not args.dryrun: 
    280     suffix = today.replace("-", "") 
     376    suffix = "{:%Y%m%d}".format(today) 
    281377    file_list = [ 
    282378      OUT_PARAM, 
     
    287383    ] 
    288384    for filename in file_list: 
    289       filein  = os.path.join(LOCAL_DIR, filename) 
     385      filein  = os.path.join(DIR["DATA"], filename) 
    290386      if os.path.isfile(filein): 
    291         fileout = os.path.join(SAVE_DIR, "_".join((filename, suffix))) 
     387        fileout = os.path.join(DIR["SAVE"], "_".join((filename, suffix))) 
    292388        shutil.copy(filein, fileout) 
  • TOOLS/ConsoGENCMIP6/bin/gencmip6.py

    r2411 r2413  
    77# standard library imports 
    88# from argparse import ArgumentParser 
     9import socket 
    910import os 
    1011import os.path 
     
    5354 
    5455######################################## 
     56def where_we_run(): 
     57 
     58  res = "" 
     59  if "curie" in socket.getfqdn(): 
     60    res = "curie" 
     61  elif "ipsl" in socket.getfqdn(): 
     62    res = "ipsl" 
     63  else: 
     64    res = "default" 
     65 
     66  return res 
     67 
     68 
     69######################################## 
    5570def get_last_file(dir_data, pattern): 
    5671  """ 
     
    5974  os.chdir(dir_data) 
    6075  filename = pattern + "*" 
    61   return_value = sorted(glob.glob(os.path.join(dir_data, filename)))[-1] 
     76  file_list = glob.glob(os.path.join(dir_data, filename)) 
     77  if file_list: 
     78    res = sorted(file_list)[-1] 
     79  else: 
     80    res = None 
    6281  os.chdir(current_dir) 
    63   return return_value 
     82  return res 
    6483 
    6584 
     
    99118    n = np.array([utheos[x1], utheos[x2]]) 
    100119 
    101     (a, b) = np.linalg.solve(m, n) 
     120    try: 
     121      (a, b) = np.linalg.solve(m, n) 
     122    except np.linalg.linalg.LinAlgError: 
     123      (a, b) = (None, None) 
    102124 
    103     delta = int(round((-b/a)-x1 + 1)) 
     125    if a and b: 
     126      delta = int(round((-b/a)-x1 + 1)) 
    104127 
    105     d1 = dates[x1] 
    106     self.date_init = d1 + dt.timedelta(days=delta) 
     128      d1 = dates[x1] 
     129      self.date_init = d1 + dt.timedelta(days=delta) 
     130    else: 
     131      self.date_init = dt.datetime(self.deadline.year, 1, 1) 
    107132 
    108133 
  • TOOLS/ConsoGENCMIP6/bin/plot_bilan.py

    r2411 r2413  
    99import os 
    1010import os.path 
    11 import glob 
     11# import glob 
    1212import datetime as dt 
    1313import numpy as np 
     
    1515from matplotlib.backends.backend_pdf import PdfPages 
    1616 
     17# Application library imports 
    1718from gencmip6 import * 
     19from gencmip6_path import * 
    1820 
    1921 
     
    168170  if args.full: 
    169171    line_style = "-" 
     172    line_width = 0.1 
    170173  else: 
    171174    line_style = "+-" 
     175    line_width = 0.2 
    172176 
    173177  ax_conso.bar(xcoord, consos, align="center", color="linen", 
    174                linewidth=0.2, label="conso (heures)") 
     178               linewidth=line_width, label="conso (heures)") 
    175179 
    176180  ax_theo.plot(xcoord, theo_equs, "--", 
     
    269273  # ... Files and directories ... 
    270274  # ----------------------------- 
    271   dir_data = os.path.join("..", "output") 
    272275  file_pattern = "OUT_CONSO_" 
    273   file_param = get_last_file(dir_data, file_pattern+"PARAM") 
    274   file_utheo = get_last_file(dir_data, file_pattern+"UTHEO") 
    275   file_bilan = get_last_file(dir_data, file_pattern+"BILAN") 
    276   file_login = get_last_file(dir_data, file_pattern+"LOGIN") 
    277   file_store = get_last_file(dir_data, file_pattern+"STORE") 
     276  file_param = get_last_file(DIR["DATA"], file_pattern+"PARAM") 
     277  file_utheo = get_last_file(DIR["DATA"], file_pattern+"UTHEO") 
     278  file_bilan = get_last_file(DIR["DATA"], file_pattern+"BILAN") 
     279  file_login = get_last_file(DIR["DATA"], file_pattern+"LOGIN") 
     280  file_store = get_last_file(DIR["DATA"], file_pattern+"STORE") 
     281  img_name = "bilan.pdf" 
    278282 
    279283  if args.verbose: 
     
    363367  # ... Save figure ... 
    364368  # ------------------- 
    365   dirout = "img" 
    366   img_name = "bilan.pdf" 
    367   plot_save(os.path.join(dirout, img_name)) 
     369  plot_save(os.path.join(DIR["PLOT"], img_name)) 
    368370 
    369371  plt.show() 
  • TOOLS/ConsoGENCMIP6/bin/plot_login.py

    r2411 r2413  
    99import os 
    1010import os.path 
    11 import glob 
    12 import datetime as dt 
     11# import glob 
     12# import datetime as dt 
    1313import numpy as np 
    1414import matplotlib.pyplot as plt 
    1515from matplotlib.backends.backend_pdf import PdfPages 
    1616 
     17# Application library imports 
    1718from gencmip6 import * 
    18  
    19  
    20 # ######################################## 
    21 # def string_to_percent(x): 
    22 #   """ 
    23 #   """ 
    24 #   return float(x.strip("%"))/100. 
    25  
    26  
    27 # ######################################## 
    28 # def string_to_float(x): 
    29 #   """ 
    30 #   """ 
    31 #   return float(x.strip("h")) 
    32  
    33  
    34 # ######################################## 
    35 # def string_to_date(ssaammjj, fmt="%Y-%m-%d"): 
    36 #   """ 
    37 #   """ 
    38 #   return dt.datetime.strptime(ssaammjj, fmt) 
    39  
    40  
    41 # ######################################## 
    42 # def date_to_string(dtdate, fmt="%Y-%m-%d"): 
    43 #   """ 
    44 #   """ 
    45 #   return dt.datetime.strftime(dtdate, fmt) 
    46  
    47  
    48 # ######################################## 
    49 # def get_last_file(dir_data, pattern): 
    50 #   """ 
    51 #   """ 
    52 #   current_dir = os.getcwd() 
    53 #   os.chdir(dir_data) 
    54 #   filename = pattern + "*" 
    55 #   return_value = sorted(glob.glob(os.path.join(dir_data, filename)))[-1] 
    56 #   os.chdir(current_dir) 
    57 #   return return_value 
    58  
    59  
    60 # ######################################## 
    61 # class Project(object): 
    62  
    63 #   #--------------------------------------- 
    64 #   def __init__(self): 
    65 #     self.project   = "" 
    66 #     self.date_init = "" 
    67 #     self.deadline  = "" 
    68 #     self.alloc     = 0 
    69  
    70 #   #--------------------------------------- 
    71 #   def fill_data(self, filein): 
    72 #     import json 
    73 #     dico = json.load(open(filein, "r")) 
    74 #     self.project = dico["project"] 
    75 #     self.deadline = string_to_date(dico["deadline"]) + \ 
    76 #                     dt.timedelta(days=-1) 
    77 #     self.alloc = dico["alloc"] 
    78  
    79 #   #--------------------------------------- 
    80 #   def get_date_init(self, filein): 
    81 #     data = np.genfromtxt( 
    82 #       filein, 
    83 #       skip_header=1, 
    84 #       converters={0: string_to_date, 
    85 #                   1: string_to_percent}, 
    86 #       missing_values="nan", 
    87 #     ) 
    88 #     dates, utheos = zip(*data) 
    89  
    90 #     (x1, x2) = (np.nanargmin(utheos), np.nanargmax(utheos)) 
    91  
    92 #     m = np.array([[x1, 1.], [x2, 1.]]) 
    93 #     n = np.array([utheos[x1], utheos[x2]]) 
    94  
    95 #     (a, b) = np.linalg.solve(m, n) 
    96  
    97 #     delta = int(round((-b/a)-x1 + 1)) 
    98  
    99 #     d1 = dates[x1] 
    100 #     self.date_init = d1 + dt.timedelta(days=delta) 
     19from gencmip6_path import * 
    10120 
    10221 
     
    262181  # ... Files and directories ... 
    263182  # ----------------------------- 
    264   dir_data = os.path.join("..", "output") 
    265183  file_pattern = "OUT_CONSO_" 
    266   file_param = get_last_file(dir_data, file_pattern+"PARAM") 
    267   file_utheo = get_last_file(dir_data, file_pattern+"UTHEO") 
    268   file_bilan = get_last_file(dir_data, file_pattern+"BILAN") 
    269   file_login = get_last_file(dir_data, file_pattern+"LOGIN") 
    270   file_store = get_last_file(dir_data, file_pattern+"STORE") 
     184  file_param = get_last_file(DIR["DATA"], file_pattern+"PARAM") 
     185  file_utheo = get_last_file(DIR["DATA"], file_pattern+"UTHEO") 
     186  file_bilan = get_last_file(DIR["DATA"], file_pattern+"BILAN") 
     187  file_login = get_last_file(DIR["DATA"], file_pattern+"LOGIN") 
     188  file_store = get_last_file(DIR["DATA"], file_pattern+"STORE") 
     189  img_name = "login.pdf" 
    271190 
    272191  # .. Get project info .. 
     
    324243  # ... Save figure ... 
    325244  # ------------------- 
    326   dirout = "img" 
    327   img_name = "login.pdf" 
    328   plot_save(os.path.join(dirout, img_name)) 
     245  plot_save(os.path.join(DIR["PLOT"], img_name)) 
    329246 
    330247  plt.show() 
  • TOOLS/ConsoGENCMIP6/bin/plot_store.py

    r2411 r2413  
    1515from matplotlib.backends.backend_pdf import PdfPages 
    1616 
     17# Application library imports 
    1718from gencmip6 import * 
    18  
    19  
    20 # ######################################## 
    21 # def string_to_percent(x): 
    22 #   """ 
    23 #   """ 
    24 #   return float(x.strip("%"))/100. 
    25  
    26  
    27 # ######################################## 
    28 # def string_to_size_unit(x): 
    29 #   """ 
    30 #   """ 
    31 #   (size, unit) = (float(x[:-1]), x[-1]) 
    32 #   return SizeUnit(size, unit) 
    33  
    34  
    35 # ######################################## 
    36 # def string_to_float(x): 
    37 #   """ 
    38 #   """ 
    39 #   return float(x.strip("h")) 
    40  
    41  
    42 # ######################################## 
    43 # def string_to_date(ssaammjj, fmt="%Y-%m-%d"): 
    44 #   """ 
    45 #   """ 
    46 #   return dt.datetime.strptime(ssaammjj, fmt) 
    47  
    48  
    49 # ######################################## 
    50 # def date_to_string(dtdate, fmt="%Y-%m-%d"): 
    51 #   """ 
    52 #   """ 
    53 #   return dt.datetime.strftime(dtdate, fmt) 
    54  
    55  
    56 # ######################################## 
    57 # def get_last_file(dir_data, pattern): 
    58 #   """ 
    59 #   """ 
    60 #   current_dir = os.getcwd() 
    61 #   os.chdir(dir_data) 
    62 #   filename = pattern + "*" 
    63 #   return_value = sorted(glob.glob(os.path.join(dir_data, filename)))[-1] 
    64 #   os.chdir(current_dir) 
    65 #   return return_value 
    66  
    67  
    68 # ######################################## 
    69 # class Project(object): 
    70  
    71 #   #--------------------------------------- 
    72 #   def __init__(self): 
    73 #     self.project   = "" 
    74 #     self.date_init = "" 
    75 #     self.deadline  = "" 
    76 #     self.alloc     = 0 
    77  
    78 #   #--------------------------------------- 
    79 #   def fill_data(self, filein): 
    80 #     import json 
    81 #     dico = json.load(open(filein, "r")) 
    82 #     self.project = dico["project"] 
    83 #     self.deadline = string_to_date(dico["deadline"]) + \ 
    84 #                     dt.timedelta(days=-1) 
    85 #     self.alloc = dico["alloc"] 
    86  
    87 #   #--------------------------------------- 
    88 #   def get_date_init(self, filein): 
    89 #     data = np.genfromtxt( 
    90 #       filein, 
    91 #       skip_header=1, 
    92 #       converters={0: string_to_date, 
    93 #                   1: string_to_percent}, 
    94 #       missing_values="nan", 
    95 #     ) 
    96 #     dates, utheos = zip(*data) 
    97  
    98 #     (x1, x2) = (np.nanargmin(utheos), np.nanargmax(utheos)) 
    99  
    100 #     m = np.array([[x1, 1.], [x2, 1.]]) 
    101 #     n = np.array([utheos[x1], utheos[x2]]) 
    102  
    103 #     (a, b) = np.linalg.solve(m, n) 
    104  
    105 #     delta = int(round((-b/a)-x1 + 1)) 
    106  
    107 #     d1 = dates[x1] 
    108 #     self.date_init = d1 + dt.timedelta(days=delta) 
    109  
    110  
    111 # ######################################## 
    112 # class SizeUnit(object): 
    113 #   #--------------------------------------- 
    114 #   def __init__(self, size, unit): 
    115 #     self.size = size 
    116 #     self.unit = unit 
    117  
    118 #   #--------------------------------------- 
    119 #   def __repr__(self): 
    120 #     return "{:6.2f}{}o".format(self.size, self.unit) 
    121  
    122 #   #--------------------------------------- 
    123 #   def convert_size(self, unit_out): 
    124 #     """ 
    125 #     """ 
    126 #     prefixes = ["K", "M", "G", "T", "P", "H"] 
    127  
    128 #     if not self.size or \ 
    129 #        self.unit == unit_out: 
    130 #       size_out = self.size 
    131 #     else: 
    132 #       idx_deb = prefixes.index(self.unit) 
    133 #       idx_fin = prefixes.index(unit_out) 
    134 #       size_out = self.size 
    135 #       for i in xrange(abs(idx_fin-idx_deb)): 
    136 #         if idx_fin > idx_deb: 
    137 #           size_out = size_out / 1024 
    138 #         else: 
    139 #           size_out = size_out * 1024 
    140  
    141 #     return SizeUnit(size_out, unit_out) 
     19from gencmip6_path import * 
    14220 
    14321 
     
    19977    """ 
    20078    """ 
    201     # items = (item for item in self.itervalues() if item.dir) 
    20279    items = (subitem for item in self.itervalues() 
    20380                     for subitem in item.listdir 
     
    336213  # ... Files and directories ... 
    337214  # ----------------------------- 
    338   dir_data = os.path.join("..", "output") 
    339215  file_pattern = "OUT_CONSO_" 
    340   file_param = get_last_file(dir_data, file_pattern+"PARAM") 
    341   file_utheo = get_last_file(dir_data, file_pattern+"UTHEO") 
    342   file_bilan = get_last_file(dir_data, file_pattern+"BILAN") 
    343   file_login = get_last_file(dir_data, file_pattern+"LOGIN") 
    344   file_store = get_last_file(dir_data, file_pattern+"STORE") 
     216  file_param = get_last_file(DIR["DATA"], file_pattern+"PARAM") 
     217  file_utheo = get_last_file(DIR["DATA"], file_pattern+"UTHEO") 
     218  file_bilan = get_last_file(DIR["DATA"], file_pattern+"BILAN") 
     219  file_login = get_last_file(DIR["DATA"], file_pattern+"LOGIN") 
     220  file_store = get_last_file(DIR["DATA"], file_pattern+"STORE") 
     221  img_name = "store.pdf" 
    345222 
    346223  # .. Get project info .. 
     
    407284  # ... Save figure ... 
    408285  # ------------------- 
    409   dirout = "img" 
    410   img_name = "store.pdf" 
    411   plot_save(os.path.join(dirout, img_name)) 
     286  plot_save(os.path.join(DIR["PLOT"], img_name)) 
    412287 
    413288  plt.show() 
Note: See TracChangeset for help on using the changeset viewer.