__init__.py 774 Bytes
Newer Older
1 2 3 4 5 6 7
# -*- coding: utf-8 -*-

"""Top-level package for pydarshan."""

__version__ = '0.1.0'


8 9
#from darshan.backend.cffi_backend import *
from darshan.report import DarshanReport
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31



def enable_experimental(verbose=True):
    import os
    import glob
    import importlib
    import darshan    

    paths = glob.glob(darshan.__path__[0] + "/experimental/aggregators/*.py")
    for path in paths:
        base = os.path.basename(path)
        name = os.path.splitext(base)[0]
        
        if name == "__init__":
            continue

        mod = importlib.import_module('darshan.experimental.aggregators.{0}'.format(name))
        setattr(DarshanReport, name, getattr(mod, name))
    
        if verbose:
            print("Added method {} to DarshanReport.".format(name))