Themes
Tessif’s themes designed to be used for visualization.
themes is a tessif subpackage grouping color and
hatch themes to :tessif.frused.namedtuples.NodeColorGroupings for convenient
and automated access.
- tessif.frused.themes.colors = NodeColorGroupings(component=OrderedDict([('bus', '#9999ff'), ('sink', '#9999ff'), ('storage', '#9999ff'), ('source', '#9999ff'), ('transformer', '#9999ff'), ('connector', '#9999ff')]), name=OrderedDict([('renewables', '#00ff00'), ('photovoltaic', '#ff9900'), ('solarthermal', '#ff0099'), ('onshore', '#99ccff'), ('offshore', '#00ccff'), ('hydro_electric', '#000099'), ('combined_heat_power', '#9933cc'), ('power_plant', '#ff6600'), ('heat_plant', '#b30000'), ('electrical_line', '#ffcc00'), ('gas_station', '#6633cc'), ('gas_pipeline', '#336666'), ('gas_delivery', '#006666'), ('oil_pipeline', '#666666'), ('oil_delivery', '#333333'), ('hydro_electrical_storage', '#0000cc'), ('electro_chemical_storage', '#ccff00'), ('electro_mechanical_storage', '#999900'), ('thermal_energy_storage', '#cc0033'), ('power2x', '#669999'), ('power2heat', '#b30000'), ('imported', '#ff6600'), ('backup', '#990099'), ('demand', '#330099'), ('export', '#006600'), ('excess', '#cc0000'), ('connector', '#669999')]), carrier=OrderedDict([('solar', '#ff9900'), ('wind', '#00ccff'), ('water', '#000099'), ('biomass', '#009900'), ('gas', '#336666'), ('oil', '#666666'), ('lignite', '#993300'), ('hardcoal', '#000000'), ('nuclear', '#cccc00'), ('electricity', '#FFD700'), ('steam', '#cc0033'), ('hot_water', '#ff3300')]), sector=OrderedDict([('power', '#ffff33'), ('heat', '#FF0000'), ('mobility', '#669999'), ('coupled', '#6633cc')]))
Tessif color themes. Stored inside a
NodeColorGroupingsNamedTuple. Assembled using colorhexa Categorized byNodeColorGroupingsFor each category there is a mapping of identifiers to colors
Component Grouped Colors:
Named Grouped Colors:
Carrier Grouped Colors:
Sector Grouped Colors:
- tessif.frused.themes.cmaps = NodeColorGroupings(component=OrderedDict([('bus', ['#4d4dff', '#6666ff', '#8080ff', '#9999ff', '#b3b3ff', '#ccccff', '#e6e6ff']), ('sink', ['#4d4dff', '#6666ff', '#8080ff', '#9999ff', '#b3b3ff', '#ccccff', '#e6e6ff']), ('storage', ['#4d4dff', '#6666ff', '#8080ff', '#9999ff', '#b3b3ff', '#ccccff', '#e6e6ff']), ('source', ['#4d4dff', '#6666ff', '#8080ff', '#9999ff', '#b3b3ff', '#ccccff', '#e6e6ff']), ('transformer', ['#4d4dff', '#6666ff', '#8080ff', '#9999ff', '#b3b3ff', '#ccccff', '#e6e6ff']), ('connector', ['#4d4dff', '#6666ff', '#8080ff', '#9999ff', '#b3b3ff', '#ccccff', '#e6e6ff'])]), name=OrderedDict([('renewables', ['#00b300', '#00cc00', '#00e600', '#00ff00', '#1aff1a', '#33ff33', '#4dff4d']), ('photovoltaic', ['#b37400', '#cc8400', '#e69500', '#ffa500', '#ffae1a', '#ffb733', '#ffc04d']), ('solarthermal', ['#b300b6', '#cc007a', '#e6008a', '#ff0099', '#ff1aa3', '#ff33ad', '#ff4db8']), ('offshore', ['#4da6ff', '#66b3ff', '#80bfff', '#99ccff', '#b3d9ff', '#cce6ff', '#e6f2ff']), ('onshore', ['#002aff', '#008cff', '#00b7ff', '#00ccff', '#00e1ff', '#00f7ff', '#00fff2']), ('hydro_electric', ['#00004d', '#190099', '#0d0099', '#000099', '#000d99', '#001a99', '#002699']), ('combined_heat_power', ['#6b248f', '#7a29a3', '#8a2eb8', '#9933cc', '#a347d1', '#ad5cd6', '#b870db']), ('power_plant', ['#b34700', '#cc5200', '#c65c00', '#ff6600', '#ff751a', '#ff8533', '#ff944d']), ('heat_plant', ['#670000', '#800000', '#9a0000', '#b30000', '#cd0000', '#e60000', '#ff0000']), ('electrical_line', ['#b38f00', '#cca300', '#e6b800', '#ffcc00', '#ffd11a', '#ffd633', '#ffdb4d']), ('gas_pipeline', ['#1a3333', '#224444', '#2b5555', '#336666', '#3c7777', '#448888', '#4d9999']), ('gas_delivery', ['#003434', '#004d4d', '#006767', '#008080', '#009a9a', '#00b3b3', '#00cdcd']), ('oil_pipeline', ['#404040', '#4d4d4d', '#595959', '#666666', '#737373', '#808080', '#8c8c8c']), ('oil_delivery', ['#0d0d0d', '#1a1a1a', '#262626', '#333333', '#404040', '#4d4d4d', '#595959']), ('hydro_electrical_storage', ['#000080', '#000099', '#0000b3', '#0000cc', '#0000c6', '#0000ff', '#1a1aff']), ('electro_chemical_storage', ['#8fb300', '#a3cc00', '#b8e600', '#ccff00', '#d1ff1a', '#d6ff33', '#dbff4d']), ('electro_mechanical_storage', ['#343400', '#4d4d00', '#676700', '#808000', '#9a9a00', '#b3b300', '#cdcd00']), ('thermal_energy_storage', ['#800020', '#990026', '#b3002a', '#cc0033', '#e60039', '#ff0040', '#ff1a53']), ('power2x', ['#476b6b', '#527a7a', '#5c8a8a', '#669999', '#75a3a3', '#85adad', '#94b8b8']), ('power2heat', ['#670000', '#800000', '#9a0000', '#b30000', '#cd0000', '#e60000', '#ff0000']), ('imported', ['#b33500', '#cc3d00', '#e64400', '#ff4c00', '#ff5e1a', '#ff7033', '#ff824d']), ('backup', ['#340034', '#4d004d', '#670067', '#800080', '#9a009a', '#b300b3', '#cd00cd']), ('demand', ['#1a004d', '#220066', '#2b0080', '#330099', '#3b00b3', '#4400cc', '#4c00e6']), ('export', ['#001800', '#003100', '#004b00', '#006400', '#007e00', '#009700', '#00b100']), ('excess', ['#800000', '#990000', '#b30000', '#cc0000', '#e60000', '#ff0000', '#ff1a1a'])]), carrier=OrderedDict([('solar', ['#ff5900', '#ff6f00', '#ff8400', '#ff9900', '#ffae00', '#ffc400', '#ffd900']), ('wind', ['#002aff', '#008cff', '#00b7ff', '#00ccff', '#00e1ff', '#00f7ff', '#00fff2']), ('water', ['#00004d', '#190099', '#0d0099', '#000099', '#000d99', '#001a99', '#002699']), ('biomass', ['#004d00', '#006600', '#008000', '#009900', '#00b300', '#00cc00', '#00e600']), ('gas', ['#1a3333', '#224444', '#2b5555', '#336666', '#3c7777', '#448888', '#4d9999']), ('oil', ['#404040', '#4d4d4d', '#595959', '#666666', '#737373', '#808080', '#8c8c8c']), ('lignite', ['#4d1a00', '#662200', '#802b00', '#993300', '#b33c00', '#cc4400', '#e64d00']), ('hardcoal', ['#000000', '#0d0d0d', '#191919', '#262626', '#333333', '#404040', '#4c4c4c']), ('nuclear', ['#808000', '#999900', '#b3b300', '#cccc00', '#e6e600', '#ffff00', '#ffff1a']), ('electricity', ['#b39700', '#ccac00', '#e6c200', '#ffd700', '#ffdb1a', '#ffdf33', '#ffe34d']), ('steam', ['#800020', '#990026', '#b3002a', '#cc0033', '#e60039', '#ff0040', '#ff1a53']), ('hot_water', ['#b32400', '#cc2900', '#e62e00', '#ff3300', '#ff471a', '#ff5c33', '#ff704d'])]), sector=OrderedDict([('power', ['#ff5900', '#ff6f00', '#ff8400', '#ff9900', '#ffae00', '#ffc400', '#ffd900']), ('heat', ['#b30000', '#cc0000', '#e60000', '#ff0000', '#ff1a1a', '#ff3333', '#ff4d4d']), ('mobility', ['#476b6b', '#527a7a', '#5c8a8a', '#669999', '#75a3a3', '#85adad', '#94b8b8']), ('coupled', ['#47248f', '#5229a3', '#5c2eb8', '#6633cc', '#7547d1', '#855cd6', '#9470db'])]))
Tessif colormap themes. Stored inside a
NodeColorGroupingsNamedTuple. Assembled using colorhexa Categorized byNodeColorGroupingsFor each category there is a mapping of identifiers to colors
Component Grouped Colormaps:
Name Grouped Colormaps:
Carrier Grouped Colormaps:
Sector Grouped Colormaps:
- tessif.frused.themes.ccycles = NodeColorGroupings(component=OrderedDict([('bus', <itertools.cycle object>), ('sink', <itertools.cycle object>), ('storage', <itertools.cycle object>), ('source', <itertools.cycle object>), ('transformer', <itertools.cycle object>), ('connector', <itertools.cycle object>)]), name=OrderedDict([('renewables', <itertools.cycle object>), ('photovoltaic', <itertools.cycle object>), ('solarthermal', <itertools.cycle object>), ('offshore', <itertools.cycle object>), ('onshore', <itertools.cycle object>), ('hydro_electric', <itertools.cycle object>), ('combined_heat_power', <itertools.cycle object>), ('power_plant', <itertools.cycle object>), ('heat_plant', <itertools.cycle object>), ('electrical_line', <itertools.cycle object>), ('gas_pipeline', <itertools.cycle object>), ('gas_delivery', <itertools.cycle object>), ('oil_pipeline', <itertools.cycle object>), ('oil_delivery', <itertools.cycle object>), ('hydro_electrical_storage', <itertools.cycle object>), ('electro_chemical_storage', <itertools.cycle object>), ('electro_mechanical_storage', <itertools.cycle object>), ('thermal_energy_storage', <itertools.cycle object>), ('power2x', <itertools.cycle object>), ('power2heat', <itertools.cycle object>), ('imported', <itertools.cycle object>), ('backup', <itertools.cycle object>), ('demand', <itertools.cycle object>), ('export', <itertools.cycle object>), ('excess', <itertools.cycle object>)]), carrier=OrderedDict([('solar', <itertools.cycle object>), ('wind', <itertools.cycle object>), ('water', <itertools.cycle object>), ('biomass', <itertools.cycle object>), ('gas', <itertools.cycle object>), ('oil', <itertools.cycle object>), ('lignite', <itertools.cycle object>), ('hardcoal', <itertools.cycle object>), ('nuclear', <itertools.cycle object>), ('electricity', <itertools.cycle object>), ('steam', <itertools.cycle object>), ('hot_water', <itertools.cycle object>)]), sector=OrderedDict([('power', <itertools.cycle object>), ('heat', <itertools.cycle object>), ('mobility', <itertools.cycle object>), ('coupled', <itertools.cycle object>)]))
tessifcycled colormaps. Stored inside aNodeColorGroupingsNamedTuple.
- tessif.frused.themes.hatches = NodeColorGroupings(component=OrderedDict([('bus', '/'), ('sink', '\\'), ('source', '.'), ('storage', '|'), ('transformer', '-'), ('connector', 'x')]), name=OrderedDict([('photovoltaic', '/'), ('solarthermal', '//'), ('onshore', '\\'), ('offshore', '\\\\'), ('hydro_electric', 'o'), ('combined_heat_power', '+'), ('power_plant', '|'), ('heat_plant', '-'), ('electrical_line', '++'), ('gas_pipeline', '--'), ('gas_delivery', '---'), ('oil_pipeline', '+/'), ('oil_delivery', '+/+/'), ('bus', '.'), ('hydro_electrical_storage', 'oo'), ('electro_chemical_storage', 'xx'), ('electro_mechanical_storage', '||'), ('thermal_energy_storage', '--'), ('power2x', 'xxx')]), carrier=OrderedDict([('solar', '/'), ('wind', '\\'), ('water', '.'), ('biomass', '|'), ('gas', '-'), ('oil', '+/'), ('lignite', 'o'), ('hardcoal', '.'), ('nuclear', '*'), ('electricity', '//'), ('steam', '\\\\'), ('hot_water', '||')]), sector=OrderedDict([('power', '/'), ('heat', '\\'), ('mobility', '|'), ('coupled', 'x')]))
tessifhatch themes. Stored inside aNodeColorGroupingsNamedTuple.For each category there is a mapping of identifiers to hatches
Component Grouped Hatches:
Name Grouped Hatches:
Carrier Grouped Hatches:
Sector Grouped Hatches:
- tessif.frused.themes.hmaps = {'sector': {'heat': ['-', '|', '--', '||', '---', '|||'], 'mobility': ['x', '+/', 'xx', '+/+/', 'xxx', '+/+/+/'], 'power': ['/', '\\', '//', '\\\\', '///', '\\\\\\']}}
Mapping of
tessifhatchmaps. Usefull when plotting sector grouped results to distinguish the individual components without coloring.Sector Grouped Hatchmap:
- tessif.frused.themes.match_theme(strings, theme='colors', grouping='name')[source]
Match a collection of strings to tessf’s theme groupings.
- Parameters
strings¶ (Iterable) – Iterable of strings which are tried to be matched to registerd theme values.
theme¶ (str) – String specifying one of
tessif's themeslikecolors, etc.grouping¶ (str) – String specifying one of the
NodeColorGroupingsthethemeprovides
- Returns
Mapping of the provided strings to the matched theme values
- Return type
Example
Create a
tessif energy systemand create a color mapping using it’s nodes:Create the tessif energy system using the Example Hub:
>>> import tessif.examples.data.tsf.py_hard as coded_examples >>> tessif_es = coded_examples.create_fpwe()
Create a list of node names: >>> node_names = [str(node.uid) for node in tessif_es.nodes]
Match the node colors:
>>> from tessif.frused.themes import match_theme >>> node_colors = match_theme( ... strings=node_names, theme='colors', grouping='name')
>>> import pprint >>> pprint.pprint(node_colors) {'Battery': '#ccff00', 'Demand': '#330099', 'Gas Station': '#6633cc', 'Generator': '#ff6600', 'Pipeline': '#336666', 'Powerline': '#ffcc00', 'Solar Panel': '#ff9900'}