Skip to content

Commit

Permalink
Merge branch 'develop' into geo_accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
mfranz13 authored Nov 19, 2024
2 parents ca5c218 + 7e7a2af commit 9070880
Show file tree
Hide file tree
Showing 9 changed files with 284 additions and 37 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/github_test_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ jobs:
- name: Check docs for Python ${{ matrix.python-version }}
uses: e2nIEE/sphinx-action@master
with:
pre-build-command: "python -m pip install --upgrade pip;
python -m pip install .[docs];"
pre-build-command: "apt update && apt upgrade -y && apt install -y build-essential gfortran cmake pkg-config libopenblas-dev;
python -m pip install --upgrade pip;
python -m pip install .[docs];"
build-command: "sphinx-build -b html . _build -W"
docs-folder: "doc/"
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Change Log
- [CHANGED] accelerate distributed slack power flow calculation by using sparse-aware operations in _subnetworks()
- [CHANGED] Trafo Controllers can now be added to elements that are out of service, changed self.nothing_to_do()
- [ADDED] Discrete shunt controller for local voltage regulation with shunt steps
- [ADDED] fix lengths missmatch of output if ignore_zero_length is False in plotting utility function coords_from_node_geodata() and rename ignore_zero_length by ignore_no_geo_diff
- [ADDED] cim2pp converter: Using lxml to parse XML files (better performance)

[2.14.7] - 2024-06-14
Expand Down
3 changes: 2 additions & 1 deletion pandapower/build_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,8 @@ def _calculate_3w_tap_changers(t3, t2, sides):
if any_at_star_point & np.any(mask_star_point := (tap_mask & at_star_point)):
t = tap_arrays["tap_step_percent"][side][mask_star_point] * np.exp(1j * np.deg2rad(tap_arrays["tap_step_degree"][side][mask_star_point]))
tap_pos = tap_arrays["tap_pos"][side][mask_star_point]
t_corrected = 100 * t / (100 + (t * tap_pos))
tap_neutral = tap_arrays["tap_neutral"][side][mask_star_point]
t_corrected = 100 * t / (100 + (t * (tap_pos-tap_neutral)))
tap_arrays["tap_step_percent"][side][mask_star_point] = np.abs(t_corrected)
tap_arrays["tap_side"][side][mask_star_point] = "lv" if side == "hv" else "hv"
tap_arrays["tap_step_degree"][side][mask_star_point] = np.rad2deg(np.angle(t_corrected))
Expand Down
15 changes: 5 additions & 10 deletions pandapower/convert_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

from pandapower._version import __version__, __format_version__
from pandapower.create import create_empty_network, create_poly_cost
from pandapower.plotting import geo
from pandapower.results import reset_results
from pandapower.control import TrafoController
import pandapower.plotting.geo as geo

try:
import pandaplan.core.pplog as logging
Expand All @@ -22,14 +24,6 @@
logger = logging.getLogger(__name__)


def _compare_version(
net_version,
compare_version: Union[str, int],
compare: Callable[[Version, Version], bool] = lambda x, y: x < y
) -> bool:
return compare(Version(str(net_version)), Version(str(compare_version)))


def convert_format(net, elements_to_deserialize=None):
"""
Converts old nets to new format to ensure consistency. The converted net is returned.
Expand All @@ -46,6 +40,7 @@ def convert_format(net, elements_to_deserialize=None):
_add_missing_columns(net, elements_to_deserialize)
_create_seperate_cost_tables(net, elements_to_deserialize)
if Version(str(net.format_version)) < Version("3.0.0"):
_convert_geo_data(net, elements_to_deserialize)
_convert_group_element_index(net)
_convert_trafo_controller_parameter_names(net)
if Version(str(net.format_version)) < Version("2.4.0"):
Expand All @@ -56,7 +51,7 @@ def convert_format(net, elements_to_deserialize=None):
_convert_to_mw(net)
_update_trafo_parameter_names(net, elements_to_deserialize)
reset_results(net)
if isinstance(net.format_version, float) and net.format_version < 1.6:
if Version(str(net.format_version)) < Version("1.6"):
set_data_type_of_columns_to_default(net)
_convert_objects(net, elements_to_deserialize)
_update_characteristics(net, elements_to_deserialize)
Expand All @@ -74,7 +69,7 @@ def _convert_geo_data(net, elements_to_deserialize=None):
or (_check_elements_to_deserialize('line_geodata', elements_to_deserialize)
and _check_elements_to_deserialize('line', elements_to_deserialize))):
if hasattr(net, 'bus_geodata') or hasattr(net, 'line_geodata'):
if _compare_version(net.format_version, "1.6"):
if Version(str(net.format_version)) < Version("1.6"):
net.bus_geodata = pd.DataFrame.from_dict(net.bus_geodata)
net.line_geodata = pd.DataFrame.from_dict(net.line_geodata)
geo.convert_geodata_to_geojson(net)
Expand Down
Loading

0 comments on commit 9070880

Please sign in to comment.