How to use the timemory.options 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 NERSC / timemory / timemory / plotting / plotting.py View on Github external
Args:
        - data (list):
            - list of "plot_data" objects
            - should contain their own plot_parameters object
        - files (list):
            - list of JSON files
            - "plot_params" argument object will be applied to these files
        - combine (bool):
            - if specified, the plot_data objects from "data" and "files"
              will be combined into one "plot_data" object
            - the plot_params object will be used for this
    """
    try:
        # try here in case running as main on C++ output
        import timemory.options as options
        if echo_dart is None and options.echo_dart:
            echo_dart = True
        elif echo_dart is None:
            echo_dart = False
    except:
        pass

    _combined = None
    for _data in data:
        if _combined is None:
            _combined = plot_data(filename=output_name,
                                  output_name=output_name,
                                  concurrency=_data.concurrency,
                                  mpi_size=_data.mpi_size,
                                  timemory_functions={},
                                  title=title,
                                  plot_params=plot_params)
github NERSC / timemory / timemory / plotting / plotting.py View on Github external
__dir__ = os.path.realpath(os.path.dirname(__file__))

if os.environ.get("DISPLAY") is None and os.environ.get("MPLBACKEND") is None:
    os.environ.setdefault("MPLBACKEND", "agg")

_matplotlib_backend = None
# a previous bug inserted wrong value for levels, this gets around it
_excess_levels = 64

#----------------------------------------------------------------------------------------#
# check with timemory.options
#
try:
    import timemory.options
    if timemory.options.matplotlib_backend != "default":
        _matplotlib_backend = timemory.options.matplotlib_backend
except:
    pass


#----------------------------------------------------------------------------------------#
# if not display variable we probably want to use agg
#
if (os.environ.get("DISPLAY") is None and
    os.environ.get("MPLBACKEND") is None and
        _matplotlib_backend is None):
    os.environ.setdefault("MPLBACKEND", "agg")


#----------------------------------------------------------------------------------------#
# tornado helps set the matplotlib backend but is not necessary
github NERSC / timemory / timemory / plotting / plotting.py View on Github external
__dir__ = os.path.realpath(os.path.dirname(__file__))

if os.environ.get("DISPLAY") is None and os.environ.get("MPLBACKEND") is None:
    os.environ.setdefault("MPLBACKEND", "agg")

_matplotlib_backend = None
# a previous bug inserted wrong value for levels, this gets around it
_excess_levels = 64

#----------------------------------------------------------------------------------------#
# check with timemory.options
#
try:
    import timemory.options
    if timemory.options.matplotlib_backend != "default":
        _matplotlib_backend = timemory.options.matplotlib_backend
except:
    pass


#----------------------------------------------------------------------------------------#
# if not display variable we probably want to use agg
#
if (os.environ.get("DISPLAY") is None and
    os.environ.get("MPLBACKEND") is None and
        _matplotlib_backend is None):
    os.environ.setdefault("MPLBACKEND", "agg")


#----------------------------------------------------------------------------------------#
# tornado helps set the matplotlib backend but is not necessary
#