Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
235 commits
Select commit Hold shift + click to select a range
67b2a2b
modifie network_structure according to docu and create method signatures
heckstrahler Sep 18, 2025
0b066c7
reformarting, removing not needed comments
heckstrahler Sep 18, 2025
f6062ff
Merge branch 'develop' into structure_dict_rework
vogt31337 Sep 25, 2025
e4d9baa
Merge branch 'develop' into structure_dict_rework
heckstrahler Sep 29, 2025
b2610f8
first draft for element schemata
heckstrahler Sep 29, 2025
4f09558
incooperate schemas into network struct, first draft for network test
heckstrahler Sep 30, 2025
dcb655c
reformat
heckstrahler Sep 30, 2025
1284f25
reformat with better line width
heckstrahler Sep 30, 2025
6b95caa
make tap_step_degree nullable
heckstrahler Sep 30, 2025
c7941a8
optimize get_dtypes
heckstrahler Sep 30, 2025
d560e0e
enhance pandera validation according to documentation
heckstrahler Sep 30, 2025
11926f2
add descriptions to bus schema
heckstrahler Oct 1, 2025
4cf9195
add create csv function for docu
heckstrahler Oct 1, 2025
41165cd
Merge branch 'develop' into structure_dict_rework
heckstrahler Oct 1, 2025
9fbe11a
add pandera to dependancies
heckstrahler Oct 1, 2025
d8ecaa2
added missing vn_kv
vogt31337 Oct 6, 2025
0e51c85
fixed a broken check about standard values... (which are not document…
vogt31337 Oct 6, 2025
c9fa1b9
example on how metadata could be used
vogt31337 Oct 6, 2025
55750fc
fix which will not add non required columns.
vogt31337 Oct 6, 2025
abb27f1
add descriptions to schemata, add b2b_vsc, bus_dc and load_dc schemata
heckstrahler Oct 6, 2025
9a9b545
Merge branch 'develop' into structure_dict_rework
heckstrahler Oct 6, 2025
c8b11cf
add schema for dcline, measurement, source_dc, ward, xward
heckstrahler Oct 6, 2025
a55cb35
add schemata for bi_vsc, impedance, line_dc, tcsc, trafo3w
heckstrahler Oct 7, 2025
55c7a51
add res schema to elements
heckstrahler Oct 7, 2025
e6ba49d
add 3ph res tables to elements
heckstrahler Oct 7, 2025
c922bb8
remove introduced inplace methods
heckstrahler Oct 7, 2025
28859e7
fix if condition for dataframe
heckstrahler Oct 7, 2025
ddfd275
add metadata to elements
heckstrahler Oct 7, 2025
fee0cd9
Merge branch 'develop' into structure_dict_rework
heckstrahler Oct 7, 2025
98f9592
add additional schema (#2738)
FynnIEE Oct 7, 2025
16582c3
fix less equals error
heckstrahler Oct 7, 2025
47f3da2
reformat imports
heckstrahler Oct 7, 2025
26090b9
set correct dtype for id_characteristic_table, and set
heckstrahler Oct 7, 2025
bdb4d40
fix typo, fix small slow list/dict creation
heckstrahler Oct 7, 2025
842f6b4
make comments into TODOs
heckstrahler Oct 7, 2025
3a93c0e
fixed failing sq_lite test
KS-HTK Oct 8, 2025
02460b5
add schema for ssc element, bug fixes
heckstrahler Oct 8, 2025
c59ae15
revert breaking change, other bugfixes
heckstrahler Oct 8, 2025
f98bddb
fixed test for subnet
KS-HTK Oct 8, 2025
e8bb137
fix typing in build_branch
heckstrahler Oct 8, 2025
c06ec7d
add metadata to csv creation
heckstrahler Oct 8, 2025
b2a9c2d
update get_std_type_structure_dict
heckstrahler Oct 8, 2025
2702e15
Merge branch 'develop' into structure_dict_rework
heckstrahler Oct 9, 2025
8ba8f9c
fixed path loading
KS-HTK Oct 9, 2025
10fb6d0
Merge branch 'develop' into structure_dict_rework
KS-HTK Oct 9, 2025
efd6167
set required correctly for bus, bus_dc
heckstrahler Oct 10, 2025
fe0ac7f
Structure dict rework add additional schemas (#2745)
FynnIEE Oct 13, 2025
cefa047
set better variable names, correct imports, add missing res schemata
heckstrahler Oct 13, 2025
9264dde
set required according to documentation
heckstrahler Oct 13, 2025
f58e9ff
fix bus creation when there is no geo data, other schema fixes
heckstrahler Oct 13, 2025
0b0b0b0
make test_create as runable as possible -> update create, allow non
heckstrahler Oct 15, 2025
dcd98d9
Merge branch 'develop' into structure_dict_rework
heckstrahler Oct 15, 2025
9f3f409
further changes for test create
heckstrahler Oct 16, 2025
1e1f1de
Merge branch 'develop' into structure_dict_rework
heckstrahler Oct 16, 2025
79a2450
fix errors for merge, fix dtype in _set_multiple
heckstrahler Oct 16, 2025
a1aa315
fixed nullable strings dtype, some typing, some sonarlint warnings
heckstrahler Oct 16, 2025
76c7bda
add bus index validation method
heckstrahler Oct 20, 2025
82be396
Merge branch 'develop' into structure_dict_rework
heckstrahler Oct 20, 2025
79ad138
add foreign key for bus in schematas
heckstrahler Oct 21, 2025
d23c4ff
check bus, bus_dc, dcline, ext_grid, gen, set name to pd.StringDtype
heckstrahler Oct 21, 2025
9543829
make res nullable
heckstrahler Oct 21, 2025
4234144
set nullable = true if required = False
heckstrahler Oct 21, 2025
3599233
Merge branch 'develop' into structure_dict_rework
heckstrahler Oct 21, 2025
a90f699
add validation for columns which need to exist together
heckstrahler Oct 23, 2025
6cd7831
Merge branch 'develop' into structure_dict_rework
heckstrahler Oct 23, 2025
64b0a6a
Merge branch 'develop' into structure_dict_rework
heckstrahler Oct 24, 2025
e01b38e
fix import
heckstrahler Oct 24, 2025
3b40c2b
add hint to trafo check
heckstrahler Oct 24, 2025
6ff3331
Merge branch 'develop' into structure_dict_rework
heckstrahler Oct 28, 2025
c5dfaae
update pandera definitions
heckstrahler Oct 28, 2025
2c5ed74
update schemata after plausibility check
heckstrahler Oct 30, 2025
01dad6d
Merge branch 'develop' into structure_dict_rework
heckstrahler Oct 30, 2025
734198a
Merge branch 'develop' into structure_dict_extension
heckstrahler Nov 3, 2025
fbac012
fix import get_dtypes
heckstrahler Nov 3, 2025
4facc12
fixes for test_create
heckstrahler Nov 3, 2025
399c129
add tests for pandera get_dtypes and group_dependency, fix error in
heckstrahler Nov 4, 2025
4c5eeaf
fix dtype in set_multiple_entries, fix geodata init in bus_create, fix
heckstrahler Nov 4, 2025
31f7919
fix group_dependency
heckstrahler Nov 4, 2025
489a6e3
fix various create problems
heckstrahler Nov 4, 2025
253b11a
remove old tools file
heckstrahler Nov 5, 2025
c276d44
update repo
heckstrahler Nov 6, 2025
46bae1a
add pandera bus schema test
heckstrahler Nov 6, 2025
c778c93
move numbers to helper
heckstrahler Nov 6, 2025
482d5e0
fix pandera test bus
heckstrahler Nov 6, 2025
0d7a69f
update schemata
heckstrahler Nov 7, 2025
cd3235f
improve test variables
heckstrahler Nov 7, 2025
5325a1f
Merge branch 'develop' into structure_dict_extension
heckstrahler Nov 7, 2025
b38db52
add zero number so helper
heckstrahler Nov 7, 2025
8f570b6
fix description errors
heckstrahler Nov 13, 2025
d3ee0cc
Merge branch 'develop' into structure_dict_extension
heckstrahler Nov 13, 2025
d8c7bce
update bus schema test
heckstrahler Nov 13, 2025
6d149f8
serveral schema fixes
heckstrahler Nov 13, 2025
2463f87
fix max step for shunt schema
heckstrahler Nov 13, 2025
3190bec
fixes for shunt and sgen schemata
heckstrahler Nov 13, 2025
defaf31
fixes for gen and trafo runpp
heckstrahler Nov 13, 2025
9fd367b
revert build branch calc tap from dataframe problem..
heckstrahler Nov 13, 2025
fb08eb4
set switch z_ohm to required
heckstrahler Nov 14, 2025
6810831
add column_condition, lower equals check creation method
heckstrahler Nov 17, 2025
2a0c2b8
Merge branch 'develop' into structure_dict_extension
heckstrahler Nov 17, 2025
05bcac3
add fixes for test_create
heckstrahler Nov 18, 2025
7be3b81
fix group validation error
heckstrahler Nov 18, 2025
7e3dd07
fix create test
heckstrahler Nov 19, 2025
fda683f
rename pandera test folder
heckstrahler Nov 20, 2025
113f118
fix some cgmes converter problems
heckstrahler Nov 20, 2025
9fa2dc5
fix more errors in converter
heckstrahler Nov 20, 2025
3a08ce3
fix asmcsgen type
heckstrahler Nov 20, 2025
d7ca6f8
fixes in build_branch.py (#2804)
KS-HTK Nov 21, 2025
323db01
fixes for all network and plotting tests (#2805)
KS-HTK Nov 21, 2025
728ce09
restore opf check in bus schema
heckstrahler Nov 24, 2025
8e9decd
Merge branch 'structure_dict_extension' of github.com:e2nIEE/pandapow…
heckstrahler Nov 24, 2025
2e8f8cb
Merge branch 'develop' into structure_dict_extension
heckstrahler Nov 24, 2025
3201c12
fixed issues in test_auxiliary.py (#2808)
KS-HTK Nov 24, 2025
b6ada68
Merge branch 'structure_dict_extension' of github.com:e2nIEE/pandapow…
heckstrahler Nov 24, 2025
beef976
add lower than vor vkr and vk at trafo and trafo3w
heckstrahler Nov 24, 2025
11cebca
add comment
heckstrahler Nov 27, 2025
f4c6533
update schemata
heckstrahler Nov 27, 2025
97ff216
add 3ph to rx min max for ext grid
heckstrahler Nov 27, 2025
17c5b9c
fix create lower than column check
heckstrahler Nov 28, 2025
12df8b7
fix problems with bus max min vmpu creation
heckstrahler Nov 28, 2025
3d26bdf
fix NA from excel, current_source in sgen, discretetapcontrol comparison
heckstrahler Nov 28, 2025
d0755b6
fix run3ph when type is not set
heckstrahler Nov 28, 2025
7267289
fix add dcline gens
heckstrahler Nov 28, 2025
fa41572
Issues/structure dict extension test fixes (#2824)
KS-HTK Dec 2, 2025
93a4938
fixes for grid equivalents
heckstrahler Dec 4, 2025
5f11426
Issues/structure dict extension fix issues (#2825)
KS-HTK Dec 4, 2025
2337fb3
fix bus dc opf nullable
heckstrahler Dec 4, 2025
ea4f697
Issues/structure dict extension fix issues (#2827)
KS-HTK Dec 5, 2025
3b6d5c6
Merge branch 'develop' into structure_dict_extension
heckstrahler Dec 8, 2025
39b4ba1
fix sgen create kappa default
heckstrahler Dec 8, 2025
7191717
Issues/structure dict extension fix issues (#2830)
KS-HTK Dec 9, 2025
0d6565c
Merge branch 'develop' into structure_dict_extension
heckstrahler Jan 27, 2026
c2738e8
add phases for sn_mva in asym load/sgen
heckstrahler Jan 27, 2026
ab6b78a
fix bus create for opf parameter
heckstrahler Jan 27, 2026
0153d8d
fix bus test
heckstrahler Jan 27, 2026
89756fb
fix test_grid_equivalents_auxiliary (test_trafo_phase_shifter)
heckstrahler Jan 27, 2026
33a9614
tap_side fix in _calculate_3w_tap_changers
heckstrahler Jan 27, 2026
a76ab2a
Merge branch 'develop' into structure_dict_extension
heckstrahler Jan 28, 2026
cae985e
added not_ints_list in helper.py (#2798)
lezneew Jan 28, 2026
298cc83
remove redundant test
heckstrahler Jan 28, 2026
da347fc
fix sgen , line, lindc tests
heckstrahler Jan 28, 2026
6f6ed1e
fix storage tests
heckstrahler Jan 28, 2026
54e8abc
fix svc test
heckstrahler Jan 28, 2026
3cfed0c
fix trafo and shunt tests
heckstrahler Jan 28, 2026
7760e69
fix line test
heckstrahler Jan 28, 2026
f3afae8
fix tests
heckstrahler Jan 29, 2026
a59bd20
fix test_get_min_max_q_capability
heckstrahler Jan 29, 2026
b1c02cc
Merge branch 'develop' into structure_dict_extension
heckstrahler Jan 29, 2026
bf1882d
fix for contingency
heckstrahler Jan 29, 2026
76580bd
fix test_recycle_dc_trafo_shift
heckstrahler Jan 29, 2026
3732fdc
compare_tcsc_impedance
heckstrahler Jan 29, 2026
758ece5
fix trafo test
heckstrahler Jan 30, 2026
85a5ee7
fix test_ext_grid_gen_order_in_ppc
heckstrahler Feb 2, 2026
55af02a
Merge branch 'develop' into structure_dict_extension
heckstrahler Feb 2, 2026
ff87463
fix test_merge_with_characteristics
heckstrahler Feb 2, 2026
d06e79e
Merge branch 'develop' into structure_dict_extension
heckstrahler Feb 3, 2026
dddd522
Merge branch 'develop' into structure_dict_extension
heckstrahler Feb 4, 2026
c3ca169
trafo and other smaller fixes
heckstrahler Feb 4, 2026
8ce76d1
Merge branch 'develop' into structure_dict_extension
heckstrahler Feb 5, 2026
8a07afa
fix _add_dcline_gens
heckstrahler Feb 5, 2026
88beb4c
trafo and sc fixes
heckstrahler Feb 5, 2026
a6c44bb
fix test_characteristic
heckstrahler Feb 5, 2026
58b04e5
fixes and sonarcube fixes
heckstrahler Feb 5, 2026
db528a7
fix typing
heckstrahler Feb 5, 2026
5dfb9f5
Merge branch 'develop' into structure_dict_extension
heckstrahler Feb 10, 2026
c098d45
fix test for change element name
heckstrahler Feb 10, 2026
080c07f
Merge branch 'develop' into structure_dict_extension
heckstrahler Feb 11, 2026
c478110
fix network structre res vsc
heckstrahler Feb 11, 2026
99f7520
rename bivsc to vscbipolar
heckstrahler Feb 11, 2026
624ad6c
add add column to df
heckstrahler Feb 11, 2026
3951e2a
Structure dict extension (#2882)
lezneew Feb 12, 2026
b7d9002
Merge branch 'develop' into structure_dict_extension
heckstrahler Feb 12, 2026
cbc51ca
Merge branch 'structure_dict_extension' of github.com:e2nIEE/pandapow…
heckstrahler Feb 12, 2026
6bf2c6b
fix for dev merge introduced errors
heckstrahler Feb 16, 2026
2a3aa39
Merge branch 'develop' into structure_dict_extension
heckstrahler Feb 16, 2026
256d883
set controallable to default false when optional
heckstrahler Feb 16, 2026
7878662
fix tests
heckstrahler Feb 17, 2026
e12240e
Merge branch 'develop' into structure_dict_extension
heckstrahler Feb 17, 2026
445953f
fix create controllable errors
heckstrahler Feb 17, 2026
c52f770
fix name in ucte converter
heckstrahler Feb 18, 2026
9a5607c
fix trafo.df for ucte converter
heckstrahler Feb 18, 2026
8c4e11e
fix stationcontrol
heckstrahler Feb 18, 2026
11826ba
fix sonar warnings
heckstrahler Feb 18, 2026
8e8fea0
Structure dict extension fixes (#2891)
KS-HTK Feb 24, 2026
de7de57
fix test_lightsim2grid_phase_shifters
heckstrahler Feb 24, 2026
aabbab0
Merge branch 'develop' into structure_dict_extension
heckstrahler Feb 24, 2026
474fc39
structure dict extension more fixes (#2892)
KS-HTK Feb 24, 2026
44a8671
Merge branch 'develop' into structure_dict_extension
heckstrahler Mar 4, 2026
eeb93ed
Issues/fixes in structure dict extension (#2900)
KS-HTK Mar 5, 2026
3576a32
Merge branch 'develop' into structure_dict_extension
heckstrahler Mar 5, 2026
6b06b5c
Merge remote-tracking branch 'refs/remotes/origin/structure_dict_exte…
heckstrahler Mar 5, 2026
96899db
add default values to metadata
heckstrahler Mar 5, 2026
2a63865
Issues/fixes in structure dict extension (#2904)
KS-HTK Mar 9, 2026
228b14c
Merge branch 'develop' into structure_dict_extension
heckstrahler Mar 10, 2026
164d8a6
Issues/fixes in structure dict extension (#2920)
KS-HTK Mar 18, 2026
0b10782
fix BinarySearchControl
heckstrahler Mar 18, 2026
83288ba
introduce cim metadata, create columns for cim2pp from schemata, all …
heckstrahler Mar 18, 2026
837b69c
Merge branch 'develop' into structure_dict_extension
Mar 18, 2026
30dd050
fix _update_min_max_q_mvar for station_control
heckstrahler Mar 18, 2026
ce0a6f0
Fix facts structure dict extension (#2922)
KS-HTK Mar 19, 2026
5a0baa5
fixes for cim2pp
heckstrahler Mar 23, 2026
05922c7
Merge branch 'develop' into structure_dict_extension
heckstrahler Mar 24, 2026
1e4be50
Merge branch 'develop' into structure_dict_extension
heckstrahler Mar 24, 2026
6fbb49b
fix mypy
heckstrahler Mar 24, 2026
ff7c95f
fix todos
heckstrahler Mar 24, 2026
967b696
updated docstings (#2934)
KS-HTK Mar 25, 2026
a660e91
add ucte converter tags
heckstrahler Mar 25, 2026
e4526dd
fix bool defaults
heckstrahler Mar 25, 2026
e619606
Merge branch 'develop' into structure_dict_extension
heckstrahler Mar 25, 2026
7c27f99
Feature/get all elements (#2939)
jwiemer112 Mar 25, 2026
16231ef
ltds_fix (#2938)
mrifraunhofer Mar 25, 2026
032cf61
Merge branch 'develop' into structure_dict_extension
heckstrahler Mar 26, 2026
7db7449
added pytest split to tutorial_test pipeline (#2935)
KS-HTK Mar 26, 2026
d5c9719
fixed many links (#2937)
KS-HTK Mar 26, 2026
e7cc0a6
Merge branch 'develop' into structure_dict_extension
heckstrahler Mar 26, 2026
8a3f75a
update pandera version
heckstrahler Mar 26, 2026
a3b66c9
set pandera version interval
heckstrahler Mar 26, 2026
5abc6ff
set pandaer 0.29.0 as max version
heckstrahler Mar 26, 2026
b90cbc6
Fix copyright text formatting in LICENSE file (#2914)
brynpickering Mar 30, 2026
53def8f
added PowerElectronicsConnection to the LTDS converter, updated LTDS …
mrifraunhofer Mar 30, 2026
e0a9fcc
Merge branch 'develop' into structure_dict_extension
heckstrahler Mar 30, 2026
0b92e25
fixes from review
heckstrahler Mar 30, 2026
364cfa8
Merge branch 'release/v4.0.0' into structure_dict_extension
KS-HTK Mar 30, 2026
4171d26
ltds_pce (#2944)
mrifraunhofer Mar 30, 2026
446a1e9
ltds_notebook (#2949)
mrifraunhofer Mar 31, 2026
e19b592
ltds_notebook (#2950)
mrifraunhofer Mar 31, 2026
f90461a
Feature check vkr percent (#2948)
vogt31337 Apr 1, 2026
5c0827d
Feature additional diagnostic functions (#2952)
vogt31337 Apr 2, 2026
7bb6956
Correct loading_percent description in motor_par.csv (#2947)
arisaka97 Apr 2, 2026
aa6f4e9
ucte2pp conversion fixes (#2823)
pawellytaev Apr 2, 2026
7045a2f
Fix 2733 (#2951)
MoritzHauff Apr 2, 2026
712cf18
Fix runopp(init="results") so the OPF solver preserves the model init…
jerelang Apr 2, 2026
b0a54a3
Feature/highlight plot (#2833)
jwiemer112 Apr 2, 2026
6a1ce2b
fixes for review
heckstrahler Apr 7, 2026
37850f1
Merge branch 'develop' into structure_dict_extension
heckstrahler Apr 7, 2026
376b3b2
typing for for network_create
heckstrahler Apr 7, 2026
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
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ Change Log

[upcoming release] - 2026-..-..
-------------------------------
- [FIXED] runopp(init="results") now preserves the warm-start vector in the PIPS-backed AC OPF solver
- [ADDED] added more functions to diagnostic
- [ADDED] check to check if vkr_percent values are reasonable (see issue #786).
- [FIXED] cim2pp shift_lv_degree was translated from wrong entry
- [FIXED] UnboundLocalError in _from_ppc_branch when creating impedance elements
- [ADDED] LTDS support
- [FIXED] ucte2pp: voltage setpoints from gens connected to the same busbar are now averaged
- [FIXED] ucte2pp: small X values are clipped to 0.05 Ohm (according to UCTE-DEF) to increase convergence
- [FIXED] ucte2pp: symmetrical tap changers are now handled as symmetrical tap changers in pandapower (not ideal phase shifters)
- [FIXED] ucte2pp: prevent nan values for impedances and transformers for B/G/P_fe/i0
- [FIXED] cim2pp: CimConverter backwards-compatible (default value for cin_version)
- [FIXED] jao converter: calculation of trafo parameters is based on primary side (hv) now
- [ADDED] toolbox: :code:`get_all_elements` returns all elements of a pp.pandapowerNet as a DataFrame
- [ADDED] highlighting feature and hovering functionality to :code:`simple_plot()`

[3.4.0] - 2026-02-09
-------------------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

sys.path.append(os.path.abspath(".."))
sys.path.insert(0, os.path.abspath(".."))
sys.path.append(os.path.abspath(".\\_themes"))
sys.path.append(os.path.abspath("..\\tests"))
sys.path.append(os.path.abspath("..\\network_generator"))
Expand Down
2 changes: 1 addition & 1 deletion doc/elements/motor_par.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cos_phi *;float;:math:`0...1`;cosine phi at current operating point
cos_phi_n *;float;:math:`0...1`;cosine phi at rated power of the motor for short-circuit calculation
efficiency_percent *;float;:math:`0..100`; Efficiency in percent at current operating point[%]
efficiency_n_percent *;float;:math:`0..100`; Efficiency in percent at rated power for short-circuit calculation [%]
loading_percent *;float;:math:`0..100`; Efficiency in percent at rated power for short-circuit calculation [%] [%]
loading_percent *;float;:math:`0..100`; The mechanical loading in percentage of the rated mechanical power [%]
scaling *;float;:math:`\geq 0`;scaling factor for active and reactive power
lrc_pu *;float;:math:`\geq 0`; locked rotor current in relation to the rated motor current [pu]
rx *;float;:math:`\geq 0`;R/X ratio of the motor for short-circuit calculation.
Expand Down
Binary file added doc/pics/plotting/simple_hl_plot_mv_obi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions doc/plotting/matplotlib/simple_plot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Simple Plotting
=============================

Simple Network Plot
==============================

The function simple_plot() can be used for simple plotting. For advanced possibilities see the
`tutorial <https://nbviewer.org/github/e2nIEE/pandapower/blob/develop/tutorials/plotting_basic.ipynb>`__.

Expand All @@ -16,3 +19,23 @@ A helper function for angle calculation is provided.
It will use all elements in a network to calculate angles for each patch based on the amount of elements at each bus.

.. autofunction:: pandapower.plotting.calculate_unique_angles

Simple Highlighting Plot
==============================

The function ``simple_plot()`` can also highlight lines or buses in a simple network plot. The highlighted
elements are displayed in red and enlarged. Additionally, buses and lines can be located directly
in the plot by hovering the mouse over a specific line or bus. The ``name`` and ``index`` will be shown in
a small box: ::

net = mv_oberrhein()
ol_lines = net.line.loc[net.line.type=="ol"].index
ol_buses = net.bus.index[net.bus.index.isin(net.line.from_bus.loc[ol_lines]) |
net.bus.index.isin(net.line.to_bus.loc[ol_lines])]

simple_plot(net, hl_lines=ol_lines, hl_buses=ol_buses, enable_hovering=True)


.. image:: /pics/plotting/simple_hl_plot_mv_obi.png
:width: 80em
:align: left
4 changes: 2 additions & 2 deletions pandapower/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "3.4.0"
__format_version__ = "3.1.0"
__version__ = "4.0.0"
__format_version__ = "4.0.0"
93 changes: 60 additions & 33 deletions pandapower/auxiliary.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
geopandas_available = True
except ImportError:
geopandas_available = False
# for typing only
GeoSeries = object


PyPowerNetwork = dict[str, Any]
Expand All @@ -86,6 +88,7 @@
T = TypeVar("T")


# FIXME: Remove this!

Check warning on line 91 in pandapower/auxiliary.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Take the required action to fix the issue indicated by this "FIXME" comment.

See more on https://sonarcloud.io/project/issues?id=e2nIEE_pandapower&issues=AZyOtaDMI67CawlRkvzj&open=AZyOtaDMI67CawlRkvzj&pullRequest=2788
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be removed? If so remove.

def log_to_level(
msg: str,
passed_logger: logging.Logger,
Expand All @@ -110,6 +113,7 @@
level: Literal["error", "warning", "info", "debug", "UserWarning"] = "UserWarning",
ignore_not_installed: bool = False
) -> None:
# FIXME: version should NEVER be defined in code!

Check warning on line 116 in pandapower/auxiliary.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Take the required action to fix the issue indicated by this "FIXME" comment.

See more on https://sonarcloud.io/project/issues?id=e2nIEE_pandapower&issues=AZyOtaDMI67CawlRkvzk&open=AZyOtaDMI67CawlRkvzk&pullRequest=2788
minimum_version = {'plotly': "3.1.1",
'numba': "0.25",
}
Expand Down Expand Up @@ -479,7 +483,7 @@

@classmethod
def create_dataframes(cls, data):
for key in data: #TODO: change index dtype to np.uint32
for key in data:
if isinstance(data[key], dict):
data[key] = pd.DataFrame(columns=data[key].keys(), index=pd.Index([], dtype=np.int64)).astype(data[key])
return data
Expand All @@ -492,7 +496,7 @@
"""
par = []
res = []
for et in list(self.keys()):
for et in self.keys():
if not et.startswith("_") and isinstance(self[et], pd.DataFrame) and len(self[et]) > 0:
n_rows = self[et].shape[0]
if 'res_' in et:
Expand Down Expand Up @@ -653,6 +657,8 @@
def empty_defaults_per_dtype(dtype: np.dtype[Any]) -> Any:
if is_numeric_dtype(dtype):
return np.nan
elif isinstance(dtype, pd.StringDtype):
return pd.NA
elif is_string_dtype(dtype):
return ""
elif is_object_dtype(dtype):
Expand All @@ -662,12 +668,10 @@


def _preserve_dtypes(df: pd.DataFrame, dtypes: pdt.Series[np.dtype[Any]]) -> None:
for item, dtype in list(dtypes.items()):
for item, dtype in dtypes.items():
if df.dtypes.at[item] != dtype:
if (dtype == bool or dtype == np.bool_) and np.any(df[item].isnull()):
raise UserWarning(f"Encountered NaN value(s) in a boolean column {item}! "
f"NaN are casted to True by default, which can lead to errors. "
f"Replace NaN values with True or False first.")
df[item] = df[item].fillna(pd.NA).astype('boolean')
try:
df[item] = df[item].astype(dtype)
except ValueError:
Expand Down Expand Up @@ -997,7 +1001,10 @@

# read functions:
def _read_from_single_index(net: pandapowerNet, element: str, variable: str, index: np.int64) -> Any:
return net[element].at[index, variable]
if variable in net[element]:
return net[element].at[index, variable]
else:
return pd.NA


def _read_from_all_index(net: pandapowerNet, element: str, variable: str) -> NDArray[Any]:
Expand Down Expand Up @@ -1316,11 +1323,10 @@
ppc_bus_isolated = np.zeros(ppc["bus"].shape[0], dtype=bool)
ppc_bus_isolated[isolated_nodes] = True
set_isolated_buses_oos(bus_in_service, ppc_bus_isolated, net["_pd2ppc_lookups"]["bus"])
# mode = net["_options"]["mode"]
elements_ac = ["load", "motor", "sgen", "asymmetric_load", "asymmetric_sgen", "gen",
"ward", "xward", "shunt", "ext_grid", "storage", "svc", "ssc", "vsc"] # ,"impedance_load"
elements_dc = ["vsc", "load_dc", "source_dc"]
is_elements = dict()
is_elements = {}
for element_table_list, bus_table, bis in zip((elements_ac, elements_dc), ("bus", "bus_dc"), (bus_in_service, bus_dc_in_service)):
for element_table in element_table_list:
num_elements = len(net[element_table].index)
Expand Down Expand Up @@ -1404,8 +1410,6 @@
"""
creates dictionary for pf, opf and short circuit calculations from input parameters.
"""
# if recycle is None:
# recycle = dict(trafo=False, bus_pq=False, bfsw=False)

init_results = (isinstance(init_vm_pu, str) and (init_vm_pu == "results")) or \
(isinstance(init_va_degree, str) and (init_va_degree == "results"))
Expand Down Expand Up @@ -1544,13 +1548,11 @@


def _add_options(net: pandapowerNet, options: dict[str, Any]) -> None:
# double_parameters = set(net.__internal_options.keys()) & set(options.keys())
double_parameters = set(net._options.keys()) & set(options.keys())
if len(double_parameters) > 0:
raise UserWarning(
"Parameters always have to be unique! The following parameters where specified " +
"twice: %s" % double_parameters)
# net.__internal_options.update(options)
net._options.update(options)


Expand Down Expand Up @@ -1953,7 +1955,11 @@
p_mw = np.abs(dctab.p_mw)
p_loss = p_mw * (1 - dctab.loss_percent / 100) - dctab.loss_mw # type: ignore[operator]

max_p_mw: float = dctab.max_p_mw # type: ignore[assignment]
max_p_mw: float
if hasattr(dctab, 'max_p_mw') and pd.notna(dctab.max_p_mw):
max_p_mw = dctab.max_p_mw # type: ignore[assignment]
else:
max_p_mw = float('nan')
p_min: float
p_max: float
if np.sign(dctab.p_mw) > 0:
Expand All @@ -1967,15 +1973,41 @@
p_max = 0
p_min = -max_p_mw

create_gen(net, bus=dctab.to_bus, p_mw=p_to, vm_pu=dctab.vm_to_pu,
min_p_mw=p_min, max_p_mw=p_max,
max_q_mvar=dctab.max_q_to_mvar, min_q_mvar=dctab.min_q_to_mvar,
in_service=dctab.in_service)

create_gen(net, bus=dctab.from_bus, p_mw=p_from, vm_pu=dctab.vm_from_pu,
min_p_mw=-p_max, max_p_mw=-p_min,
max_q_mvar=dctab.max_q_from_mvar, min_q_mvar=dctab.min_q_from_mvar,
in_service=dctab.in_service)
kwargs_to = {
'bus': dctab.to_bus,
'p_mw': p_to,
'vm_pu': dctab.vm_to_pu,
'in_service': dctab.in_service
}

if hasattr(dctab, 'min_p_mw'):
kwargs_to['min_p_mw'] = p_min
if hasattr(dctab, 'max_p_mw'):
kwargs_to['max_p_mw'] = p_max
if hasattr(dctab, 'max_q_to_mvar'):
kwargs_to['max_q_mvar'] = dctab.max_q_to_mvar
if hasattr(dctab, 'min_q_to_mvar'):
kwargs_to['min_q_mvar'] = dctab.min_q_to_mvar

create_gen(net, **kwargs_to)

kwargs_from = {
'bus': dctab.from_bus,
'p_mw': p_from,
'vm_pu': dctab.vm_from_pu,
'in_service': dctab.in_service
}

if hasattr(dctab, 'max_p_mw'):
kwargs_from['min_p_mw'] = -p_max
if hasattr(dctab, 'min_p_mw'):
kwargs_from['max_p_mw'] = -p_min
if hasattr(dctab, 'max_q_from_mvar'):
kwargs_from['max_q_mvar'] = dctab.max_q_from_mvar
if hasattr(dctab, 'min_q_from_mvar'):
kwargs_from['min_q_mvar'] = dctab.min_q_from_mvar

create_gen(net, **kwargs_from)


def _add_vsc_stacked(net: pandapowerNet):
Expand Down Expand Up @@ -2093,7 +2125,7 @@
lightsim2grid = kwargs.get("lightsim2grid", "auto")

# for all the parameters from 'overrule_options' we need to collect them
# if they are used for any of the chjecks below:
# if they are used for any of the checks below:
algorithm = overrule_options.get("algorithm", algorithm)
calculate_voltage_angles = overrule_options.get("calculate_voltage_angles", calculate_voltage_angles)
init = overrule_options.get("init", init)
Expand All @@ -2107,15 +2139,11 @@
# tolerance_mva, trafo_model, trafo_loading, enforce_p_lims, enforce_q_lims, check_connectivity, consider_line_temperature

# check if numba is available and the corresponding flag
if numba:
numba = _check_if_numba_is_installed()
numba &= _check_if_numba_is_installed()

if voltage_depend_loads:
if not (np.any(net["load"]["const_z_p_percent"].values)
or np.any(net["load"]["const_i_p_percent"].values)
or np.any(net["load"]["const_z_q_percent"].values)
or np.any(net["load"]["const_i_q_percent"].values)):
voltage_depend_loads = False
cols = {"const_z_p_percent", "const_i_p_percent", "const_z_q_percent", "const_i_q_percent"}
# if const parameters are not set voltage_depend_loads is deactivated
voltage_depend_loads &= bool(cols.issubset(net.load.columns) and net.load[list(cols)].any().any())

lightsim2grid = _check_lightsim2grid_compatibility(net, lightsim2grid, voltage_depend_loads, algorithm,
distributed_slack, tdpf)
Expand Down Expand Up @@ -2320,7 +2348,6 @@
# scipy spsolve options in NR power flow
use_umfpack = kwargs.get("use_umfpack", True)
permc_spec = kwargs.get("permc_spec", None)
# net.__internal_options = {}
net._options = {}
_add_ppc_options(net, calculate_voltage_angles=calculate_voltage_angles,
trafo_model=trafo_model, check_connectivity=check_connectivity,
Expand Down
Loading
Loading