Skip to content

Commit

Permalink
fix(common): mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
MPavicevic committed May 2, 2023
1 parent 8055b9c commit 03d7122
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
21 changes: 2 additions & 19 deletions dispa_link/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,9 @@
'tech_heat': ['GETH', 'HOBO', 'SOTH'],
'types_CHP': ['extraction', 'back-pressure', 'p2h'],
'Fuels': ['AIR', 'BIO', 'GAS', 'HRD', 'LIG', 'NUC', 'OIL', 'PEA', 'SUN', 'WAT', 'WIN',
'WST', 'OTH', 'GEO',
'HYD', 'WHT'],
'MeritOrder': ['THMS', 'SCSP', 'BATS', 'BEVS', 'HDAM', 'HPHS', 'P2GS', 'FlowOut', 'GEO', 'NUC', 'LIG', 'HRD',
'BIO', 'GAS', 'OIL', 'PEA', 'WST', 'OTH', 'SUN', 'WIN', 'FlowIn', 'WAT', 'HYD', 'AIR', 'WHT'],
'MeritFuels': ['GEO', 'NUC', 'LIG', 'HRD', 'BIO', 'AMO', 'GAS', 'OIL', 'PEA', 'WST', 'OTH', 'SUN', 'WIN',
'WAT', 'HYD', 'AIR', 'WHT'],
'MeritOrderHeat': ['GEO', 'NUC', 'LIG', 'HRD', 'BIO', 'GAS', 'OIL', 'PEA', 'WST', 'OTH', 'SUN', 'WIN', 'WAT',
'HYD', 'AIR', 'WHT', 'HeatSlack'],
'colors': {'NUC': 'orange', 'LIG': 'brown', 'HRD': 'grey', 'BIO': 'darkgreen', 'GAS': 'lightcoral',
'OIL': 'chocolate', 'PEA': 'green', 'WST': 'dodgerblue', 'SUN': 'yellow', 'WIN': 'red',
'FlowIn': 'green', 'WAT': 'blue', 'Storage': 'blue', 'FlowOut': 'green'}}

# Hatches associated with each fuel (random):
hatches = itertools.cycle(['x', '//', '\\', '/'])
commons['hatches']: Optional[List[str]] = {}
for x in commons['colors']:
commons['hatches'][x] = next(hatches)
'WST', 'OTH', 'GEO', 'HYD', 'WHT'],
}

# %%
mapping = {}

# %%
def fix_na(series, fillzeros=True, verbose=True, name='', Nstd=4, outliers=None):
Expand Down
4 changes: 2 additions & 2 deletions dispa_link/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
'IND_BOILER_WASTE', 'IND_BOILER_COAL', 'IND_BOILER_WOOD', 'IND_BOILER_OIL', 'TS_HIGH_TEMP_Pin',
'TS_HIGH_TEMP_Pout']

common = {'ES': {}}
common: dict[str] = {'ES': {}}
common['ES']['h2_fix_dem'] = ['BUS_COACH_FC_HYBRIDH2', 'CAR_FUEL_CELL', 'TRUCK_FUEL_CELL', 'HABER_BOSCH',
'SYN_METHANOLATION', 'SYN_METHANATION', 'END_USE']
common['ES']['h2_var_dem'] = []
Expand Down Expand Up @@ -125,7 +125,7 @@

# ---------------------------------------- DICO ----------------------------------------#
# For the moment, the dico is in the file, but this will have to be read from a .txt file
mapping = {'ES': {}}
mapping: dict[str] = {'ES': {}}

# This dictionary is used to sort out wether a TECH is a PowerPlant, a CHP or a STO
mapping['ES']['SORT'] = {u'CCGT': u'ELEC',
Expand Down

0 comments on commit 03d7122

Please sign in to comment.