Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removing deprecated code from simple_plotly #2470

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions pandapower/plotting/plotly/mapbox_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

import os

from typing_extensions import deprecated

from pandapower.plotting import geo

try:
import pandaplan.core.pplog as logging
except ImportError:
Expand Down Expand Up @@ -44,23 +40,6 @@ def _on_map_test(x, y):
return True


@deprecated('geo_data_to_latlong is deprecated and will be removed shortly, use pandapower.geo.convert_crs instead')
def geo_data_to_latlong(net, projection):
"""
Transforms network's geodata (in `net.bus_geodata` and `net.line_geodata`) from specified projection to lat/long (WGS84).

INPUT:
**net** (pandapowerNet) - The pandapower network

**projection** (String) - projection from which geodata are transformed to lat/long. some examples

- "epsg:31467" - 3-degree Gauss-Kruger zone 3
- "epsg:2032" - NAD27(CGQ77) / UTM zone 18N
- "epsg:2190" - Azores Oriental 1940 / UTM zone 26N
"""
geo.convert_crs(net, epsg_in=projection.split(':')[1], epsg_out=4326)


def set_mapbox_token(token):
from pandapower.__init__ import pp_dir
path = os.path.join(pp_dir, "plotting", "plotly")
Expand Down
44 changes: 2 additions & 42 deletions pandapower/plotting/plotly/simple_plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
# Copyright (c) 2016-2023 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.


import warnings
from typing_extensions import overload
import pandas as pd

from pandapower.plotting.generic_geodata import create_generic_coordinates
from pandapower.plotting.plotly.traces import create_bus_trace, create_line_trace, \
create_dcline_trace, create_scale_trace, create_trafo_trace, draw_traces, \
_create_node_trace, _create_branch_trace
_create_node_trace
from pandapower.plotting.plotly.mapbox_plot import *

try:
Expand Down Expand Up @@ -100,29 +97,8 @@ def get_hoverinfo(net, element, precision=3, sub_index=None):
return hoverinfo


@overload
def simple_plotly(net, respect_switches=True, use_line_geo=None, on_map=False,
*, map_style='basic', figsize=1.0, aspectratio='auto',
line_width=1.0, bus_size=10.0, ext_grid_size=20.0,
bus_color="blue", line_color='grey', trafo_color='green',
trafo3w_color='green', ext_grid_color="yellow",
filename='temp-plot.html', auto_open=True, showlegend=True,
additional_traces=None, zoomlevel=11, auto_draw_traces=True, hvdc_color='cyan'): ...


@overload
@deprecated("projection is deprecated and will be removed in future versions. geojson should always be WGS84.")
def simple_plotly(net, respect_switches=True, use_line_geo=None, on_map=False,
projection='epsg:4326', map_style='basic', figsize=1.0, aspectratio='auto',
line_width=1.0, bus_size=10.0, ext_grid_size=20.0,
bus_color="blue", line_color='grey', trafo_color='green',
trafo3w_color='green', ext_grid_color="yellow",
filename='temp-plot.html', auto_open=True, showlegend=True,
additional_traces=None, zoomlevel=11, auto_draw_traces=True, hvdc_color='cyan'): ...


def simple_plotly(net, respect_switches=True, use_line_geo=None, on_map=False,
projection=None, map_style='basic', figsize=1.0, aspectratio='auto',
map_style='basic', figsize=1.0, aspectratio='auto',
line_width=1.0, bus_size=10.0, ext_grid_size=20.0,
bus_color="blue", line_color='grey', trafo_color='green',
trafo3w_color='green', ext_grid_color="yellow",
Expand Down Expand Up @@ -196,13 +172,6 @@ def simple_plotly(net, respect_switches=True, use_line_geo=None, on_map=False,
OUTPUT:
**figure** (graph_objs._figure.Figure) figure object
"""
if projection is not None:
warnings.warn(
FutureWarning(
"projection is deprecated and will be removed in future versions. geojson should always be WGS84."
),
stacklevel=2
)

settings = dict(
on_map=on_map,
Expand Down Expand Up @@ -262,15 +231,6 @@ def _simple_plotly_generic(net, respect_separators, use_branch_geodata, branch_w
branch_trace_func, node_trace_func, hoverinfo_func,
hvdc_color="cyan", settings=None, **kwargs):

if 'projection' in kwargs:
warnings.warn(
FutureWarning(
"projection is deprecated and will not be used. geojson should always be WGS84."
),
stacklevel=2
)
kwargs.pop('projection')

settings_defaults = { # if no settings are provided, these are used
'on_map': kwargs.get('on_map', True),
'map_style': kwargs.get('map_style', 'basic'),
Expand Down
Loading