Esempio n. 1
0
def test_excel(net_in, tempdir):
    filename = os.path.join(tempdir, "testfile.xlsx")
    pp.to_excel(net_in, filename)
    net_out = pp.from_excel(filename)
    assert_net_equal(net_in, net_out)

    pp.set_user_pf_options(net_in, tolerance_kva=1e3)
    pp.to_excel(net_in, filename)
    net_out = pp.from_excel(filename)
    assert_net_equal(net_in, net_out)
    assert net_out.user_pf_options == net_in.user_pf_options
Esempio n. 2
0
def test_excel(net_in, tmp_path):
    filename = os.path.abspath(str(tmp_path)) + "testfile.xlsx"
    pp.to_excel(net_in, filename)
    net_out = pp.from_excel(filename)
    assert_net_equal(net_in, net_out)

    # test in user_pf_options are equal
    pp.set_user_pf_options(net_in, tolerance_mva=1e3)
    pp.to_excel(net_in, filename)
    net_out = pp.from_excel(filename)
    assert_net_equal(net_in, net_out)
    assert net_out.user_pf_options == net_in.user_pf_options
Esempio n. 3
0
def test_excel():
    net_in = create_test_network()
    net_in.line_geodata.loc[0, "coords"] = [(1.1, 2.2), (3.3, 4.4)]
    net_in.line_geodata.loc[1, "coords"] = [(5.5, 5.5), (6.6, 6.6), (7.7, 7.7)]
    pp.to_excel(net_in, "testfile.xlsx")
    net_out = pp.from_excel("testfile.xlsx")
    assert_net_equal(net_in, net_out)
    os.remove('testfile.xlsx')
 def mainLoadClicked(self):
     file_to_open = ""
     file_to_open = QFileDialog.getOpenFileName(filter="*.xlsx, *.p")
     if file_to_open[0] != "":
         fn = file_to_open[0]
         if fn.endswith(".xlsx"):
             try:
                 net = pp.from_excel(file_to_open[0], convert=True)
             except:
                 print("couldn't open %s" % fn)
                 return
         elif file_to_open[0].endswith(".p"):
             try:
                 net = pp.from_pickle(file_to_open[0], convert=True)
             except:
                 print("couldn't open %s" % fn)
                 return
         self.load_network(net)
import pandapower as pp
#import pandapower.networks as pn
import numpy as np
import pandapower.plotting as plot
import matplotlib.pyplot as plt
import pandas as pd
from pandapower.plotting.plotly import simple_plotly
from pandapower.estimation import estimate


%%time
#read overall net from excel file
net = pp.from_excel("final code/circuits/net3.xlsx")
#net
#make some network plots
# plot.simple_plot(net, show_plot=True, trafo_size = 1.25, plot_loads = True, plot_sgens = True)
#
# simple_plotly(net,respect_switches=True )


####INDUSTRIAL FEEDER###########
ind_feeder = pp.from_excel("final code/circuits/ind_feeder.xlsx")
#ind_feeder
#make some network plots
# plot.simple_plot(ind_feeder, show_plot=True, trafo_size = 1.5, plot_loads = True, plot_sgens = True)
#simple_plotly(ind_feeder)


####RESIDENTIAL FEEDER###########
res_feeder = pp.from_excel("final code/circuits/res_feeder.xlsx")
#res_feeder
Esempio n. 6
0
def test_excel(net_in, tempdir):
    filename = os.path.join(tempdir, "testfile.xlsx")
    pp.to_excel(net_in, filename)
    net_out = pp.from_excel(filename)
    assert_net_equal(net_in, net_out)
import pandapower as pp
#import pandapower.networks as pn
import pandas as pd
from pandapower.estimation import estimate


%%time
net = pp.from_excel("final code/circuits/net3.xlsx")

net.measurement = pd.read_excel('final code/measurements/net_m.xlsx')


succes = estimate(net, init='flat')
print(succes)
net.res_line_est
net.res_bus_est
net.res_line_est.to_excel('final code/result/line_simp.xlsx')
net.res_bus_est.to_excel('final code/result/bus_simp.xlsx')
Esempio n. 8
0
import numpy as np
import pandapower.plotting as plot
import matplotlib.pyplot as plt
from pandapower.plotting.plotly import vlevel_plotly
import pandas as pd

net = pn.create_cigre_network_lv()
net
plot.simple_plot(net, show_plot=True)

vlevel_plotly(net)

#del net.bus_geodata
pp.convert_format(net)
pp.to_excel(net, "examplecigrelow.xlsx")

netcoords = net.bus_geodata
netcoords.to_excel('cigrecoords.xlsx')

netlv = pp.from_excel("final code/examplecigrelow.xlsx")
#lv.bus_geodata
#del netlv.bus_geodata
netlv
plot.simple_plot(netlv, show_plot=True)
vlevel_plotly(netlv)

#vlevel_plotly(net)
netlv
net
netlv.bus_geodata