Exemple #1
0
def core_helper(plate, settings_dict, imagecontainer, position, version,
                redirect=True, debug=False):
    """Embeds analysis of a positon in a single function"""
    # see http://stackoverflow.com/questions/3288595/
    # multiprocessing-using-pool-map-on-a-function-defined-in-a-class
    logger =  logging.getLogger(str(os.getpid()))
    import numpy
    reload(numpy.core._dotblas)
    try:
        settings = ConfigSettings()
        settings.from_dict(settings_dict)
        settings.set('General', 'constrain_positions', True)
        settings.set('General', 'positions', position)

        environ = CecogEnvironment(version, redirect=redirect, debug=debug)
        if debug:
            environ.pprint()
        analyzer = AnalyzerCore(plate, settings, imagecontainer)
        post_hdf5_link_list = analyzer.processPositions()
        return plate, position, copy.deepcopy(post_hdf5_link_list)
    except Exception as e:
        errortxt = "plate: %s, position: %s\n" %(plate, position)
        errortxt = "".join([errortxt] + \
                               traceback.format_exception(*sys.exc_info()))
        logger.error(errortxt)
        raise e.__class__(errortxt)
Exemple #2
0
def core_helper(plate,
                settings_dict,
                imagecontainer,
                position,
                version,
                redirect=True,
                debug=False):
    """Embeds analysis of a positon in a single function"""
    # see http://stackoverflow.com/questions/3288595/
    # multiprocessing-using-pool-map-on-a-function-defined-in-a-class
    logger = logging.getLogger(str(os.getpid()))
    import numpy
    reload(numpy.core._dotblas)
    try:
        settings = ConfigSettings()
        settings.from_dict(settings_dict)
        settings.set('General', 'constrain_positions', True)
        settings.set('General', 'positions', position)

        environ = CecogEnvironment(version, redirect=redirect, debug=debug)
        if debug:
            environ.pprint()
        analyzer = AnalyzerCore(plate, settings, imagecontainer)
        post_hdf5_link_list = analyzer.processPositions()
        return plate, position, copy.deepcopy(post_hdf5_link_list)
    except Exception as e:
        errortxt = "plate: %s, position: %s\n" % (plate, position)
        errortxt = "".join([errortxt] + \
                               traceback.format_exception(*sys.exc_info()))
        logger.error(errortxt)
        raise e.__class__(errortxt)
Exemple #3
0
def core_helper(plate, settings_dict, imagecontainer, position, version,
                mode="r+", redirect=True):
    """Embedds analysis of a positon in a single function"""
    # see http://stackoverflow.com/questions/3288595/
    # multiprocessing-using-pool-map-on-a-function-defined-in-a-class
    logger =  logging.getLogger(str(os.getpid()))

    try:
        # FIXME numpy 1.11 does not have ._dotblas
        import numpy.core._dotblas
        reload(numpy.core._dotblas)
    except ImportError as e:
        pass

    try:
        settings = ConfigSettings()
        settings.from_dict(settings_dict)
        settings.set('General', 'constrain_positions', True)
        settings.set('General', 'positions', position)

        environ = CecogEnvironment(version, redirect=redirect)

        analyzer = PlateAnalyzer(plate, settings, imagecontainer, mode=mode)
        analyzer()
        return plate, position

    except Exception as e:
        errortxt = "Plate: %s, Site: %s\n" %(plate, position)
        errortxt = "".join([errortxt] + \
                               traceback.format_exception(*sys.exc_info()))
        logger.error(errortxt)
        raise type(e)(errortxt)
Exemple #4
0
def core_helper(plate,
                settings_dict,
                imagecontainer,
                position,
                version,
                mode="r+",
                redirect=True):
    """Embedds analysis of a positon in a single function"""
    # see http://stackoverflow.com/questions/3288595/
    # multiprocessing-using-pool-map-on-a-function-defined-in-a-class
    logger = logging.getLogger(str(os.getpid()))

    try:
        # FIXME numpy 1.11 does not have ._dotblas
        import numpy.core._dotblas
        reload(numpy.core._dotblas)
    except ImportError as e:
        pass

    try:
        settings = ConfigSettings()
        settings.from_dict(settings_dict)
        settings.set('General', 'constrain_positions', True)
        settings.set('General', 'positions', position)

        environ = CecogEnvironment(version, redirect=redirect)

        analyzer = PlateAnalyzer(plate, settings, imagecontainer, mode=mode)
        analyzer()
        return plate, position

    except Exception as e:
        errortxt = "Plate: %s, Site: %s\n" % (plate, position)
        errortxt = "".join([errortxt] + \
                               traceback.format_exception(*sys.exc_info()))
        logger.error(errortxt)
        raise type(e)(errortxt)