Plot 11 resources treemap
In [1]:
Copied!
"""
Resources usage
===================================
Treemap of resources used by category.
"""
# mkdocs_gallery_thumbnail_path = '_static/plot_11_resources_treemap.png'
"""
Resources usage
===================================
Treemap of resources used by category.
"""
# mkdocs_gallery_thumbnail_path = '_static/plot_11_resources_treemap.png'
Out[1]:
'\nResources usage\n===================================\n\nTreemap of resources used by category.\n'
In [2]:
Copied!
from energyscope.energyscope import Energyscope
from energyscope.models import core
from energyscope.result import postprocessing
from energyscope.plots import plot_resources_use
from energyscope.energyscope import Energyscope
from energyscope.models import core
from energyscope.result import postprocessing
from energyscope.plots import plot_resources_use
In [3]:
Copied!
es_core = Energyscope(model=core)
results_core = postprocessing(es_core.calc(), df_monthly=False)
es_core = Energyscope(model=core)
results_core = postprocessing(es_core.calc(), df_monthly=False)
[INFO] Activating AMPL license with UUID
--------------------------------------------------------------------------- SystemError Traceback (most recent call last) File /builds/energyscope/energyscope/src/energyscope/energyscope.py:40, in Energyscope.es_model(self) 39 modules.activate(ampl_uuid) ---> 40 self.__es_model = AMPL() 41 except SystemError: 42 # Try to create the object a second time to prevent errors when starting `ampl_lic` File ~/.local/share/hatch/env/virtual/energyscope/4BIeM0-F/docs/lib/python3.10/site-packages/amplpy/ampl.py:105, in AMPL.__init__(self, environment) 104 if environment is None: --> 105 self._impl = amplpython.AMPL() 106 else: SystemError: License not valid. Message: License file /root/.local/share/hatch/env/virtual/energyscope/4BIeM0-F/docs/lib/python3.10/site-packages/ampl_module_base/bin/ampl.lic: Today = 20260415; found license file "/root/.local/share/hatch/env/virtual/energyscope/4BIeM0-F/docs/lib/python3.10/site-packages/ampl_module_base/bin/ampl.lic": # Bundle #7221.7759 expiring 20260215: ME-409 Energy conversion and renewable energy, Prof. Fran?ois Mar?chal, EPFL 69df5fe1 a602ece3 56236743 96496ddf a6f7802c 850401c3 7136148d 93815fd0 742b1d96 47a3bebc 14cbbe48 f79cb8e4 44b70a0a e09517ed 63cba63e a47a5127 81a46b9f 86bce2f4 820b1134 b2d111ba 51e0603c c67e166b 307d041c 2689092a b4b08072 17f81ddb 15faec5c f27233fb 67f1cbf2 03a39878 c0ead498 44d87985 e5c8b6a3 6568decb 803d9c58 c00df578 25b07a9a 328100c5 66b2e5cb 623b9827 66f1dd5b 5568d46c 517b3947 92dc0967 a5965f74 f1441020 910d5f0c 86145267 b6c2b6d7 d5e6c4f8 81431882 e4f00130 838dda31 86232bc2 867ca30d f4dcffda 910e5494 32a03f43 76dcefd1 559c5174 e1dd6518 a558c367 d4924d75 9250af4b 126e59f5 74e56f31 95eb7f27 91da8753 d07f095c e2778a4d c72f3ebc a01491bf 40481fca e2e0f7ab b7a9e28c 07f23ce9 f18b0ffa 80ce4479 125bb923 c5ad6dd9 920bf79d b578a3cd 128359f5 c05951cc 80c6fc7b 540f58da 52fb1d78 e3d88bc8 16e3c23a 3af7a3e8 e6 Computed 1-1-0-e246df1c runner--pdbxrphm-project-62195384-concurrent-0 5A:E7:C8:F1:AC:DA HOSTINFO.NPROC.4 HOSTINFO.CORES.4 HOSTINFO.PLATFORM.linux64 No ampl license for this machine. During handling of the above exception, another exception occurred: SystemError Traceback (most recent call last) Cell In[3], line 2 1 es_core = Energyscope(model=core) ----> 2 results_core = postprocessing(es_core.calc(), df_monthly=False) File /builds/energyscope/energyscope/src/energyscope/energyscope.py:82, in Energyscope.calc(self, ds, parser) 78 def calc(self, ds: Dataset = None, parser: Callable[[AMPL], Result] = parse_result) -> Result: 79 """ 80 Calls AMPL with `df` as .dat and returns the parsed result. 81 """ ---> 82 if self.es_model.getSets().__len__() == 0: # Check if AMPL instance is empty 83 self._initial_run(ds=ds) 85 # Solve the model File /builds/energyscope/energyscope/src/energyscope/energyscope.py:43, in Energyscope.es_model(self) 40 self.__es_model = AMPL() 41 except SystemError: 42 # Try to create the object a second time to prevent errors when starting `ampl_lic` ---> 43 self.__es_model = AMPL() 44 return self.__es_model File ~/.local/share/hatch/env/virtual/energyscope/4BIeM0-F/docs/lib/python3.10/site-packages/amplpy/ampl.py:105, in AMPL.__init__(self, environment) 103 environment = Environment() 104 if environment is None: --> 105 self._impl = amplpython.AMPL() 106 else: 107 self._impl = amplpython.AMPL(environment._impl) SystemError: License not valid. Message: License file /root/.local/share/hatch/env/virtual/energyscope/4BIeM0-F/docs/lib/python3.10/site-packages/ampl_module_base/bin/ampl.lic: Today = 20260415; found license file "/root/.local/share/hatch/env/virtual/energyscope/4BIeM0-F/docs/lib/python3.10/site-packages/ampl_module_base/bin/ampl.lic": # Bundle #7221.7759 expiring 20260215: ME-409 Energy conversion and renewable energy, Prof. Fran?ois Mar?chal, EPFL 69df5fe1 a602ece3 56236743 96496ddf a6f7802c 850401c3 7136148d 93815fd0 742b1d96 47a3bebc 14cbbe48 f79cb8e4 44b70a0a e09517ed 63cba63e a47a5127 81a46b9f 86bce2f4 820b1134 b2d111ba 51e0603c c67e166b 307d041c 2689092a b4b08072 17f81ddb 15faec5c f27233fb 67f1cbf2 03a39878 c0ead498 44d87985 e5c8b6a3 6568decb 803d9c58 c00df578 25b07a9a 328100c5 66b2e5cb 623b9827 66f1dd5b 5568d46c 517b3947 92dc0967 a5965f74 f1441020 910d5f0c 86145267 b6c2b6d7 d5e6c4f8 81431882 e4f00130 838dda31 86232bc2 867ca30d f4dcffda 910e5494 32a03f43 76dcefd1 559c5174 e1dd6518 a558c367 d4924d75 9250af4b 126e59f5 74e56f31 95eb7f27 91da8753 d07f095c e2778a4d c72f3ebc a01491bf 40481fca e2e0f7ab b7a9e28c 07f23ce9 f18b0ffa 80ce4479 125bb923 c5ad6dd9 920bf79d b578a3cd 128359f5 c05951cc 80c6fc7b 540f58da 52fb1d78 e3d88bc8 16e3c23a 3af7a3e8 e6 Computed 1-1-0-e246df1c runner--pdbxrphm-project-62195384-concurrent-0 5A:E7:C8:F1:AC:DA HOSTINFO.NPROC.4 HOSTINFO.CORES.4 HOSTINFO.PLATFORM.linux64 No ampl license for this machine.
In [4]:
Copied!
fig = plot_resources_use(results_core)
fig.show(renderer="notebook")
fig = plot_resources_use(results_core)
fig.show(renderer="notebook")
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[4], line 1 ----> 1 fig = plot_resources_use(results_core) 2 fig.show(renderer="notebook") NameError: name 'results_core' is not defined