Skip to content

Commit

Permalink
concatenation of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
arght committed Nov 9, 2024
1 parent 141ec22 commit bdb531f
Show file tree
Hide file tree
Showing 8 changed files with 406 additions and 403 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Change Log
=============

[4.17.9] - 2024-11-08
-----------------------
- [CHANGED] concatenation of strings

[4.17.8] - 2024-10-30
-----------------------
- [FIXED] fix control of second block capacity extremely small (1e-17)
Expand Down
6 changes: 3 additions & 3 deletions doc/rst/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
author = 'Andres Ramos'

# The short X.Y version
version = 'version 4.17.8'
version = 'version 4.17.9'
# The full version, including alpha/beta/rc tags
release = ''

Expand Down Expand Up @@ -84,13 +84,13 @@
#
# html_sidebars = {}
html_theme = 'alabaster'
html_title = 'version 4.17.8'
html_title = 'version 4.17.9'
html_logo = '../img/openTEPES.png'
html_last_updated_fmt = ''
html_show_sphinx = False
html_theme_options = {
'analytics_id': 'UA-515200-2', # Provided by Google in your dashboard
'description': 'version 4.17.8',
'description': 'version 4.17.9',
'body_max_width' : 'none',
'page_width': 'auto',
'font_family': 'Georgia'
Expand Down
2 changes: 1 addition & 1 deletion openTEPES/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
>>> import openTEPES as oT
>>> oT.routine("9n", "C:\\Users\\UserName\\Documents\\GitHub\\openTEPES", "glpk")
"""
__version__ = "4.17.8"
__version__ = "4.17.9"

from .openTEPES_Main import main
from .openTEPES import *
Expand Down
14 changes: 7 additions & 7 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) - October 30, 2024
Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - November 08, 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.8 - October 30, 2024')
print( 'Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.8 - October 30, 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.9 - November 08, 2024')
print( 'Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.9 - November 08, 2024', file=open(_path+f'/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 @@ -115,7 +115,7 @@ def openTEPES_run(DirName, CaseName, SolverName, pIndOutputResults, pIndLogConso
else:
mTEPES.na = mTEPES.na | mTEPES.n

print('Period '+str(p)+', Scenario '+str(sc)+', Stage '+str(st))
print(f'Period {p}, Scenario {sc}, Stage {st}')

# operation model objective function and constraints by stage
GenerationOperationModelFormulationObjFunct (mTEPES, mTEPES, pIndLogConsole, p, sc, st)
Expand All @@ -142,7 +142,7 @@ def openTEPES_run(DirName, CaseName, SolverName, pIndOutputResults, pIndLogConso

if pIndLogConsole == 1:
StartTime = time.time()
mTEPES.write(_path+'/openTEPES_'+CaseName+'_'+str(p)+'_'+str(sc)+'_'+str(st)+'.lp', io_options={'symbolic_solver_labels': True})
mTEPES.write(_path+f'/openTEPES_{CaseName}_{p}_{sc}_{st}.lp', io_options={'symbolic_solver_labels': True})
WritingLPFileTime = time.time() - StartTime
StartTime = time.time()
print('Writing LP file ... ', round(WritingLPFileTime), 's')
Expand Down Expand Up @@ -187,7 +187,7 @@ def openTEPES_run(DirName, CaseName, SolverName, pIndOutputResults, pIndLogConso

if pIndLogConsole == 1:
StartTime = time.time()
mTEPES.write(_path+'/openTEPES_'+CaseName+'_'+str(p)+'_'+str(sc)+'_'+str(st)+'.lp', io_options={'symbolic_solver_labels': True})
mTEPES.write(_path+f'/openTEPES_{CaseName}_{p}_{sc}_{st}.lp', io_options={'symbolic_solver_labels': True})
WritingLPFileTime = time.time() - StartTime
StartTime = time.time()
print('Writing LP file ... ', round(WritingLPFileTime), 's')
Expand Down Expand Up @@ -230,7 +230,7 @@ def openTEPES_run(DirName, CaseName, SolverName, pIndOutputResults, pIndLogConso
mTEPES.pScenProb[p,sc] = 1.0

# pickle the case study data
# with open(dump_folder+'/oT_Case_'+CaseName+'.pkl','wb') as f:
# with open(dump_folder+f'/oT_Case_{CaseName}.pkl','wb') as f:
# pickle.dump(mTEPES, f, pickle.HIGHEST_PROTOCOL)

# output results only for every unit (0), only for every technology (1), or for both (2)
Expand Down
6 changes: 3 additions & 3 deletions openTEPES/openTEPES_Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@
# For more information on this, and how to apply and follow the GNU AGPL, see
# <https://www.gnu.org/licenses/>.

# Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - October 30, 2024
# Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - November 08, 2024
# simplicity and transparency in power systems planning

# Developed by
Expand All @@ -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.8 - October 30, 2024\033[0m')
print('\033[1;32mOpen Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES) - Version 4.17.9 - November 08, 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 Down Expand Up @@ -739,7 +739,7 @@ def main():
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('Elapsed time '+str(ElapsedTime)+' s')
f'Elapsed time {ElapsedTime} s'
# Final message
print('End of the run ************')
print('\033[34m#### Academic research license - for non-commercial use only ####\033[0m')
Expand Down
Loading

0 comments on commit bdb531f

Please sign in to comment.