Skip to content

Commit

Permalink
Making the plot maps function work for any cases in the commodity input
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias157 committed Oct 20, 2024
1 parent d5c7c6d commit abd599b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/pybalmorel/plotting/maps_balmorel.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def plot_map(path_to_result: str,
font_hub = 12 #Font size of hub labels
font_region = 10 #Font size of region labels
line_decimals = 1 #Number of decimals shown for line capacities
COMMODITY = COMMODITY.capitalize()
# For Elec
if COMMODITY == 'Electricity':
line_width_constant = .2 #Constant related to thickness of lines: the higher the number, the narrower the lines will be
Expand Down
4 changes: 2 additions & 2 deletions tests/test_postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def test_MainResults():
assert 'electricity_profile.png' in os.listdir('tests/output') and 'heat_profile.png' in os.listdir('tests/output') and 'hydrogen_profile.png' in os.listdir('tests/output')

# Test map
fig, ax = res.plot_map('SC2', 'Electricity', 2050)
fig, ax = res.plot_map('SC2', 'elecTriciTY', 2050)
fig.savefig('tests/output/electricity_map.png')
fig, ax = res.plot_map('SC2', 'Hydrogen', 2050)
fig, ax = res.plot_map('SC2', 'HYDROGEN', 2050)
fig.savefig('tests/output/hydrogen_map.png')
assert 'electricity_map.png' in os.listdir('tests/output') and 'hydrogen_map.png' in os.listdir('tests/output')

0 comments on commit abd599b

Please sign in to comment.