Skip to content

Commit

Permalink
Merge branch 'develop' into feature/1917-improved-imports
Browse files Browse the repository at this point in the history
# Conflicts:
#	pandapower/converter/powerfactory/pp_import_functions.py
#	pandapower/plotting/plotly/mapbox_plot.py
#	pandapower/test/api/test_create.py
#	pandapower/test/api/test_group.py
#	pandapower/test/estimation/test_recycle.py
#	pandapower/test/estimation/test_wls_estimation.py
  • Loading branch information
KS-HTK committed Jan 22, 2025
2 parents 65677b3 + 8009cb5 commit 25fa420
Show file tree
Hide file tree
Showing 41 changed files with 1,425 additions and 504 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/upload_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ name: upload
# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
push:
branches:
- master
workflow_dispatch:
inputs:
upload_server:
description: 'upload server'
required: true
default: 'testpypi'
type: choice
options:
- 'testpypi'
- 'pypi'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -31,10 +38,23 @@ jobs:
# Upgrade pip
python3 -m pip install --upgrade pip
# Install twine
python3 -m pip install setuptools wheel twine
python3 -m pip install build setuptools wheel twine
# Upload to TestPyPI
- name: Build and Upload to TestPyPI
if: ${{ inputs.upload_server == 'testpypi' }}
run: |
python3 -m build
python3 -m twine check dist/* --strict
python3 -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI }}
TWINE_REPOSITORY: testpypi

# Upload to PyPI
- name: Build and Upload to PyPI
if: ${{ inputs.upload_server == 'pypi' }}
run: |
python3 -m build
python3 -m twine check dist/* --strict
Expand All @@ -46,21 +66,24 @@ jobs:

# Waste some time
- name: Sleep for 150s to make release available
if: ${{ inputs.upload_server == 'pypi' }}
uses: juliangruber/sleep-action@v1
with:
time: 150s

# Notify fraunhofer ci about the new version
- uses: eic/trigger-gitlab-ci@v3
if: ${{ inputs.upload_server == 'pypi' }}
with:
url: https://gitlab.cc-asp.fraunhofer.de
project_id: 27329
token: ${{secrets.GITLAB_TRIGGER_TOKEN}}
ref_name: develop


# Run an install for testing
# Run an installation for testing
- name: Install pandapower from PyPI
if: ${{ inputs.upload_server == 'pypi' }}
run: |
python3 -m pip install pandapower
python3 -c "import pandapower; print(pandapower.__version__)"
python3 -m pip install --pre pandapower
python3 -c "import pandapower; print(pandapower.__version__)"
38 changes: 38 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,52 @@
Change Log
=============

[upcoming release] - 2025-..-..
-------------------------------
- [FIXED] Increasing geojson precision as the default precision might cause problems with pandahub

[2.14.11] - 2024-07-08
-------------------------------
- [FIXED] Lightsim2grid version

[2.14.10] - 2024-07-08
-------------------------------
- [FIXED] geopandas version

[2.14.9] - 2024-06-25
-------------------------------
- [FIXED] scipy version

[upcoming release] - 2024-..-..
-------------------------------

- [ADDED] Static Var Compensator with Voltage Control
- [ADDED] pf2pp: min/max q_mvar and min/max p_mw limits for sgens and gen will be converted
- [FIXED] Allow to consider all oos components in nx graph creation
- [REMOVED] Excluding tests and test_files from built packages
- [ADDED] Static Var Compensator with Voltage Control
- [ADDED] Implementation of Allocation Factor WLS (AF-WLS) for non observable distribution grids
- [FIXED] Deletion of multiple measurements at the same bus or branch
- [FIXED] Creation of zero injection measurements in WLS estimator
- [FIXED] Divergence of WLS estimator with flat start for highly loaded grids
- [ADDED] Computation of matrix conditioning and warning in case of ill-conditioning
- [FIXED] Issue with initialization of WLS estimator
- [FIXED] Handling of current magnitude measurements in WLS estimator
- [ADDED] Created estimation results for shunt elements
- [FIXED] Fixed issue with power injection results in WLS estimator
- [FIXED] cim2pp add missing description to dcline
- [ADDED] pandas series accessor for geo column
- [FIXED] Increasing geojson precision as the default precision might cause problems with pandahub
- [ADDED] pf2pp: min/max q_mvar and min/max p_mw limits for sgens and gen will be converted
- [ADDED] converter for European EHV grid data from JAO, the "Single Allocation Platform (SAP) for all European Transmission System Operators (TSOs) that operate in accordance to EU legislation"
- [ADDED] Add GeographicalRegion and SubGeographicalRegion names and ids to bus df in cim converter
- [CHANGED] Capitalize first letter of columns busbar_id, busbar_name and substation_id in bus df for cim converter
- [CHANGED] required standard type parameters are made available by function :code:`required_std_type_parameters()`
- [CHANGED] toolbox replace functions (e.g. gen replacement by sgens): improved result table implementation and added profiles consideration
- [FIXED] Do not modify pandas options when importing pandapower
- [FIXED] fixed copy-paste error in contingency results "max_limit_nminus1" and "min_limit_nminus1"
- [ADDED] improved lightsim2grid documentation including compatibitliy issues
- [FIXED] avoid duplicated keys in kwargs and pf_options in run_contingency()
- [FIXED] cim2pp: set default xml encoding to None to avoid error after changing to lxml
- [FIXED] PandaModels OPF with 'bus_dc' key errors
- [FIXED] julia tests
Expand Down Expand Up @@ -72,6 +107,7 @@ Change Log
- [CHANGED] parameter renaming in net.group: element -> element_index
- [CHANGED] in to_ppc(), the default of calculate_voltage_angles is True now (as in previously changed in runpp()).
- [FIXED] fixed some small bugs in the CGMES converter and improved its speed
- [CHANGED] vectorization of switch bus and element checks in create_switches()
- [CHANGED] trigger a numpy error in makeYbus, makeBbus, _wye_delta instead of warning
- [ADDED] transformer tap hunting detection for DiscreteTapControl
- [CHANGED] diagnostic for implausible impedance values includes xward, trafo, trafo3w
Expand All @@ -82,13 +118,15 @@ Change Log
- [ADDED] support for unequal leakage resistance and reactance for HV and LV sides of a 2W-transformer
- [ADDED] Add VSC element, dc buses, dc lines, and hybrid AC/DC power flow calculation
- [CHANGED] accelerate _integrate_power_elements_connected_with_switch_buses() in get_equivalent()
- [FIXED] index error during unbalanced powerflow if multiple external grids are present
- [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] converter for European EHV grid data from JAO, the "Single Allocation Platform (SAP) for all European Transmission System Operators (TSOs) that operate in accordance to EU legislation"
- [ADDED] cim2pp converter: Using lxml to parse XML files (better performance)
- [FIXED] OC relay name attribute error
- [FIXED] cim2pp: fixed missing nominal voltages at SeriesCompensator

[2.14.11] - 2024-07-08
-------------------------------
Expand Down
15 changes: 0 additions & 15 deletions MANIFEST.in

This file was deleted.

23 changes: 6 additions & 17 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
.. raw:: html

<a href="https://www.pandapower.org">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://www.pandapower.org/images/pp_light.svg">
<source media="(prefers-color-scheme: light)" srcset="https://www.pandapower.org/images/pp.svg">
<img alt="logo" src="//www.pandapower.org/images/pp.svg">
</picture>
</a>
.. image:: https://www.pandapower.org/images/pp.svg
:target: https://www.pandapower.org
:alt: logo

|
Expand Down Expand Up @@ -96,15 +91,9 @@ Operation at the Fraunhofer Institute for Energy Economics and Energy System Tec

|
.. raw:: html

<a href="https://www.iee.fraunhofer.de/en.html">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://www.pandapower.org/images/contact/Logo_Fraunhofer_IEE_negativ.png">
<source media="(prefers-color-scheme: light)" srcset="https://www.pandapower.org/images/contact/Logo_Fraunhofer_IEE.png">
<img alt="logo" src="https://www.pandapower.org/images/contact/Logo_Fraunhofer_IEE.png" width=500 >
</picture>
</a>
.. image:: https://www.pandapower.org/images/contact/Logo_Fraunhofer_IEE.png
:target: https://www.iee.fraunhofer.de/en.html
:width: 500

|
Expand Down
1 change: 1 addition & 0 deletions doc/converter/powerfactory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The documentation describes how to use the exporter as a function in "Engine mod
- ElmZpu (pu Impedance)
- ElmSind (Series Reactor)
- Elmscap (Series Capacitor)
- ElmSvs (Static Var Compensator with Voltage Control)


Setup PowerFactory and Python
Expand Down
10 changes: 5 additions & 5 deletions doc/elements/line_par.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ from_bus*;integer;;Index of bus where the line starts
to_bus*;integer;;Index of bus where the line ends
length_km*;float;:math:`>` 0;length of the line [km]
r_ohm_per_km*;float;:math:`\geq` 0 ;resistance of the line [Ohm per km]
x_ohm_per_km*;float;:math:`\geq` 0 ;inductance of the line [Ohm per km]
x_ohm_per_km*;float;:math:`\geq` 0 ;reactance of the line [Ohm per km]
c_nf_per_km*;float;:math:`\geq` 0 ;capacitance of the line (line-to-earth) [nano Farad per km]
r0_ohm_per_km****;float;:math:`\geq` 0 ;zero sequence resistance of the line [Ohm per km]
x0_ohm_per_km****;float;:math:`\geq` 0 ;zero sequence inductance of the line [Ohm per km]
x0_ohm_per_km****;float;:math:`\geq` 0 ;zero sequence reactance of the line [Ohm per km]
c0_nf_per_km****;float;:math:`\geq` 0 ;zero sequence capacitance of the line [nano Farad per km]
g_us_per_km*;float;:math:`\geq` 0 ;dielectric conductance of the line [micro Siemens per km]
max_i_ka*;float;:math:`>` 0 ;maximal thermal current [kilo Ampere]
parallel*;integer;:math:`\geq` 1;number of parallel line systems
df*;float;0...1 ;derating factor (scaling) for max_i_ka
type;string;"| Naming conventions:

| *""ol""* - overhead line
type;string;"| Naming conventions:
| *""ol""* - overhead line
| *""cs""* - underground cable system";type of line
max_loading_percent**;float;:math:`>` 0 ;Maximum loading of the line
endtemp_degree***;float;:math:`>` 0 ;Short-Circuit end temperature of the line
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pandapower/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import importlib.metadata

__version__ = importlib.metadata.version("pandapower")
__format_version__ = "3.0.0"
__format_version__ = "3.0.0.dev0"
17 changes: 15 additions & 2 deletions pandapower/auxiliary.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

import numpy as np
import pandas as pd
from pandas.api.types import is_numeric_dtype, is_string_dtype, is_object_dtype
# from pandas.api.types import is_integer_dtype, is_float_dtype
import scipy as sp
from geojson import loads, GeoJSON
from packaging.version import Version
Expand Down Expand Up @@ -454,12 +456,23 @@ def element_types_to_ets(element_types=None):
ser2 = pd.Series(ser1.index, index=list(ser1))
if element_types is None:
return ser2
elif isinstance(ets, str):
elif isinstance(element_types, str):
return ser2.at[element_types]
else:
return list(ser2.loc[element_types])


def empty_defaults_per_dtype(dtype):
if is_numeric_dtype(dtype):
return np.nan
elif is_string_dtype(dtype):
return ""
elif is_object_dtype(dtype):
return None
else:
raise NotImplementedError(f"{dtype=} is not implemented in _empty_defaults()")


def _preserve_dtypes(df, dtypes):
for item, dtype in list(dtypes.items()):
if df.dtypes.at[item] != dtype:
Expand Down Expand Up @@ -1838,7 +1851,7 @@ def _init_runse_options(net, v_start, delta_start, calculate_voltage_angles,
net._options = {}
_add_ppc_options(net, calculate_voltage_angles=calculate_voltage_angles,
trafo_model=trafo_model, check_connectivity=check_connectivity,
mode="pf", switch_rx_ratio=switch_rx_ratio, init_vm_pu=v_start,
mode="se", switch_rx_ratio=switch_rx_ratio, init_vm_pu=v_start,
init_va_degree=delta_start, enforce_q_lims=False, recycle=None,
voltage_depend_loads=False, trafo3w_losses=trafo3w_losses)
_add_pf_options(net, tolerance_mva="1e-8", trafo_loading="power",
Expand Down
Loading

0 comments on commit 25fa420

Please sign in to comment.