Skip to content

Commit

Permalink
update elapsed time name
Browse files Browse the repository at this point in the history
  • Loading branch information
arght committed Jun 11, 2024
1 parent d09b37e commit 34cddeb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
9 changes: 3 additions & 6 deletions openTEPES/openTEPES.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - June 10, 2024
Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - June 11, 2024
"""

# import dill as pickle
Expand Down Expand Up @@ -39,8 +39,8 @@ def openTEPES_run(DirName, CaseName, SolverName, pIndOutputResults, pIndLogConso
idxDict['y' ] = 1

#%% model declaration
mTEPES = ConcreteModel('Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.3 - June 10, 2024')
print( 'Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.3 - June 10, 2024', file=open(_path+'/openTEPES_version_'+CaseName+'.log','w'))
mTEPES = ConcreteModel('Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.3 - June 11, 2024')
print( 'Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.3 - June 11, 2024', file=open(_path+'/openTEPES_version_'+CaseName+'.log','w'))

pIndOutputResults = [j for i,j in idxDict.items() if i == pIndOutputResults][0]
pIndLogConsole = [j for i,j in idxDict.items() if i == pIndLogConsole ][0]
Expand Down Expand Up @@ -308,7 +308,4 @@ def openTEPES_run(DirName, CaseName, SolverName, pIndOutputResults, pIndLogConso
if pIndEconomicResults == 1:
EconomicResults (DirName, CaseName, mTEPES, mTEPES, pIndAreaOutput, pIndPlotOutput)

# TotalTime = time.time() - InitialTime
# print('Total time ... ', round(TotalTime), 's')

return mTEPES
12 changes: 6 additions & 6 deletions openTEPES/openTEPES_Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@
# import pkg_resources
from .openTEPES import openTEPES_run

print('\033[1;32mOpen Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.1 - May 13, 2024\033[0m')
print('\033[1;32mOpen Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.3 - June 11, 2024\033[0m')
print('\033[34m#### Academic research license - for non-commercial use only ####\033[0m \n')

parser = argparse.ArgumentParser(description='Introducing main parameters...')
Expand All @@ -704,7 +704,7 @@

def main():
# Defining the initial time
InitialTime = time.time()
StartTime = time.time()
# Parsing the arguments
args = parser.parse_args()
if args.dir is None:
Expand Down Expand Up @@ -735,11 +735,11 @@ def main():
print(args)
openTEPES_run(args.dir, args.case, args.solver, args.result, args.log)
# Computing the elapsed time
ElapsedTime = round(time.time() - InitialTime)
print('Total time ... {} s'.format(ElapsedTime))
path_to_write_time = os.path.join(args.dir,args.case,"oT_ComputationTime"+args.case+".txt")
ElapsedTime = round(time.time() - StartTime)
print('Total time ... {} s'.format(ElapsedTime))
path_to_write_time = os.path.join(args.dir,args.case,'openTEPES_time_'+args.case+'.log')
with open(path_to_write_time, 'w') as f:
f.write(str(ElapsedTime))
f.write('Elapsed time '+str(ElapsedTime)+' s')
# Final message
print('End of the run ************')
print('\033[34m#### Academic research license - for non-commercial use only ####\033[0m')
Expand Down

0 comments on commit 34cddeb

Please sign in to comment.