Skip to content

Commit

Permalink
Merge branch 'fix/#22' into features/#4-pypsa-interface
Browse files Browse the repository at this point in the history
  • Loading branch information
gplessm committed Sep 1, 2017
2 parents 45f1883 + 8cfe492 commit 89bd17a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
23 changes: 11 additions & 12 deletions edisgo/data/import_data.py
@@ -1,6 +1,6 @@
from dingo.tools.results import load_nd_from_pickle
from dingo.core.network.stations import LVStationDingo
from dingo.core.structure.regions import LVLoadAreaCentreDingo
from ding0.tools.results import load_nd_from_pickle
from ding0.core.network.stations import LVStationDing0
from ding0.core.structure.regions import LVLoadAreaCentreDing0
from ..grid.components import Load, Generator, MVDisconnectingPoint, BranchTee,\
Station, Line, Transformer
from ..grid.grids import MVGrid, LVGrid
Expand Down Expand Up @@ -214,7 +214,7 @@ def _build_mv_grid(dingo_grid, network):
# Special treatment of LVLoadAreaCenters see ...
# TODO: add a reference above for explanation of how these are treated
la_centers = [_ for _ in dingo_grid._graph.nodes()
if isinstance(_, LVLoadAreaCentreDingo)]
if isinstance(_, LVLoadAreaCentreDing0)]
aggregated, aggr_stations = _determine_aggregated_nodes(la_centers)

# Create list of load instances and add these to grid's graph
Expand Down Expand Up @@ -303,8 +303,8 @@ def _build_mv_grid(dingo_grid, network):
grid=grid)
})
for _ in dingo_grid.graph_edges()
if not any([isinstance(_['adj_nodes'][0], LVLoadAreaCentreDingo),
isinstance(_['adj_nodes'][1], LVLoadAreaCentreDingo)])]
if not any([isinstance(_['adj_nodes'][0], LVLoadAreaCentreDing0),
isinstance(_['adj_nodes'][1], LVLoadAreaCentreDing0)])]
grid.graph.add_edges_from(lines, type='line')

# Assign reference to HV-MV station to MV grid
Expand Down Expand Up @@ -454,12 +454,11 @@ def aggregate_loads(la_center, aggr):
'geom': la_center.lv_load_area.geo_area}

# Determine LV grids/ stations that are aggregated
stations = [_.lv_grid.station()
for _ in la_center.lv_load_area._lv_grid_districts]
for _ in la_center.lv_load_area._lv_grid_districts:
aggr_stations.append(_.lv_grid.station())

# add elements to lists
aggregated.append(aggr)
aggr_stations.extend(stations)


return aggregated, aggr_stations
Expand Down Expand Up @@ -607,8 +606,8 @@ def _validate_dingo_mv_grid_import(grid, dingo_grid):
'lv_station'))
data_integrity['lv_station']['dingo'] = len(
[_ for _ in dingo_grid._graph.nodes()
if isinstance(_, LVStationDingo)
and not _.lv_load_area.is_aggregated])
if (isinstance(_, LVStationDing0) and
not _.grid.grid_district.lv_load_area.is_aggregated)])

# Check number of lines outside aggregated LA
# edges_w_la = grid.graph.graph_edges()
Expand Down Expand Up @@ -822,4 +821,4 @@ def _validate_load_generation(mv_grid, dingo_mv_grid):
type=k1,
subtype=k2,
dingo=v2['dingo'],
edisgo=v2['edisgo']))
edisgo=v2['edisgo']))
10 changes: 4 additions & 6 deletions setup.py
Expand Up @@ -31,14 +31,12 @@ def create_edisgo_path():
author_email='',
description='A python package for distribution grid analysis and optimization',
install_requires = [
'dingo==0.1.0-pre+git.477bf495',
'ding0==0.1.2',
'networkx >=1.11',
'shapely >= 1.5.12, <= 1.5.12',
'pandas >=0.19.2, <=0.20.1'
'pandas >=0.20.3, <=0.20.3',
'pypsa >=0.10.0, <=0.10.0'
],
cmdclass={
'install': InstallSetup},
dependency_links=['https://github.com/openego/dingo/archive/'\
'477bf49534f93aca90ba3c5231fe726972343939.zip'\
'#egg=dingo-0.1.0-pre+git.477bf495']
'install': InstallSetup}
)

0 comments on commit 89bd17a

Please sign in to comment.