How to use the timemory.plotting.plot function in timemory

To help you get started, we’ve selected a few timemory examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tomopy / tomopy / benchmarking / pyctest_tomopy_phantom.py View on Github external
else:
        print("Reconstructing with {}...".format(args.algorithm))
        imgs = run(args.phantom, args.algorithm, args)

    # timing report to stdout
    print('{}\n'.format(manager))

    timemory.options.output_dir = "{}/{}/{}".format(
        args.output_dir, args.phantom, algorithm)
    timemory.options.set_report("run_tomopy.out")
    timemory.options.set_serial("run_tomopy.json")
    manager.report()

    # provide timing plots
    try:
        timemory.plotting.plot(files=[timemory.options.serial_filename],
                               echo_dart=True,
                               output_dir=timemory.options.output_dir)
    except Exception as e:
        print("Exception - {}".format(e))

    # provide results to dashboard
    try:
        for i in range(0, len(imgs)):
            img_base = "{}_{}_stack_{}".format(args.phantom, algorithm, i)
            img_name = os.path.basename(imgs[i]).replace(
                ".{}".format(args.format), "").replace(
                "stack_{}_".format(algorithm), img_base)
            img_type = args.format
            img_path = imgs[i]
            timemory.plotting.echo_dart_tag(img_name, img_path, img_type)
    except Exception as e:
github NERSC / timemory / timemory / plotting / __main__.py View on Github external
_data.title = args.titles[i]
            _data.plot_params = params
            print('### --> Processing "{}" from "{}"...'.format(_data.title,
                                                                args.files[i]))
            data.append(_data)

        if do_plot_max:
            _plotting.plot_maximums(args.plot_max,
                                    args.titles[0],
                                    data,
                                    plot_params=params,
                                    display=args.display_plot,
                                    output_dir=args.output_dir,
                                    echo_dart=args.echo_dart)
        else:
            _plotting.plot(data=data,
                           plot_params=params,
                           display=args.display_plot,
                           combine=args.combine,
                           output_dir=args.output_dir,
                           echo_dart=args.echo_dart)

    except Exception as e:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        traceback.print_exception(exc_type, exc_value, exc_traceback, limit=5)
        print('Exception - {}'.format(e))
        sys.exit(1)

    print('Done - {}'.format(sys.argv[0]))
    sys.exit(0)
github tomopy / tomopy / benchmarking / rec.py View on Github external
def output_analysis(manager, args, imgs):
    # timing report to stdout
    print('{}\n'.format(manager))

    fpath = args.output_dir
    timemory.options.output_dir = fpath
    timemory.options.set_report("run_tomopy.out")
    timemory.options.set_serial("run_tomopy.json")
    manager.report()
    # provide timing plots
    try:
        print("\nPlotting TiMemory results...\n")
        timemory.plotting.plot(files=[timemory.options.serial_filename],
                               echo_dart=True,
                               output_dir=timemory.options.output_dir)
    except Exception as e:
        print("Exception [timemory.plotting] - {}".format(e))
    # provide results to dashboard
    try:
        print("\nEchoing dart tags...\n")
        for i in range(0, len(imgs)):
            img_type = args.format
            img_name = os.path.basename(imgs[i]).replace(
                ".{}".format(args.format), "")
            img_path = imgs[i]
            timemory.plotting.echo_dart_tag(img_name, img_path, img_type)
    except Exception as e:
        print("Exception [echo_dart_tag] - {}".format(e))
    # provide ASCII results