Skip to content

Commit

Permalink
Slight change to grids, to make model less heavy
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias157 committed Oct 14, 2024
1 parent c7ccbbd commit 4771438
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Binary file modified src/Analysis/preprocessing_dag.pdf
Binary file not shown.
9 changes: 3 additions & 6 deletions src/Modules/grids.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def create_grid_incfiles(d: pd.DataFrame,
XE.index.name = ''

# Add year
XE.index = '2016 . ' + XE.index
XE.index = '2050 . ' + XE.index

# Delete zeros
XE = XE.replace(0, '')
Expand All @@ -113,7 +113,6 @@ def create_grid_incfiles(d: pd.DataFrame,
dfAsString = XE.to_string(header=True, index=True)
f.write(dfAsString)
f.write('\n;')
f.write("\n%sINVCOST(YYY,IRRRE,IRRRI) = %sINVCOST('2016',IRRRE,IRRRI);"%(carrier_symbol, carrier_symbol))


### 4.3 Energy losses
Expand Down Expand Up @@ -589,14 +588,13 @@ def get_distance_matrix2(areas: gpd.GeoDataFrame,
### 2.6 Save XKFX
XKFX.columns.name = ''
XKFX.index.name = ''
XKFX.index = '2016 . ' + XKFX.index
XKFX.index = '2050 . ' + XKFX.index
XKFX = XKFX.astype(str).replace('0', '')
with open('./Output/XKFX.inc', 'w') as f:
f.write("TABLE XKFX(YYY,IRRRE,IRRRI) 'Initial transmission capacity between regions'\n")
dfAsString = XKFX.to_string(header=True, index=True)
f.write(dfAsString)
f.write('\n;\n')
f.write("XKFX(YYY,IRRRE,IRRRI)$(YYY.VAL GT 2016) = XKFX('2016',IRRRE,IRRRI);")

"""
What's missing in the municipality model, due to lacking method of connecting overseas regions:
Expand Down Expand Up @@ -655,7 +653,7 @@ def get_distance_matrix2(areas: gpd.GeoDataFrame,
XE.index.name = ''

# Add year
XE.index = '2016 . ' + XE.index
XE.index = '2050 . ' + XE.index

# Delete zeros
XE = XE.replace(0, '')
Expand All @@ -665,7 +663,6 @@ def get_distance_matrix2(areas: gpd.GeoDataFrame,
dfAsString = XE.to_string(header=True, index=True)
f.write(dfAsString)
f.write('\n;')
f.write("\nXINVCOST(YYY,IRRRE,IRRRI) = XINVCOST('2016',IRRRE,IRRRI);")


### 4.3 Energy losses
Expand Down
3 changes: 2 additions & 1 deletion src/preprocessing
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ rule grids:
[
f"{data_path}BalmorelData/municipal_connectivity.nc",
f"{submod_path}exo_grid_conversion_dictionaries.pkl",
f"assumptions.yaml"
f"assumptions.yaml",
f"{modules_path}grids.py"
]
params:
nordsoeen_connection=config['grid_assumptions']['electricity']['nordsoeen_connection']
Expand Down

0 comments on commit 4771438

Please sign in to comment.