本文整理汇总了Python中reprep.Report.section方法的典型用法代码示例。如果您正苦于以下问题:Python Report.section方法的具体用法?Python Report.section怎么用?Python Report.section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reprep.Report
的用法示例。
在下文中一共展示了Report.section方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: visualize_result
# 需要导入模块: from reprep import Report [as 别名]
# 或者: from reprep.Report import section [as 别名]
def visualize_result(config, id_tc, id_algo, stats):
""" Returns a report """
set_current_config(config)
result = stats["result"]
r = Report("%s-%s" % (id_tc, id_algo))
# tc = config.testcases.instance(id_tc)
# discdds = config.discdds.instance(tc.id_discdds)
algo = stats["algo"]
tc = stats["tc"]
discdds = algo.get_dds()
tc.display(r.section("testcase"), discdds=discdds)
if not result.success:
r.text("warning", "Plannning unsuccesful")
else:
rsol = r.section("solution")
rsol.text("plan", "Plan: %s" % str(result.plan))
y0 = tc.y0
y1 = tc.y1
y1plan = discdds.predict(y0, result.plan)
mismatch = np.abs(y1.get_values() - y1plan.get_values()).sum(axis=2)
f = rsol.figure(cols=4)
zoom = lambda x: rgb_zoom(x, 8)
f.data_rgb("y1plan", zoom(y1plan.get_rgb()), caption="plan prediction (certain)")
f.data_rgb("y1plan_certain", zoom(y1plan.get_rgb_uncertain()), caption="certainty of prediction")
f.data_rgb(
"mismatch",
zoom(scale(mismatch)),
caption="Mismatch value pixel by pixel " "(zero for synthetic testcases...)",
)
algo.plan_report(r.section("planning"), result, tc)
extra = result.extra
write_log_lines(r, extra)
return r
示例2: visualize_result
# 需要导入模块: from reprep import Report [as 别名]
# 或者: from reprep.Report import section [as 别名]
def visualize_result(id_tc, id_algo, stats):
""" Returns a report """
result = stats['result']
r = Report('%s-%s' % (id_tc, id_algo))
# tc = config.testcases.instance(id_tc)
# discdds = config.discdds.instance(tc.id_discdds)
algo = stats['algo']
tc = stats['tc']
discdds = algo.get_dds()
tc.display(r.section('testcase'), discdds=discdds)
if not result.success:
r.text('warning', 'Plannning unsuccesful')
else:
rsol = r.section('solution')
rsol.text('plan', 'Plan: %s' % str(result.plan))
y0 = tc.y0
y1 = tc.y1
y1plan = discdds.predict(y0, result.plan)
mismatch = np.abs(y1.get_values() - y1plan.get_values()).sum(axis=2)
f = rsol.figure(cols=4)
zoom = lambda x: rgb_zoom(x, 8)
f.data_rgb('y1plan', zoom(y1plan.get_rgb()),
caption='plan prediction (certain)')
f.data_rgb('y1plan_certain', zoom(y1plan.get_rgb_uncertain()),
caption='certainty of prediction')
f.data_rgb('mismatch', zoom(scale(mismatch)),
caption='Mismatch value pixel by pixel '
'(zero for synthetic testcases...)')
algo.plan_report(r.section('planning'), result, tc)
extra = result.extra
write_log_lines(r, extra)
return r
示例3: predict_report
# 需要导入模块: from reprep import Report [as 别名]
# 或者: from reprep.Report import section [as 别名]
def predict_report(data_central, id_agent, id_robot, statistics, save_pickle=False):
from reprep import Report
u_stats = statistics['u_stats']
y_dot_stats = statistics['y_dot_stats']
y_dot_sign_stats = statistics['y_dot_sign_stats']
id_state = statistics['id_state']
basename = 'pred-%s-%s' % (id_agent, id_robot)
r = Report(basename)
y_dot_stats.publish(r.section('y_dot'))
y_dot_sign_stats.publish(r.section('y_dot_sign'))
u_stats.publish(r.section('u'))
ds = data_central.get_dir_structure()
report_dir = ds.get_report_res_dir(id_agent=id_agent, id_robot=id_robot,
id_state=id_state, phase='predict')
filename = ds.get_report_filename(id_agent=id_agent, id_robot=id_robot,
id_state=id_state, phase='predict')
save_report(data_central, r, filename, resources_dir=report_dir,
save_pickle=save_pickle)
示例4: all_demos
# 需要导入模块: from reprep import Report [as 别名]
# 或者: from reprep.Report import section [as 别名]
def all_demos(argv): #@UnusedVariable
if len(argv) == 0:
which = DemoStorage.demos.keys()
else:
which = argv
print(DemoStorage.demos.keys())
r = Report('reprep_demos')
for id_f in which:
demof = DemoStorage.demos[id_f]
ri = r.section(nid='%s' % demof.__name__, caption=demof.__doc__)
ri.text('source', inspect.getsource(demof))
with ri.subsection('output') as sub:
demof(sub)
r.to_html('reprep_demos_out/index.html')
示例5: main
# 需要导入模块: from reprep import Report [as 别名]
# 或者: from reprep.Report import section [as 别名]
def main():
theta = get_uniform_directions(360, 180)
D = distances_from_angles(theta)
def identity(x):
return x
def exp1(x):
return np.exp(-x)
def exp2(x):
return np.exp(-5 * x)
def exp3(x):
return np.exp(-x * x)
def p1(x):
return np.cos(2 * np.pi - x)
functions = [identity, exp1, exp2, exp3, p1]
r = Report()
for function in functions:
name = function.__name__
section = r.section(name)
f = section.figure()
M = function(D)
sigma = 0.0001
D1 = np.maximum(0, D + sigma * np.random.randn(*D.shape))
M1 = function(D1)
with f.plot('svd') as pylab:
plot_matrix_svd(pylab, M)
with f.plot('svd1', caption='Perturbed') as pylab:
plot_matrix_svd(pylab, M1)
out = 'check_rank.html'
print('Writing to %r' % out)
r.to_html(out)