From 7f0e28b89e27c8da2f25bcc776fdabdb7994b1d9 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Mon, 17 May 2021 16:18:45 +0200 Subject: [PATCH 01/25] migrate from geopy's vincenty() to distance() --- ding0/core/network/grids.py | 4 ++-- ding0/grid/lv_grid/lv_connect.py | 4 ++-- ding0/grid/mv_grid/mv_connect.py | 22 +++++++++++----------- ding0/grid/mv_grid/mv_routing.py | 6 +++--- ding0/tools/geo.py | 21 ++++++++++----------- 5 files changed, 28 insertions(+), 29 deletions(-) diff --git a/ding0/core/network/grids.py b/ding0/core/network/grids.py index 4d9daf76..9736a6d8 100644 --- a/ding0/core/network/grids.py +++ b/ding0/core/network/grids.py @@ -22,7 +22,7 @@ from ding0.grid.mv_grid import mv_routing, mv_connect from ding0.grid.lv_grid import build_grid, lv_connect from ding0.tools import config as cfg_ding0, pypsa_io, tools -from ding0.tools.geo import calc_geo_dist_vincenty +from ding0.tools.geo import calc_geo_dist from ding0.grid.mv_grid.tools import set_circuit_breakers from ding0.flexopt.reinforce_grid import * from ding0.core.structure.regions import LVLoadAreaCentreDing0 @@ -501,7 +501,7 @@ def set_voltage_level(self, mode='distance'): for node in self.graph_nodes_sorted(): if isinstance(node, LVLoadAreaCentreDing0): # calc distance from MV-LV station to LA centre - dist_node = calc_geo_dist_vincenty(self.station(), node) / 1e3 + dist_node = calc_geo_dist(self.station(), node) / 1e3 if dist_node > dist_max: dist_max = dist_node diff --git a/ding0/grid/lv_grid/lv_connect.py b/ding0/grid/lv_grid/lv_connect.py index ceaac0e6..351ac83f 100644 --- a/ding0/grid/lv_grid/lv_connect.py +++ b/ding0/grid/lv_grid/lv_connect.py @@ -16,7 +16,7 @@ from ding0.core.network import BranchDing0 from ding0.tools import config as cfg_ding0 -from ding0.tools.geo import calc_geo_dist_vincenty +from ding0.tools.geo import calc_geo_dist from ding0.grid.tools import cable_type import logging import random @@ -78,7 +78,7 @@ def lv_connect_generators(lv_grid_district, graph, debug=False): if generator.v_level == 6: lv_station = lv_grid_district.lv_grid.station() - branch_length = calc_geo_dist_vincenty(generator, lv_station) + branch_length = calc_geo_dist(generator, lv_station) branch_type = cable_type( generator.capacity / (cable_lf * cos_phi_gen), v_nom, diff --git a/ding0/grid/mv_grid/mv_connect.py b/ding0/grid/mv_grid/mv_connect.py index 93e385bc..015b9544 100644 --- a/ding0/grid/mv_grid/mv_connect.py +++ b/ding0/grid/mv_grid/mv_connect.py @@ -25,7 +25,7 @@ from ding0.core.structure.groups import LoadAreaGroupDing0 from ding0.core.structure.regions import LVLoadAreaCentreDing0 from ding0.tools import config as cfg_ding0 -from ding0.tools.geo import calc_geo_branches_in_buffer,calc_geo_dist_vincenty,\ +from ding0.tools.geo import calc_geo_branches_in_buffer,calc_geo_dist,\ calc_geo_centre_point, calc_geo_branches_in_polygon if not 'READTHEDOCS' in os.environ: @@ -407,7 +407,7 @@ def connect_node(node, node_shp, mv_grid, target_obj, proj, graph, conn_dist_rin # along node) graph.remove_edge(adj_node1, adj_node2) - branch_length = calc_geo_dist_vincenty(adj_node1, node) + branch_length = calc_geo_dist(adj_node1, node) branch = BranchDing0(length=branch_length, circuit_breaker=circ_breaker, kind=branch_kind, @@ -418,7 +418,7 @@ def connect_node(node, node_shp, mv_grid, target_obj, proj, graph, conn_dist_rin circ_breaker.branch = branch graph.add_edge(adj_node1, node, branch=branch) - branch_length = calc_geo_dist_vincenty(adj_node2, node) + branch_length = calc_geo_dist(adj_node2, node) graph.add_edge(adj_node2, node, branch=BranchDing0(length=branch_length, kind=branch_kind, grid=mv_grid, @@ -456,7 +456,7 @@ def connect_node(node, node_shp, mv_grid, target_obj, proj, graph, conn_dist_rin graph.remove_edge(adj_node1, adj_node2) - branch_length = calc_geo_dist_vincenty(adj_node1, cable_dist) + branch_length = calc_geo_dist(adj_node1, cable_dist) branch = BranchDing0(length=branch_length, circuit_breaker=circ_breaker, kind=branch_kind, @@ -467,7 +467,7 @@ def connect_node(node, node_shp, mv_grid, target_obj, proj, graph, conn_dist_rin circ_breaker.branch = branch graph.add_edge(adj_node1, cable_dist, branch=branch) - branch_length = calc_geo_dist_vincenty(adj_node2, cable_dist) + branch_length = calc_geo_dist(adj_node2, cable_dist) graph.add_edge(adj_node2, cable_dist, branch=BranchDing0(length=branch_length, kind=branch_kind, grid=mv_grid, @@ -481,7 +481,7 @@ def connect_node(node, node_shp, mv_grid, target_obj, proj, graph, conn_dist_rin branch_kind = mv_grid.default_branch_kind branch_type = mv_grid.default_branch_type - branch_length = calc_geo_dist_vincenty(node, cable_dist) + branch_length = calc_geo_dist(node, cable_dist) graph.add_edge(node, cable_dist, branch=BranchDing0(length=branch_length, kind=branch_kind, grid=mv_grid, @@ -529,7 +529,7 @@ def connect_node(node, node_shp, mv_grid, target_obj, proj, graph, conn_dist_rin branch_ring = mv_grid.get_ring_from_node(target_obj['obj']) # add new branch for satellite (station to station) - branch_length = calc_geo_dist_vincenty(node, target_obj['obj']) + branch_length = calc_geo_dist(node, target_obj['obj']) graph.add_edge(node, target_obj['obj'], branch=BranchDing0(length=branch_length, kind=branch_kind, grid=mv_grid, @@ -576,7 +576,7 @@ def disconnect_node(node, target_obj_result, graph, debug): if len(neighbor_nodes) == 2: node.grid.remove_cable_distributor(target_obj_result) - branch_length = calc_geo_dist_vincenty(neighbor_nodes[0], neighbor_nodes[1]) + branch_length = calc_geo_dist(neighbor_nodes[0], neighbor_nodes[1]) graph.add_edge(neighbor_nodes[0], neighbor_nodes[1], branch=BranchDing0(length=branch_length, kind=branch_kind, grid=node.grid, @@ -793,7 +793,7 @@ def mv_connect_stations(mv_grid_district, graph, debug=False): # delete old branch to Load Area centre and create a new one to LV station graph.remove_edge(lv_load_area_centre, node) - branch_length = calc_geo_dist_vincenty(lv_station, node) + branch_length = calc_geo_dist(lv_station, node) branch = BranchDing0(length=branch_length, circuit_breaker=circ_breaker, kind=branch_kind, @@ -876,7 +876,7 @@ def mv_connect_stations(mv_grid_district, graph, debug=False): # delete old branch to Load Area centre and create a new one to LV station graph.remove_edge(lv_load_area_centre, node) - branch_length = calc_geo_dist_vincenty(cable_dist, node) + branch_length = calc_geo_dist(cable_dist, node) branch = BranchDing0(length=branch_length, circuit_breaker=circ_breaker, kind=branch_kind, @@ -947,7 +947,7 @@ def mv_connect_generators(mv_grid_district, graph, debug=False): if generator.v_level == 4: mv_station = mv_grid_district.mv_grid.station() - branch_length = calc_geo_dist_vincenty(generator, mv_station) + branch_length = calc_geo_dist(generator, mv_station) # TODO: set branch type to something reasonable (to be calculated) branch_kind = mv_grid_district.mv_grid.default_branch_kind diff --git a/ding0/grid/mv_grid/mv_routing.py b/ding0/grid/mv_grid/mv_routing.py index cb3cdd77..88601eb6 100644 --- a/ding0/grid/mv_grid/mv_routing.py +++ b/ding0/grid/mv_grid/mv_routing.py @@ -18,7 +18,7 @@ from ding0.grid.mv_grid.models.models import Graph, Node from ding0.grid.mv_grid.util import util, data_input from ding0.grid.mv_grid.solvers import savings, local_search -from ding0.tools.geo import calc_geo_dist_vincenty, calc_geo_dist_matrix_vincenty, calc_geo_centre_point +from ding0.tools.geo import calc_geo_dist, calc_geo_dist_matrix, calc_geo_centre_point from ding0.tools import config as cfg_ding0 from ding0.core.network.stations import * from ding0.core.structure.regions import LVLoadAreaCentreDing0 @@ -93,7 +93,7 @@ def ding0_graph_to_routing_specs(graph): specs['NODE_COORD_SECTION'] = nodes_pos specs['DEMAND'] = nodes_demands - specs['MATRIX'] = calc_geo_dist_matrix_vincenty(nodes_pos) + specs['MATRIX'] = calc_geo_dist_matrix(nodes_pos) specs['IS_AGGREGATED'] = nodes_agg return specs @@ -204,7 +204,7 @@ def routing_solution_to_ding0_graph(graph, solution): node1.lv_load_area.ring = ring # set branch length - b.length = calc_geo_dist_vincenty(node1, node2) + b.length = calc_geo_dist(node1, node2) # set branch kind and type # 1) default diff --git a/ding0/tools/geo.py b/ding0/tools/geo.py index 4096d443..a89feb02 100644 --- a/ding0/tools/geo.py +++ b/ding0/tools/geo.py @@ -14,7 +14,7 @@ import os -from geopy.distance import vincenty +from geopy.distance import geodesic import pyproj from functools import partial @@ -116,7 +116,7 @@ def calc_geo_branches_in_buffer(node, mv_grid, radius, radius_inc, proj): return branches -def calc_geo_dist_vincenty(node_source, node_target): +def calc_geo_dist(node_source, node_target): """ Calculates the geodesic distance between `node_source` and `node_target` incorporating the detour factor specified in :file:`ding0/ding0/config/config_calc.cfg`. @@ -135,8 +135,8 @@ def calc_geo_dist_vincenty(node_source, node_target): branch_detour_factor = cfg_ding0.get('assumptions', 'branch_detour_factor') - # notice: vincenty takes (lat,lon) - branch_length = branch_detour_factor * vincenty((node_source.geo_data.y, node_source.geo_data.x), + # notice: geodesic takes (lat,lon) + branch_length = branch_detour_factor * geodesic((node_source.geo_data.y, node_source.geo_data.x), (node_target.geo_data.y, node_target.geo_data.x)).m # ========= BUG: LINE LENGTH=0 WHEN CONNECTING GENERATORS =========== @@ -152,14 +152,13 @@ def calc_geo_dist_vincenty(node_source, node_target): return branch_length -def calc_geo_dist_matrix_vincenty(nodes_pos): +def calc_geo_dist_matrix(nodes_pos): """ Calculates the geodesic distance between all nodes in `nodes_pos` incorporating the detour factor in config_calc.cfg. - For every two points/coord it uses geopy's vincenty function (formula devised by Thaddeus Vincenty, - with an accurate ellipsoidal model of the earth). As default ellipsoidal model of the earth WGS-84 is used. + For every two points/coord it uses geopy's geodesic function. As default ellipsoidal model of the earth WGS-84 is used. For more options see - https://geopy.readthedocs.org/en/1.10.0/index.html?highlight=vincenty#geopy.distance.vincenty + https://geopy.readthedocs.io/en/stable/index.html?highlight=geodesic#geopy.distance.geodesic Parameters ---------- @@ -196,8 +195,8 @@ def calc_geo_dist_matrix_vincenty(nodes_pos): for j in nodes_pos: pos_dest = tuple(nodes_pos[j]) - # notice: vincenty takes (lat,lon), thus the (x,y)/(lon,lat) tuple is reversed - distance = branch_detour_factor * vincenty(tuple(reversed(pos_origin)), tuple(reversed(pos_dest))).km + # notice: geodesic takes (lat,lon), thus the (x,y)/(lon,lat) tuple is reversed + distance = branch_detour_factor * geodesic(tuple(reversed(pos_origin)), tuple(reversed(pos_dest))).km matrix[i][j] = distance return matrix @@ -233,7 +232,7 @@ def calc_geo_centre_point(node_source, node_target): branch_shp = transform(proj_source, LineString([node_source.geo_data, node_target.geo_data])) - distance = vincenty((node_source.geo_data.y, node_source.geo_data.x), + distance = geodesic((node_source.geo_data.y, node_source.geo_data.x), (node_target.geo_data.y, node_target.geo_data.x)).m centre_point_shp = transform(proj_target, branch_shp.interpolate(distance/2)) From 33e76413f600d4d017d3aba5dd3833edcad1a265 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Mon, 17 May 2021 17:05:27 +0200 Subject: [PATCH 02/25] add pytest-parallel to dev reqs --- dev_requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dev_requirements.txt b/dev_requirements.txt index 5c6e7ba8..c5a08e72 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,4 +1,5 @@ pytest pytest-dependency +pytest-parallel sphinx sphinx_rtd_theme \ No newline at end of file From 72e01584f1838f5420d55777c1afe5597126c500 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Mon, 17 May 2021 17:09:41 +0200 Subject: [PATCH 03/25] fix creation of pandas' DatetimeIndex --- ding0/core/powerflow/__init__.py | 8 ++++---- ding0/tools/pypsa_io.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ding0/core/powerflow/__init__.py b/ding0/core/powerflow/__init__.py index 2a3e8432..02436c8f 100644 --- a/ding0/core/powerflow/__init__.py +++ b/ding0/core/powerflow/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime -from pandas import DatetimeIndex +from pandas import DatetimeIndex, date_range class PFConfigDing0: @@ -74,9 +74,9 @@ def __init__(self, **kwargs): # create pandas DatetimeIndex object for given values self._timeranges = [] for _ in enumerate(self._scenarios): - self._timeranges.append(DatetimeIndex(freq=self._resolution, - periods=timesteps_count, - start=timestep_start)) + self._timeranges.append(date_range(freq=self._resolution, + periods=timesteps_count, + start=timestep_start)) elif len(self._scenarios) != len(self._timeranges): raise ValueError('PF config: Count of scenarios has to equal count of timeranges.') diff --git a/ding0/tools/pypsa_io.py b/ding0/tools/pypsa_io.py index caa79b0b..aeb226c5 100644 --- a/ding0/tools/pypsa_io.py +++ b/ding0/tools/pypsa_io.py @@ -31,7 +31,7 @@ from geoalchemy2.shape import from_shape from math import tan, acos, pi, sqrt -from pandas import Series, DataFrame, DatetimeIndex +from pandas import Series, DataFrame, date_range from pypsa.io import import_series_from_dataframe from pypsa import Network from shapely.geometry import Point @@ -1317,9 +1317,9 @@ def run_powerflow_onthefly(components, components_data, grid, data_integrity(components, components_data) # define investigated time range - timerange = DatetimeIndex(freq=resolution, - periods=timesteps, - start=start_time) + timerange = date_range(freq=resolution, + periods=timesteps, + start=start_time) # TODO: Instead of hard coding PF config, values from class PFConfigDing0 # can be used here. From 6df9fce312d12668f3463935a009e696c1308e28 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Tue, 18 May 2021 11:12:35 +0200 Subject: [PATCH 04/25] fix graphml test data due to changed file format --- ...rid_mv_connect_generators_expected.graphml | 144 +++++++++--------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/tests/test_data/grid_mv_connect_generators_expected.graphml b/tests/test_data/grid_mv_connect_generators_expected.graphml index e53d960e..35b8d96c 100644 --- a/tests/test_data/grid_mv_connect_generators_expected.graphml +++ b/tests/test_data/grid_mv_connect_generators_expected.graphml @@ -1,15 +1,15 @@ - - - - - - - - - - + + + + + + + + + + @@ -47,8 +47,8 @@ - 'mv_grid_0' - 13778.969533166168 + mv_grid_0 + 13778.978047867522 line 48-AL1/8-ST1A 20 @@ -58,8 +58,8 @@ 0.0098 - 'mv_grid_0' - 38338.98762038968 + mv_grid_0 + 38339.02005888106 line 48-AL1/8-ST1A 20 @@ -69,8 +69,8 @@ 0.0098 - 'mv_grid_0' - 44574.621997364935 + mv_grid_0 + 44574.65321549841 line 48-AL1/8-ST1A 20 @@ -80,8 +80,8 @@ 0.0098 - 'mv_grid_0' - 5513.892738953686 + mv_grid_0 + 5513.896144897531 line 48-AL1/8-ST1A 20 @@ -91,8 +91,8 @@ 0.0098 - 'mv_grid_0' - 16077.998189026202 + mv_grid_0 + 16078.003272121707 line 48-AL1/8-ST1A 20 @@ -102,8 +102,8 @@ 0.0098 - 'mv_grid_0' - 21538.98886916947 + mv_grid_0 + 21538.994758563163 line 48-AL1/8-ST1A 20 @@ -113,8 +113,8 @@ 0.0098 - 'mv_grid_0' - 13778.969533166168 + mv_grid_0 + 13778.978047867522 line 48-AL1/8-ST1A 20 @@ -124,8 +124,8 @@ 0.0098 - 'mv_grid_0' - 38338.98762038968 + mv_grid_0 + 38339.02005888106 line 48-AL1/8-ST1A 20 @@ -135,8 +135,8 @@ 0.0098 - 'mv_grid_0' - 44574.621997364935 + mv_grid_0 + 44574.65321549841 line 48-AL1/8-ST1A 20 @@ -146,8 +146,8 @@ 0.0098 - 'mv_grid_0' - 5516.965603800298 + mv_grid_0 + 5516.969009803307 line 48-AL1/8-ST1A 20 @@ -157,8 +157,8 @@ 0.0098 - 'mv_grid_0' - 16082.214222420695 + mv_grid_0 + 16082.219207948681 line 48-AL1/8-ST1A 20 @@ -168,8 +168,8 @@ 0.0098 - 'mv_grid_0' - 16088.521763265371 + mv_grid_0 + 16088.536598926754 line 48-AL1/8-ST1A 20 @@ -179,8 +179,8 @@ 0.0098 - 'mv_grid_0' - 5513.892738953839 + mv_grid_0 + 5513.896144897531 line 48-AL1/8-ST1A 20 @@ -190,7 +190,7 @@ 0.0098 - 'mv_grid_0' + mv_grid_0 1 line 48-AL1/8-ST1A @@ -201,7 +201,7 @@ 0.0098 - 'mv_grid_0' + mv_grid_0 1 line 48-AL1/8-ST1A @@ -212,7 +212,7 @@ 0.0098 - 'mv_grid_0' + mv_grid_0 1 line 48-AL1/8-ST1A @@ -223,8 +223,8 @@ 0.0098 - 'mv_grid_0' - 11693.472599764602 + mv_grid_0 + 11693.483853825253 line 48-AL1/8-ST1A 20 @@ -234,8 +234,8 @@ 0.0098 - 'mv_grid_0' - 11673.90868108486 + mv_grid_0 + 11673.919910575649 line 48-AL1/8-ST1A 20 @@ -245,8 +245,8 @@ 0.0098 - 'mv_grid_0' - 11699.996757584164 + mv_grid_0 + 11699.99999654535 line 48-AL1/8-ST1A 20 @@ -256,8 +256,8 @@ 0.0098 - 'mv_grid_0' - 18508.06998862247 + mv_grid_0 + 18508.076227984075 line 48-AL1/8-ST1A 20 @@ -267,8 +267,8 @@ 0.0098 - 'mv_grid_0' - 11726.027430271868 + mv_grid_0 + 11726.038724984652 line 48-AL1/8-ST1A 20 @@ -278,8 +278,8 @@ 0.0098 - 'mv_grid_0' - 11699.996859580739 + mv_grid_0 + 11699.999996564226 line 48-AL1/8-ST1A 20 @@ -289,8 +289,8 @@ 0.0098 - 'mv_grid_0' - 2727.1754010604313 + mv_grid_0 + 2727.17127371167 line 48-AL1/8-ST1A 20 @@ -300,8 +300,8 @@ 0.0098 - 'mv_grid_0' - 5530.769630927678 + mv_grid_0 + 5530.773027601033 line 48-AL1/8-ST1A 20 @@ -311,8 +311,8 @@ 0.0098 - 'mv_grid_0' - 2764.71451061956 + mv_grid_0 + 2764.7162362310705 line 48-AL1/8-ST1A 20 @@ -322,8 +322,8 @@ 0.0098 - 'mv_grid_0' - 3899.998984507848 + mv_grid_0 + 3899.9999997158393 line 48-AL1/8-ST1A 20 @@ -333,8 +333,8 @@ 0.0098 - 'mv_grid_0' - 2762.307541243976 + mv_grid_0 + 2762.3092302135738 line 48-AL1/8-ST1A 20 @@ -344,8 +344,8 @@ 0.0098 - 'mv_grid_0' - 2752.3914325650644 + mv_grid_0 + 2752.3911923495984 line 48-AL1/8-ST1A 20 @@ -355,8 +355,8 @@ 0.0098 - 'mv_grid_0' - 5524.641050120628 + mv_grid_0 + 5524.644437298107 line 48-AL1/8-ST1A 20 @@ -366,8 +366,8 @@ 0.0098 - 'mv_grid_0' - 2794.3971950635623 + mv_grid_0 + 2794.40470952057 line 48-AL1/8-ST1A 20 @@ -377,8 +377,8 @@ 0.0098 - 'mv_grid_0' - 2773.78084502531 + mv_grid_0 + 2773.784479525642 line 48-AL1/8-ST1A 20 @@ -388,7 +388,7 @@ 0.0098 - 'mv_grid_0' + mv_grid_0 1 line 48-AL1/8-ST1A @@ -399,7 +399,7 @@ 0.0098 - 'mv_grid_0' + mv_grid_0 1 line 48-AL1/8-ST1A @@ -410,7 +410,7 @@ 0.0098 - 'mv_grid_0' + mv_grid_0 1 line 48-AL1/8-ST1A From 81c0a77c0c338da60ba8909c5120cebaa54cb80e Mon Sep 17 00:00:00 2001 From: nesnoj Date: Tue, 18 May 2021 11:14:47 +0200 Subject: [PATCH 05/25] mv snippet --- tests/grid/test_grid.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/grid/test_grid.py b/tests/grid/test_grid.py index 7587bb11..002a2e0b 100644 --- a/tests/grid/test_grid.py +++ b/tests/grid/test_grid.py @@ -35,16 +35,17 @@ def test_mv_connect_generators(): d.pop("branch", None) nx.set_edge_attributes(graph, edges) + expected_file_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "test_data")) + # Snippet to export new comparison graph: # graph_new = nx.Graph() # graph_new.add_nodes_from([repr(n) for n in graph.nodes()]) # for n1, n2, a in graph.edges(data=True): # a['grid'] = repr(a['grid']) # graph_new.add_edge(repr(n1), repr(n2), **a) - # nx.write_graphml(graph_new, os.path.join(expected_file_path, "grid_mv_connect_generators_expected.graphml") + # nx.write_graphml(graph_new, os.path.join(expected_file_path, "grid_mv_connect_generators_expected.graphml")) # Get comparison data (expected) and compare all attributes - expected_file_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "test_data")) expected_graph = read_graphml(os.path.join( expected_file_path, "grid_mv_connect_generators_expected.graphml")) From de83409d95e99fd34653d23353501de6ec26b364 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Tue, 18 May 2021 12:17:00 +0200 Subject: [PATCH 06/25] fix tests by explicitly adding index name --- ding0/tools/results.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ding0/tools/results.py b/ding0/tools/results.py index f9c98eed..df5f155d 100644 --- a/ding0/tools/results.py +++ b/ding0/tools/results.py @@ -1037,6 +1037,7 @@ def calculate_mvgd_stats(nw): ################################### mvgd_stats = mvgd_stats.fillna(0) mvgd_stats = mvgd_stats[sorted(mvgd_stats.columns.tolist())] + mvgd_stats.index.name = 'grid_id' return mvgd_stats From a4294bae262058ee77fde664eb63ab3c53ec1f36 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Tue, 18 May 2021 12:27:30 +0200 Subject: [PATCH 07/25] test update requirements --- requirements.txt | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/requirements.txt b/requirements.txt index 1a61a653..e4fbe849 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,15 @@ -networkx == 2.4 -geopy >= 1.11.0, <= 1.11.0 -pandas >= 0.20.3, <= 0.23.0 -pyproj == 2.2.0 -sqlalchemy >= 1.0.11, <= 1.2.0 -geoalchemy2 >= 0.2.6, <= 0.4.1 -matplotlib >= 1.5.3, <= 2.1.2 +networkx +geopy +pandas +pyproj +sqlalchemy == 1.3.24 +geoalchemy2 +matplotlib egoio @ git+https://github.com/openego/ego.io.git@ab327e3c8bdb53b5205af84b41b02700f6d3fb20#egg=egoio -shapely >= 1.5.12, <= 1.7 -pypsa >= 0.11.0, <= 0.11.0 -seaborn == 0.10.1 -unittest2 == 1.1.0 -oedialect == 0.0.6.dev0 -geopandas == 0.7.0 -descartes == 1.1.0 +shapely +pypsa +seaborn +unittest2 +oedialect +geopandas +descartes \ No newline at end of file From 4b19f9da3609c1fc30f5ec9d8ad17ea8d4a2358f Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 09:54:45 +0200 Subject: [PATCH 08/25] split matching edge attributes into numerical and catergorical --- tests/grid/test_grid.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/grid/test_grid.py b/tests/grid/test_grid.py index 002a2e0b..d7a2158e 100644 --- a/tests/grid/test_grid.py +++ b/tests/grid/test_grid.py @@ -2,8 +2,9 @@ from ding0.grid.mv_grid import mv_connect from networkx.readwrite.graphml import read_graphml import networkx as nx -from networkx.algorithms.isomorphism import categorical_edge_match +from networkx.algorithms.isomorphism import categorical_edge_match, numerical_edge_match import os +import numbers def test_mv_connect_generators(): @@ -26,7 +27,7 @@ def test_mv_connect_generators(): for k, v in edges.items(): edge_attrs = v.__dict__ edge_attrs.update(**edge_attrs["type"].to_dict()) - for kk in ["type", "ring", "branch", "circuit_breaker"]: + for kk in ["type", "ring", "branch", "circuit_breaker", "grid"]: edge_attrs.pop(kk, None) edge_attrs = {k1: v1 for k1, v1 in edge_attrs.items() if v1} edges[k] = edge_attrs @@ -49,6 +50,13 @@ def test_mv_connect_generators(): expected_graph = read_graphml(os.path.join( expected_file_path, "grid_mv_connect_generators_expected.graphml")) - attr_names = [_ for _ in edge_attrs.keys() if _ != 'grid'] - em = categorical_edge_match(attr_names, [0] * len(attr_names)) - assert nx.is_isomorphic(graph, expected_graph, edge_match=em) + + # distinct categorical and numeric attrs + edge_attrs_num = [a for a in edge_attrs if isinstance(list(edges.values())[0].get(a, None), numbers.Number)] + edge_attrs_cat = [a for a in edge_attrs if a not in edge_attrs_num] + + em_cat = categorical_edge_match(edge_attrs_cat, [0] * len(edge_attrs_cat)) + em_num = numerical_edge_match(edge_attrs_num, [0] * len(edge_attrs_num), rtol=1e-3) + + assert nx.is_isomorphic(graph, expected_graph, edge_match=em_cat) + assert nx.is_isomorphic(graph, expected_graph, edge_match=em_num) From 9782913effcce61b81525bdc799312a36c712f25 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 10:52:16 +0200 Subject: [PATCH 09/25] update SPDX classifier --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0efd991f..ebcf63a3 100644 --- a/setup.py +++ b/setup.py @@ -82,6 +82,6 @@ def read(fname): "License :: OSI Approved :: GNU Affero General Public License v3", "Natural Language :: English", "Operating System :: POSIX :: Linux", - "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.8", "Topic :: Scientific/Engineering"], ) From 17694df37d122752a4265a7dfcc771e64dc3be8f Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 11:47:07 +0200 Subject: [PATCH 10/25] change way of CRS transformation method due to pyproj update --- ding0/core/network/grids.py | 10 +++------- ding0/grid/mv_grid/mv_connect.py | 14 +++----------- ding0/tools/geo.py | 15 ++++----------- ding0/tools/results.py | 17 +++-------------- 4 files changed, 13 insertions(+), 43 deletions(-) diff --git a/ding0/core/network/grids.py b/ding0/core/network/grids.py index 9736a6d8..a5d947fd 100644 --- a/ding0/core/network/grids.py +++ b/ding0/core/network/grids.py @@ -29,11 +29,10 @@ from ding0.tools.pypsa_io import initialize_component_dataframes, fill_mvgd_component_dataframes import os +import logging import networkx as nx from datetime import datetime -import pyproj -from functools import partial -import logging +from pyproj import Transformer if not 'READTHEDOCS' in os.environ: from shapely.ops import transform @@ -469,10 +468,7 @@ def set_voltage_level(self, mode='distance'): # transform MVGD's area to epsg 3035 # to achieve correct area calculation - projection = partial( - pyproj.transform, - pyproj.Proj(init='epsg:4326'), # source coordinate system - pyproj.Proj(init='epsg:3035')) # destination coordinate system + projection = Transformer.from_crs("epsg:4326", "epsg:3035", always_xy=True).transform # calculate load density kw2mw = 1e-3 diff --git a/ding0/grid/mv_grid/mv_connect.py b/ding0/grid/mv_grid/mv_connect.py index 015b9544..0ba95f79 100644 --- a/ding0/grid/mv_grid/mv_connect.py +++ b/ding0/grid/mv_grid/mv_connect.py @@ -14,10 +14,9 @@ import os -import pyproj -from functools import partial import time import logging +from pyproj import Transformer from ding0.core.network.stations import * from ding0.core.network import BranchDing0, GeneratorDing0 @@ -663,16 +662,9 @@ def mv_connect_satellites(mv_grid, graph, mode='normal', debug=False): start = time.time() # WGS84 (conformal) to ETRS (equidistant) projection - proj1 = partial( - pyproj.transform, - pyproj.Proj(init='epsg:4326'), # source coordinate system - pyproj.Proj(init='epsg:3035')) # destination coordinate system - + proj1 = Transformer.from_crs("epsg:4326", "epsg:3035", always_xy=True).transform # ETRS (equidistant) to WGS84 (conformal) projection - proj2 = partial( - pyproj.transform, - pyproj.Proj(init='epsg:3035'), # source coordinate system - pyproj.Proj(init='epsg:4326')) # destination coordinate system + proj2 = Transformer.from_crs("epsg:3035", "epsg:4326", always_xy=True).transform # check all nodes if mode == 'normal': diff --git a/ding0/tools/geo.py b/ding0/tools/geo.py index a89feb02..9e1a10c3 100644 --- a/ding0/tools/geo.py +++ b/ding0/tools/geo.py @@ -15,8 +15,7 @@ import os from geopy.distance import geodesic -import pyproj -from functools import partial +from pyproj import Transformer from ding0.tools import config as cfg_ding0 import logging @@ -219,16 +218,10 @@ def calc_geo_centre_point(node_source, node_target): Distance in m. """ - proj_source = partial( - pyproj.transform, - pyproj.Proj(init='epsg:4326'), # source coordinate system - pyproj.Proj(init='epsg:3035')) # destination coordinate system - + # WGS84 (conformal) to ETRS (equidistant) projection + proj_source = Transformer.from_crs("epsg:4326", "epsg:3035", always_xy=True).transform # ETRS (equidistant) to WGS84 (conformal) projection - proj_target = partial( - pyproj.transform, - pyproj.Proj(init='epsg:3035'), # source coordinate system - pyproj.Proj(init='epsg:4326')) # destination coordinate system + proj_target = Transformer.from_crs("epsg:3035", "epsg:4326", always_xy=True).transform branch_shp = transform(proj_source, LineString([node_source.geo_data, node_target.geo_data])) diff --git a/ding0/tools/results.py b/ding0/tools/results.py index df5f155d..d79f3812 100644 --- a/ding0/tools/results.py +++ b/ding0/tools/results.py @@ -32,8 +32,7 @@ from ding0.core.network.loads import LVLoadDing0 from ding0.core import LVLoadAreaCentreDing0 -import pyproj -from functools import partial +from pyproj import Transformer from geoalchemy2.shape import from_shape from sqlalchemy.orm import sessionmaker @@ -294,12 +293,7 @@ def calculate_lvgd_stats(nw): """ ############################## # ETRS (equidistant) to WGS84 (conformal) projection - proj = partial( - pyproj.transform, - # pyproj.Proj(init='epsg:3035'), # source coordinate system - # pyproj.Proj(init='epsg:4326')) # destination coordinate system - pyproj.Proj(init='epsg:4326'), # source coordinate system - pyproj.Proj(init='epsg:3035')) # destination coordinate system + proj = Transformer.from_crs("epsg:4326", "epsg:3035", always_xy=True).transform ############################## # close circuit breakers nw.control_circuit_breakers(mode='close') @@ -815,12 +809,7 @@ def calculate_mvgd_stats(nw): # geographic # ETRS (equidistant) to WGS84 (conformal) projection - proj = partial( - pyproj.transform, - # pyproj.Proj(init='epsg:3035'), # source coordinate system - # pyproj.Proj(init='epsg:4326')) # destination coordinate system - pyproj.Proj(init='epsg:4326'), # source coordinate system - pyproj.Proj(init='epsg:3035')) # destination coordinate system + proj = Transformer.from_crs("epsg:4326", "epsg:3035", always_xy=True).transform district_geo = transform(proj, district.geo_data) other_nodes_dict[district.mv_grid.id_db].update({'Dist_area': district_geo.area}) From 1873d3351bcc9dc9983a35fcac9fa9f7d7715d47 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 11:52:39 +0200 Subject: [PATCH 11/25] fix overlooked parts --- ding0/grid/mv_grid/mv_connect.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/ding0/grid/mv_grid/mv_connect.py b/ding0/grid/mv_grid/mv_connect.py index 0ba95f79..a5e60f78 100644 --- a/ding0/grid/mv_grid/mv_connect.py +++ b/ding0/grid/mv_grid/mv_connect.py @@ -740,16 +740,9 @@ def mv_connect_stations(mv_grid_district, graph, debug=False): """ # WGS84 (conformal) to ETRS (equidistant) projection - proj1 = partial( - pyproj.transform, - pyproj.Proj(init='epsg:4326'), # source coordinate system - pyproj.Proj(init='epsg:3035')) # destination coordinate system - + proj1 = Transformer.from_crs("epsg:4326", "epsg:3035", always_xy=True).transform # ETRS (equidistant) to WGS84 (conformal) projection - proj2 = partial( - pyproj.transform, - pyproj.Proj(init='epsg:3035'), # source coordinate system - pyproj.Proj(init='epsg:4326')) # destination coordinate system + proj2 = Transformer.from_crs("epsg:3035", "epsg:4326", always_xy=True).transform conn_dist_weight = cfg_ding0.get('mv_connect', 'load_area_sat_conn_dist_weight') conn_dist_ring_mod = cfg_ding0.get('mv_connect', 'load_area_stat_conn_dist_ring_mod') @@ -922,16 +915,9 @@ def mv_connect_generators(mv_grid_district, graph, debug=False): generator_buffer_radius_inc = cfg_ding0.get('mv_connect', 'generator_buffer_radius_inc') # WGS84 (conformal) to ETRS (equidistant) projection - proj1 = partial( - pyproj.transform, - pyproj.Proj(init='epsg:4326'), # source coordinate system - pyproj.Proj(init='epsg:3035')) # destination coordinate system - + proj1 = Transformer.from_crs("epsg:4326", "epsg:3035", always_xy=True).transform # ETRS (equidistant) to WGS84 (conformal) projection - proj2 = partial( - pyproj.transform, - pyproj.Proj(init='epsg:3035'), # source coordinate system - pyproj.Proj(init='epsg:4326')) # destination coordinate system + proj2 = Transformer.from_crs("epsg:3035", "epsg:4326", always_xy=True).transform for generator in sorted(mv_grid_district.mv_grid.generators(), key=lambda x: repr(x)): From ed0e775125b5cf539c4864b1f140eb4ce509d8ad Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 12:22:08 +0200 Subject: [PATCH 12/25] rm unused imports --- tests/core/test_core.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/core/test_core.py b/tests/core/test_core.py index 16f2777e..14cddf60 100644 --- a/tests/core/test_core.py +++ b/tests/core/test_core.py @@ -6,8 +6,6 @@ import pandas as pd import os from tests.core.network.test_grids import TestMVGridDing0 -# from pandas.util.testing import assert_frame_equal, assert_series_equal -# from ding0.tools.results import load_nd_from_pickle from ding0.core import NetworkDing0 import shutil From 4977734ff1be2e6ceef9a530d34b050325cbc4f1 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 12:26:32 +0200 Subject: [PATCH 13/25] replace pandas.util.testing by pandas.testing --- tests/core/network/test_network.py | 2 +- tests/tools/test_results.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/core/network/test_network.py b/tests/core/network/test_network.py index 7fcef24c..f94880fd 100644 --- a/tests/core/network/test_network.py +++ b/tests/core/network/test_network.py @@ -13,7 +13,7 @@ calculate_mvgd_stats, calculate_mvgd_voltage_current_stats) import pandas as pd -from pandas.util.testing import assert_frame_equal +from pandas.testing import assert_frame_equal import os import numpy as np from tests.tools.help_functions import compare_data_frames_by_tolerance diff --git a/tests/tools/test_results.py b/tests/tools/test_results.py index 861bb5ca..b709eb65 100644 --- a/tests/tools/test_results.py +++ b/tests/tools/test_results.py @@ -2,7 +2,7 @@ from tests.core.network.test_grids import TestMVGridDing0 from ding0.tools.results import calculate_mvgd_stats import pandas as pd -from pandas.util.testing import assert_frame_equal +from pandas.testing import assert_frame_equal import os From e26e7a6512033fd57fd0d09486ead35a225760fc Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 12:26:57 +0200 Subject: [PATCH 14/25] rm unused import --- tests/core/network/test_network.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/core/network/test_network.py b/tests/core/network/test_network.py index f94880fd..782e1458 100644 --- a/tests/core/network/test_network.py +++ b/tests/core/network/test_network.py @@ -16,7 +16,6 @@ from pandas.testing import assert_frame_equal import os import numpy as np -from tests.tools.help_functions import compare_data_frames_by_tolerance class TestGridDing0(object): From 3e88d3c31e32baa72ff7ba6f0a60c1fd76562f36 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 13:10:55 +0200 Subject: [PATCH 15/25] fix literal --- ding0/core/network/grids.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding0/core/network/grids.py b/ding0/core/network/grids.py index a5d947fd..ff969462 100644 --- a/ding0/core/network/grids.py +++ b/ding0/core/network/grids.py @@ -206,7 +206,7 @@ def rings_nodes(self, include_root_node=False, include_satellites=False): Circuit breakers must be closed to find rings, this is done automatically. """ for circ_breaker in self.circuit_breakers(): - if circ_breaker.status is 'open': + if circ_breaker.status == 'open': circ_breaker.close() logger.info('Circuit breakers were closed in order to find MV ' 'rings') From 780fa08c86afb0721ab18792ff17185eff370865 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 13:25:27 +0200 Subject: [PATCH 16/25] fix pandas' FutureWarning: Indexing with multiple keys --- ding0/tools/results.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/ding0/tools/results.py b/ding0/tools/results.py index d79f3812..c929048a 100644 --- a/ding0/tools/results.py +++ b/ding0/tools/results.py @@ -980,16 +980,15 @@ def calculate_mvgd_stats(nw): mvgd_stats = pd.concat([mvgd_stats, LA_data], axis=1) - LA_data = LA_df.groupby(['grid_id'])['population', - 'residential_peak_load', - 'retail_peak_load', - 'industrial_peak_load', - 'agricultural_peak_load', - 'total_peak_load', - 'lv_generation', - 'lv_gens_lvl_6', - 'lv_gens_lvl_7' - ].sum() + LA_data = LA_df.groupby(['grid_id'])[['population', + 'residential_peak_load', + 'retail_peak_load', + 'industrial_peak_load', + 'agricultural_peak_load', + 'total_peak_load', + 'lv_generation', + 'lv_gens_lvl_6', + 'lv_gens_lvl_7']].sum() LA_data.columns = ['LA Total Population', 'LA Total LV Peak Load Residential', 'LA Total LV Peak Load Retail', @@ -1015,9 +1014,9 @@ def calculate_mvgd_stats(nw): sat_LA_data.columns = ['Number of Load Areas - Satellite'] mvgd_stats = pd.concat([mvgd_stats, sat_LA_data], axis=1) - agg_LA_data = LA_df[LA_df['is_agg']].groupby(['grid_id'])['population', - 'lv_generation', - 'total_peak_load'].sum() + agg_LA_data = LA_df[LA_df['is_agg']].groupby(['grid_id'])[['population', + 'lv_generation', + 'total_peak_load']].sum() agg_LA_data.columns = ['LA Aggregated Population', 'LA Aggregated LV Gen. Cap.', 'LA Aggregated LV Peak Load total' ] From 395f3a068b64d1db327781b200a5c5f05b08668e Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 13:49:02 +0200 Subject: [PATCH 17/25] update requirements --- requirements.txt | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/requirements.txt b/requirements.txt index e4fbe849..23f0f0cd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,15 @@ -networkx -geopy -pandas -pyproj +networkx == 2.5.1 +geopy == 2.1.0 +pandas == 1.2.4 +pyproj == 3.0.1 sqlalchemy == 1.3.24 -geoalchemy2 -matplotlib +geoalchemy2 == 0.6.3 +matplotlib >= 1.5.3, <= 3.4.2 egoio @ git+https://github.com/openego/ego.io.git@ab327e3c8bdb53b5205af84b41b02700f6d3fb20#egg=egoio -shapely -pypsa -seaborn -unittest2 -oedialect -geopandas -descartes \ No newline at end of file +shapely == 1.7.1 +pypsa >= 0.11.0, <= 0.17.1 +seaborn == 0.11.1 +unittest2 == 1.1.0 +oedialect == 0.0.10 +geopandas == 0.9.0 +descartes == 1.1.0 \ No newline at end of file From 5ffc93813766e735ce1770836ba78bf24d724aae Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 13:54:08 +0200 Subject: [PATCH 18/25] update requirements --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 23f0f0cd..b1a49002 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ networkx == 2.5.1 geopy == 2.1.0 pandas == 1.2.4 pyproj == 3.0.1 -sqlalchemy == 1.3.24 +sqlalchemy <= 1.3.24 geoalchemy2 == 0.6.3 matplotlib >= 1.5.3, <= 3.4.2 egoio @ git+https://github.com/openego/ego.io.git@ab327e3c8bdb53b5205af84b41b02700f6d3fb20#egg=egoio From f7477fa2475289fd0be6c5e91fbce686ab9b0fbe Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 13:55:57 +0200 Subject: [PATCH 19/25] update RTD requirements --- rtd_requirements.txt | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/rtd_requirements.txt b/rtd_requirements.txt index efea3e46..2041e4ca 100644 --- a/rtd_requirements.txt +++ b/rtd_requirements.txt @@ -1,19 +1,14 @@ sphinx_rtd_theme networkx >= 2.0 -geopy >=1.11.0, <=1.11.0 -pandas >=0.20.3, <=0.20.3 -pyproj >=1.9.5.1, <=1.9.5.1 -sqlalchemy >= 1.0.11, <= 1.2.0 -geoalchemy2 >= 0.2.6, <= 0.4.1 -matplotlib >=2.0.0, <=2.0.2 +geopy == 2.1.0 +pandas == 1.2.4 +pyproj == 3.0.1 +sqlalchemy <= 1.3.24 +geoalchemy2 == 0.6.3 +matplotlib >= 1.5.3, <= 3.4.2 egoio >=0.4.7 -pypsa >=0.11.0, <=0.11.0 -seaborn -unittest2 -oedialect == 0.0.6.dev0 -mock - - - - - +pypsa >= 0.11.0, <= 0.17.1 +seaborn == 0.11.1 +unittest2 == 1.1.0 +oedialect == 0.0.10 +mock \ No newline at end of file From aeeaef539d91e7785e1106251fd7c9ba8cfd9c54 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 14:29:52 +0200 Subject: [PATCH 20/25] fix typos --- doc/getting_started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/getting_started.rst b/doc/getting_started.rst index 3a9c47e0..56fc2b41 100644 --- a/doc/getting_started.rst +++ b/doc/getting_started.rst @@ -7,7 +7,7 @@ Installation ============ .. note:: - Installation is only tested on (debian like) linux OS. + Installation is only tested on (Debian-like) Linux OS. Ding0 is provided through PyPi package management and, thus, installable from sources of pip3. From 018d27e6ba8d0586628c331df05eb705c4f284ec Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 14:30:18 +0200 Subject: [PATCH 21/25] fix whatsnew list --- doc/whatsnew.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/whatsnew.rst b/doc/whatsnew.rst index bd205caf..b00ad442 100644 --- a/doc/whatsnew.rst +++ b/doc/whatsnew.rst @@ -8,6 +8,7 @@ See what's new as per release! :local: :backlinks: top +.. include:: whatsnew/v0-1-13.rst .. include:: whatsnew/v0-1-12.rst .. include:: whatsnew/v0-1-10.rst .. include:: whatsnew/v0-1-9.rst From 68008cff0d0bc0967909ba64cb0caca2ed7e2c7e Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 19 May 2021 17:46:00 +0200 Subject: [PATCH 22/25] bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ebcf63a3..8bcd8322 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def read(fname): dev_requirements = f.read().splitlines() setup(name='ding0', - version='v0.1.13dev', + version='v0.2.0', author='Reiner Lemoine Institut, openego development group', author_email='jonathan.amme@rl-institut.de', description='DIstribution Network GeneratOr', From e3e1288d4d41447f29d55de95edc2673aed74af0 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Thu, 20 May 2021 10:50:34 +0200 Subject: [PATCH 23/25] update whatsnew --- doc/whatsnew.rst | 2 +- doc/whatsnew/v0-2-0.rst | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 doc/whatsnew/v0-2-0.rst diff --git a/doc/whatsnew.rst b/doc/whatsnew.rst index b00ad442..804799b8 100644 --- a/doc/whatsnew.rst +++ b/doc/whatsnew.rst @@ -8,7 +8,7 @@ See what's new as per release! :local: :backlinks: top -.. include:: whatsnew/v0-1-13.rst +.. include:: whatsnew/v0-2-0.rst .. include:: whatsnew/v0-1-12.rst .. include:: whatsnew/v0-1-10.rst .. include:: whatsnew/v0-1-9.rst diff --git a/doc/whatsnew/v0-2-0.rst b/doc/whatsnew/v0-2-0.rst new file mode 100644 index 00000000..7b3eb32d --- /dev/null +++ b/doc/whatsnew/v0-2-0.rst @@ -0,0 +1,16 @@ +Release v0.2.0 (May 20, 2021) ++++++++++++++++++++++++++++++ + +Changes +------- + +* Added Python 3.8 support `#325 `_ +* CSV export in PyPSA format `#307 `_ +* Switched from pyproj1 to pyproj2 for CRS transformations `#343 `_ +* Reproducible [stats](https://github.com/openego/ding0/blob/dev/ding0/tools/results.py#L281-L1210) + by fixing `#315 `_, for details see + `#324 `_ +* In the CSV export, (in-building) household loads and generators are no more + contained as extra nodes but directly connected to the house's grid + connection point to reduce the number of nodes. + `#322 `_ From 86dcb0d8dee15194f2c0dbba2a9efe39f672fd61 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Thu, 20 May 2021 10:51:28 +0200 Subject: [PATCH 24/25] rm old release file --- doc/whatsnew/v0-1-13.rst | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 doc/whatsnew/v0-1-13.rst diff --git a/doc/whatsnew/v0-1-13.rst b/doc/whatsnew/v0-1-13.rst deleted file mode 100644 index 75d58dfb..00000000 --- a/doc/whatsnew/v0-1-13.rst +++ /dev/null @@ -1,13 +0,0 @@ -Release v0.1.13 month day, year -+++++++++++++++++++++++++++++++++++ - -Changes -------- - -* Reproducible [stats](https://github.com/openego/ding0/blob/dev/ding0/tools/results.py#L281-L1210) by fixing `#315 `_, for details see - `#324 `_ - -* In the CSV export, (in-building) household loads and generators are no more - contained as extra nodes but directly connected to the house's grid - connection point to reduce the number of nodes. - `#322 `_ From 0426b5dbc93b6ab76b0fb7999155346a5e639fa3 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Fri, 28 May 2021 10:50:55 +0200 Subject: [PATCH 25/25] update whatsnew --- doc/whatsnew/v0-2-0.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/whatsnew/v0-2-0.rst b/doc/whatsnew/v0-2-0.rst index 7b3eb32d..6df2b344 100644 --- a/doc/whatsnew/v0-2-0.rst +++ b/doc/whatsnew/v0-2-0.rst @@ -5,12 +5,14 @@ Changes ------- * Added Python 3.8 support `#325 `_ -* CSV export in PyPSA format `#307 `_ +* CSV export in PyPSA format `#307 `_ , + this required further changes and fixing of tests, cf. `#312 `_ * Switched from pyproj1 to pyproj2 for CRS transformations `#343 `_ * Reproducible [stats](https://github.com/openego/ding0/blob/dev/ding0/tools/results.py#L281-L1210) - by fixing `#315 `_, for details see + by fixing `#315 `_, for details see `#324 `_ * In the CSV export, (in-building) household loads and generators are no more contained as extra nodes but directly connected to the house's grid connection point to reduce the number of nodes. `#322 `_ +* Fix sum capacity of grid generators `#326 `_