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:41, in Energyscope.es_model(self) 40 modules.activate(ampl_uuid) ---> 41 self.__es_model = AMPL() 42 except SystemError: 43 # 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 = 20260223; 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 699c7c65 e03ec2a9 d03d3605 851240d5 327785a3 518e4c1b 90bb853e 80b27d3f 812c75d8 06128a22 17d3a89d 87d4354c c770a0a5 e1cfac58 b57c3a5c e6e9643a 70e104c0 03f0e150 75e4c31a 9321c37f c6d4f885 b36197a0 64221647 17bb68ac 147ca0b5 f03cde4a 60722a2f 74dbb76b 32819acf 5733b3e9 b61e26aa 4029ecbd 171c37ff 5110ad29 43d577e5 d0195e19 36b0c4a8 e39d0158 36df0e02 92b85d48 11acb9ac 2014e7b0 4408f982 64e1a047 52a7a35d 8791be04 b417378f e47eb734 f25ba647 6357d241 143ab804 113a4e56 25f26002 37f0e4f5 e784aea6 13f76abc 4399929b 26c44d75 f3a904b3 44127058 456ca299 b2509d4d 9702743d a19a5699 c0acfadb c3d5d6c7 768be118 92fb9ddf a2edf6af d58a0577 e5f8b90c c3f8c217 47dd5606 378aa121 e0392da1 56aed47a 316ce5ed 61c83bcd 320b1ff3 d3f9786f 022b13d6 6457070a 411cdc07 734187c0 46bb7d5f 6236f178 b614b678 4247258d 05a3c3a9 f24273df b6 Computed 1-1-0-199776bc runner--pdbxrphm-project-62195384-concurrent-0 36:CF:9A:6D:62:0B 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:83, in Energyscope.calc(self, ds, parser) 79 def calc(self, ds: Dataset = None, parser: Callable[[AMPL], Result] = parse_result) -> Result: 80 """ 81 Calls AMPL with `df` as .dat and returns the parsed result. 82 """ ---> 83 if self.es_model.getSets().__len__() == 0: # Check if AMPL instance is empty 84 self._initial_run(ds=ds) 86 # Solve the model File /builds/energyscope/energyscope/src/energyscope/energyscope.py:44, in Energyscope.es_model(self) 41 self.__es_model = AMPL() 42 except SystemError: 43 # Try to create the object a second time to prevent errors when starting `ampl_lic` ---> 44 self.__es_model = AMPL() 45 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 = 20260223; 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 699c7c65 e03ec2a9 d03d3605 851240d5 327785a3 518e4c1b 90bb853e 80b27d3f 812c75d8 06128a22 17d3a89d 87d4354c c770a0a5 e1cfac58 b57c3a5c e6e9643a 70e104c0 03f0e150 75e4c31a 9321c37f c6d4f885 b36197a0 64221647 17bb68ac 147ca0b5 f03cde4a 60722a2f 74dbb76b 32819acf 5733b3e9 b61e26aa 4029ecbd 171c37ff 5110ad29 43d577e5 d0195e19 36b0c4a8 e39d0158 36df0e02 92b85d48 11acb9ac 2014e7b0 4408f982 64e1a047 52a7a35d 8791be04 b417378f e47eb734 f25ba647 6357d241 143ab804 113a4e56 25f26002 37f0e4f5 e784aea6 13f76abc 4399929b 26c44d75 f3a904b3 44127058 456ca299 b2509d4d 9702743d a19a5699 c0acfadb c3d5d6c7 768be118 92fb9ddf a2edf6af d58a0577 e5f8b90c c3f8c217 47dd5606 378aa121 e0392da1 56aed47a 316ce5ed 61c83bcd 320b1ff3 d3f9786f 022b13d6 6457070a 411cdc07 734187c0 46bb7d5f 6236f178 b614b678 4247258d 05a3c3a9 f24273df b6 Computed 1-1-0-199776bc runner--pdbxrphm-project-62195384-concurrent-0 36:CF:9A:6D:62:0B 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