Skip to content

mypy check previously excluded folders#2787

Open
kornerc wants to merge 11 commits intoe2nIEE:developfrom
kornerc:typing-extend
Open

mypy check previously excluded folders#2787
kornerc wants to merge 11 commits intoe2nIEE:developfrom
kornerc:typing-extend

Conversation

@kornerc
Copy link
Contributor

@kornerc kornerc commented Oct 28, 2025

Check typing of previously excluded folders with mypy

  • control
  • converter
  • estimation
  • plotting
  • protection

@codecov
Copy link

codecov bot commented Oct 28, 2025

Codecov Report

❌ Patch coverage is 75.38462% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.98%. Comparing base (bb605b2) to head (66724f1).

Files with missing lines Patch % Lines
pandapower/converter/jao/from_jao.py 63.63% 8 Missing ⚠️
...lasses/connectivitynodes/connectivityNodesCim16.py 14.28% 6 Missing ⚠️
pandapower/estimation/algorithm/base.py 50.00% 4 Missing ⚠️
pandapower/converter/cim/pp_classes.py 0.00% 3 Missing ⚠️
...ower/converter/powerfactory/pp_import_functions.py 71.42% 2 Missing ⚠️
pandapower/protection/utility_functions.py 33.33% 2 Missing ⚠️
...erter_classes/impedance/seriesCompensatorsCim16.py 75.00% 1 Missing ⚠️
...cim2pp/converter_classes/switches/switchesCim16.py 75.00% 1 Missing ⚠️
pandapower/converter/cim/cim_classes.py 87.50% 1 Missing ⚠️
pandapower/converter/cim/cim_tools.py 75.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2787   +/-   ##
========================================
  Coverage    71.98%   71.98%           
========================================
  Files          351      351           
  Lines        37424    37433    +9     
========================================
+ Hits         26939    26946    +7     
- Misses       10485    10487    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

from pandapower.control.controller.DERController import PQVArea4120V1, PQVArea4120V2, PQVArea4120V3

pq_area = PQVArea4120V1()
plot_pq_area(pq_area, "PQVArea4120V1")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

plot_pq_area has the signature def plot_pq_area(pq_area, **kwargs):, thus, it cannot have a second positional argument

return self._interpolator

@interpolator.getter
@interpolator.getter # type: ignore[misc]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Above interpolator is defined as property here the getter is directly afterwards overwritten.
Additionally, this method returns something; is this a typo and it should be the setter instead?

Comment on lines 8 to 19
from pandapower import __version__ as pp_version
from pandapower.control.controller.trafo import DiscreteTapControl
from pandapower.control.util.auxiliary import create_trafo_characteristics
from pandapower.control.util.auxiliary import _create_trafo_characteristics
from pandapower.file_io import to_json
from pandapower.networks.create_examples import example_multivoltage
from pandapower.run import runpp

net = example_multivoltage()
DiscreteTapControl(net, 1, 1.02, 1.03)
create_trafo_characteristics(net, "trafo", 1, "vk_percent", [-2, 0, 2], [3.5, 4, 4.5])
DiscreteTapControl.DiscreteTapControl(net, 1, 1.02, 1.03)
_create_trafo_characteristics(net, "trafo", 1, "vk_percent", [-2, 0, 2], [3.5, 4, 4.5])
runpp(net, run_control=True)
to_json(net, os.path.join("old_versions", "example_%s.json" % pp_version))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this code used at all?
It seems like it had some errors...

trafo_dict = {}
trafo3w_dict = {}
impedance_dict = {}
impedance_dict = {} # type: ignore[name-defined]
Copy link
Contributor Author

@kornerc kornerc Nov 6, 2025

Choose a reason for hiding this comment

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

impedance_dict is not a global variable even though it is a global variable.
Should I create a gloabal variable for that?

@kornerc kornerc marked this pull request as ready for review November 6, 2025 19:05
@kornerc
Copy link
Contributor Author

kornerc commented Nov 6, 2025

The PR is ready for review.

I left some comments, some act just as an information others point to potential bugs.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 6, 2025

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants