From 3e34071dd86eee642993fb162d69c4c6f6e5c652 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Mon, 9 Dec 2019 11:58:58 -0800 Subject: [PATCH 1/2] feat: support for 'biomass' and 'other' generators --- powersimdata/input/change_table.py | 12 ++++++------ powersimdata/input/grid.py | 6 +++++- powersimdata/input/scaler.py | 3 ++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/powersimdata/input/change_table.py b/powersimdata/input/change_table.py index ac2e71704..08f08c231 100644 --- a/powersimdata/input/change_table.py +++ b/powersimdata/input/change_table.py @@ -10,10 +10,10 @@ class ChangeTable(object): grid as well as to the original demand, hydro, solar and wind profiles. A pickle file enclosing the change table in form of a dictionary can be created and transferred on the server. Keys are *'demand'*, *'branch'*, - *'coal'*, *'dfo'*, *'geothermal'*, *'ng'*, *'nuclear'*, *'hydro'*, - *'solar'*, *'wind'* and *'storage'*. If a key is missing in the - dictionary, then no changes will be applied. The data structure is - given below: + *'biomass'*, *'coal'*, *'dfo'*, *'geothermal'*, *'ng'*, *'nuclear'*, + *'hydro'*, *'solar'*, *'wind'*, *'other'*, and *'storage'*. + If a key is missing in the dictionary, then no changes will be applied. + The data structure is given below: * *'demand'*: value is a dictionary. The latter has *'zone_id'* as keys and a @@ -28,8 +28,8 @@ class ChangeTable(object): desired increase/decrease of capacity of the line or the lines in the zone (1.2 would correspond to a 20% increase while 0.95 would be a 5% decrease). - * *'coal'*, *'dfo'*, *'geothermal'*, *'ng'*, *'nuclear'*, *'hydro'*, - *'solar'*, and *'wind'*: + * *'biomass'*, *'coal'*, *'dfo'*, *'geothermal'*, *'ng'*, *'nuclear'*, + *'hydro'*, *'solar'*, *'wind'*, and *'other'*: value is a dictionary. The latter has *'plant_id'* and/or *'zone_id'* as keys. The *'plant_id'* dictionary has the plant ids as keys while the *'zone_id'* dictionary has the zone ids as keys. diff --git a/powersimdata/input/grid.py b/powersimdata/input/grid.py index 16fd734c0..a21b34f66 100644 --- a/powersimdata/input/grid.py +++ b/powersimdata/input/grid.py @@ -17,7 +17,9 @@ class Grid(object): 5: 'coal', 6: 'geothermal', 7: 'dfo', - 8: 'storage'} + 8: 'biomass', + 9: 'other', + 10: 'storage'} type2id = {v: k for k, v in id2type.items()} @@ -29,6 +31,8 @@ class Grid(object): 'coal': sns.xkcd_rgb["light brown"], 'geothermal': sns.xkcd_rgb["hot pink"], 'dfo': sns.xkcd_rgb["royal blue"], + 'biomass': sns.xkcd_rgb["dark green"], + 'other': sns.xkcd_rgb["melon"], 'storage': sns.xkcd_rgb["orange"]} def __init__(self, interconnect): diff --git a/powersimdata/input/scaler.py b/powersimdata/input/scaler.py index 55fe769c2..9574c743e 100644 --- a/powersimdata/input/scaler.py +++ b/powersimdata/input/scaler.py @@ -12,7 +12,8 @@ class Scaler(object): """ _gen_types = [ - 'coal', 'dfo', 'geothermal', 'ng', 'nuclear', 'hydro', 'solar', 'wind'] + 'biomass', 'coal', 'dfo', 'geothermal', 'ng', 'nuclear', 'hydro', + 'solar', 'wind', 'other'] _thermal_gen_types = ['coal', 'dfo', 'geothermal', 'ng', 'nuclear'] def __init__(self, scenario_info, ssh_client): From d5c36b36304c52d65a772f5dc683248ee303a4f8 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Fri, 13 Dec 2019 10:20:09 -0800 Subject: [PATCH 2/2] fix: allow biomass and other in change_table --- powersimdata/input/change_table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powersimdata/input/change_table.py b/powersimdata/input/change_table.py index 08f08c231..a21ab2e96 100644 --- a/powersimdata/input/change_table.py +++ b/powersimdata/input/change_table.py @@ -65,7 +65,7 @@ def _check_resource(resource): """ possible = [ 'coal', 'dfo', 'geothermal', 'ng', 'nuclear', - 'hydro', 'solar', 'wind'] + 'hydro', 'solar', 'wind', 'biomass', 'other'] if resource not in possible: print("-----------------------") print("Possible Generator type")