本文整理汇总了Python中line_profiler.LineProfiler.run方法的典型用法代码示例。如果您正苦于以下问题:Python LineProfiler.run方法的具体用法?Python LineProfiler.run怎么用?Python LineProfiler.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类line_profiler.LineProfiler
的用法示例。
在下文中一共展示了LineProfiler.run方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: msg_mass
# 需要导入模块: from line_profiler import LineProfiler [as 别名]
# 或者: from line_profiler.LineProfiler import run [as 别名]
parser.add_argument('--plot', action='store_true', help='Upload time plot to plotly')
args = parser.parse_args()
if args.time:
xxx = msg_mass()
test_full_client(xxx)
if args.cprof:
import cProfile
xxx = msg_mass()
cProfile.run("test_full_client(xxx)", sort="tottime")
if args.lprof:
from line_profiler import LineProfiler
#import rscoin.rscservice
profile = LineProfiler(rscoin.rscservice.RSCProtocol.handle_Query,
rscoin.rscservice.RSCFactory.process_TxQuery,
rscoin.Tx.check_transaction,
rscoin.Tx.check_transaction_utxo,
rscoin.Tx.parse)
xxx = msg_mass()
profile.run("test_full_client(xxx)")
profile.print_stats()
示例2: print
# 需要导入模块: from line_profiler import LineProfiler [as 别名]
# 或者: from line_profiler.LineProfiler import run [as 别名]
except:
pass
# print data.iloc[0:num, i]
frame = pd.DataFrame.from_items(d, orient="index", columns=["Median (0.25)", "Error (%)", "Median (0.05)", "Error (%)", "Truth"])
print(frame.to_latex(float_format=(lambda x: u"%1.1f" % x)))
if args.time:
test_median()
if args.size:
size_vs_error()
if args.quality:
no_test_DP_median()
if args.cprof:
import cProfile
cProfile.run("test_median()", sort="tottime")
if args.lprof:
from line_profiler import LineProfiler
profile = LineProfiler(test_median, CountSketchCt.estimate, CountSketchCt.aggregate,
Ct.__add__, EcPt.__add__, EcPt.__neg__, EcPt.__copy__,)
profile.run("test_median()")
profile.print_stats()
示例3: zip
# 需要导入模块: from line_profiler import LineProfiler [as 别名]
# 或者: from line_profiler.LineProfiler import run [as 别名]
for timestamp in bit_2_events[-5:]:
print "unstrobed bit 2 t=%f" % timestamp
print "found %d bit 3 events. Last 5 events are:" %(len(bit_3_events))
for timestamp in bit_3_events[-5:]:
print "unstrobed bit 3 t=%f" % timestamp
unstrobed_word = pu.GetExtEvents(data, event='unstrobed_word', online=False)
print "found %d unstrobed word events in which 10 events are:" %(len(unstrobed_word['value']))
indices = np.arange(0,len(unstrobed_word['value']),len(unstrobed_word['value'])/10)
for value,timestamp in zip(unstrobed_word['value'][indices],unstrobed_word['timestamp'][indices]) :
binary_value = bin(value)
print "unstrobed word:%s t=%f" % (binary_value,timestamp)
if __name__ == "__main__":
#run()
profile = LineProfiler()
profile.add_function(run)
profile.add_function(PlexUtil.GetExtEvents)
profile.add_function(reconstruct_word)
profile.run('run()')
profile.print_stats()
profile.dump_stats("testPlexFile_profile.lprof")
#cProfile.run('run()','PlexFile_profile')
#p = pstats.Stats('testPlexFile_profile.lprof')
#p.sort_stats('cumulative')
#p.print_stats()
#print h.heap()
示例4: LineProfiler
# 需要导入模块: from line_profiler import LineProfiler [as 别名]
# 或者: from line_profiler.LineProfiler import run [as 别名]
properties[i].append(objects[j].moments_hu())
properties[i].append(objects[j].image())
properties[i].append(objects[j].label)
properties[i].append(objects[j].major_axis_length())
properties[i].append(objects[j].max_intensity())
properties[i].append(objects[j].mean_intensity())
properties[i].append(objects[j].min_intensity())
properties[i].append(objects[j].minor_axis_length())
properties[i].append(objects[j].moments())
properties[i].append(objects[j].moments_normalized())
properties[i].append(objects[j].orientation())
properties[i].append(objects[j].perimeter())
properties[i].append(objects[j].solidity())
properties[i].append(objects[j].weighted_moments_central())
properties[i].append(objects[j].weighted_centroid())
properties[i].append(objects[j].weighted_moments_hu())
properties[i].append(objects[j].weighted_moments())
properties[i].append(objects[j].weighted_moments_normalized())
return properties, prop_names
if __name__ == '__main__':
image = io.imread('test-image.png')
green = image[..., 1].copy()
lp = LineProfiler()
lp.add_function(object_features)
lp.run('intensity_object_features(green, 100)')
lp.print_stats()
lp.dump_stats('profile.lprof')
print(__file__)
示例5: notest_timing
# 需要导入模块: from line_profiler import LineProfiler [as 别名]
# 或者: from line_profiler.LineProfiler import run [as 别名]
args = parser.parse_args()
if args.time:
notest_timing(31)
if args.cprof:
import cProfile
cProfile.run("notest_timing(51)", sort="tottime")
if args.lprof:
from line_profiler import LineProfiler
profile = LineProfiler(VerifyOneOfN, ProveOneOfN, Bn.__init__, Bn.__del__)
profile.run("notest_timing(31)")
profile.print_stats()
if args.plot:
all_sizes, prove_time, verify_time = notest_timing()
import plotly.plotly as py
from plotly.graph_objs import *
trace0 = Scatter(
x=all_sizes,
y=prove_time,
name='Proving',
)