You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse the tutorials and tests for usefull code snippets and examples of use
Issue
first, net is right,and pp.runpp(net, max_iteration=10, tolerance_mva=1e-5, numba=True) is successful!
but,I tried to design a state estimation example,as bellow:
def state_estimation(self, request):
bb_case_id = request.GET.get("bb_case_id")
net_json = bb_service.get_json_format_net(bb_case_id=bb_case_id)
net = pp.from_json_string(net_json)
# 假设 df 是你的 DataFrame 对象
print(net.bus)
for index, row in net.bus.iterrows():
if row['dt_vn_kv'] is None or row['dt_vn_kv'] <0.1:
print(str(index)+':'+row['name']+':'+row['bus_name'])
else:
pp.create_measurement(net, "v", "bus",row['dt_vn_kv']/row['vn_kv'], 0.004, index)
I tried to running,but report error。
[2024-11-03 07:28:39][dvadmin.utils.exception.CustomExceptionHandler():54] [ERROR] Traceback (most recent call last):
File "D:\workspace_py\energy-api\venv\lib\site-packages\rest_framework\views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "D:\workspace_py\energy-api\dvadmin\poweranalysis\views\CimeModel.py", line 534, in state_estimation
success = est.estimate(net, init="flat")
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\state_estimation.py", line 87, in estimate
return se.estimate(v_start=v_start, delta_start=delta_start,
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\state_estimation.py", line 262, in estimate
self.net, self.ppc, self.eppci = pp2eppci(self.net, v_start=v_start, delta_start=delta_start,
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\ppc_conversion.py", line 410, in pp2eppci
ppci = _add_measurements_to_ppci(net, ppci, zero_injection)
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\ppc_conversion.py", line 198, in _add_measurements_to_ppci
bus_append = _add_zero_injection(net, ppci, bus_append, zero_injection)
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\ppc_conversion.py", line 291, in _add_zero_injection
bus_append[aux_bus, ZERO_INJ_FLAG] = True
IndexError: index 1866 is out of bounds for axis 0 with size 999
Label
Relevant labels are selected
The text was updated successfully, but these errors were encountered:
Feature Checklist
Searched the issues page for similar reports
Read the relevant sections of the documentation
Browse the tutorials and tests for usefull code snippets and examples of use
Issue
first, net is right,and pp.runpp(net, max_iteration=10, tolerance_mva=1e-5, numba=True) is successful!
but,I tried to design a state estimation example,as bellow:
def state_estimation(self, request):
bb_case_id = request.GET.get("bb_case_id")
net_json = bb_service.get_json_format_net(bb_case_id=bb_case_id)
net = pp.from_json_string(net_json)
# 假设 df 是你的 DataFrame 对象
print(net.bus)
for index, row in net.bus.iterrows():
if row['dt_vn_kv'] is None or row['dt_vn_kv'] <0.1:
print(str(index)+':'+row['name']+':'+row['bus_name'])
else:
pp.create_measurement(net, "v", "bus",row['dt_vn_kv']/row['vn_kv'], 0.004, index)
I tried to running,but report error。
[2024-11-03 07:28:39][dvadmin.utils.exception.CustomExceptionHandler():54] [ERROR] Traceback (most recent call last):
File "D:\workspace_py\energy-api\venv\lib\site-packages\rest_framework\views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "D:\workspace_py\energy-api\dvadmin\poweranalysis\views\CimeModel.py", line 534, in state_estimation
success = est.estimate(net, init="flat")
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\state_estimation.py", line 87, in estimate
return se.estimate(v_start=v_start, delta_start=delta_start,
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\state_estimation.py", line 262, in estimate
self.net, self.ppc, self.eppci = pp2eppci(self.net, v_start=v_start, delta_start=delta_start,
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\ppc_conversion.py", line 410, in pp2eppci
ppci = _add_measurements_to_ppci(net, ppci, zero_injection)
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\ppc_conversion.py", line 198, in _add_measurements_to_ppci
bus_append = _add_zero_injection(net, ppci, bus_append, zero_injection)
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\ppc_conversion.py", line 291, in _add_zero_injection
bus_append[aux_bus, ZERO_INJ_FLAG] = True
IndexError: index 1866 is out of bounds for axis 0 with size 999
Label
The text was updated successfully, but these errors were encountered: