minermedic/minermedic.py
def hashrate_by_model():

    """
    Creates a JSON dict of HashRates By Model. Can be called directly.
    Used by an AJAX js method called by "/hashrate" screen.

    :return: JSON with Hashrate Info
    """

    from phenome_core.core.globals import results_collector
    model_hashrates = dict()

    try:
        model_hashrates = results_collector['CRYPTO_MINER'].hash_rate_per_model
    except:
        pass

    model_list = []
    x = 0

    for model,value in model_hashrates.items():
        text = "{} - {:3.2f} {} ".format(model, value["sum_current"], value["units"])
        sum_hashrate = value["sum_current"]
        max_hashrate = value["sum_max"]
        if sum_hashrate < 0:
            sum_hashrate = 0
        if max_hashrate <= 0:
            max_hashrate = 1
        score = sum_hashrate/max_hashrate * 100
        x = x + 1
        if score>0:
            score = "{:3.2f}".format(score)
            model_list.append({"id": model, "order": x, "score": score, "weight": score, "label": text})

    return jsonify(model_list)

    Creates a JSON dict of HashRates By Model. Can be called directly.
    Used by an AJAX js method called by "/hashrate" screen.

    :return: JSON with Hashrate Info
    
Creates a JSON dict of HashRates By Model. Can be called directly.
Used by an AJAX js method called by "/hashrate" screen.
Creates a JSON dict of HashRates By Model . Can be called directly . Used by an AJAX js method called by " / hashrate " screen .
def hashrate_by_model():
    from phenome_core.core.globals import results_collector
    model_hashrates = dict()
    try:
        model_hashrates = results_collector['CRYPTO_MINER'].hash_rate_per_model
    except:
        pass
    model_list = []
    x = 0
    for model,value in model_hashrates.items():
        text = "{} - {:3.2f} {} ".format(model, value["sum_current"], value["units"])
        sum_hashrate = value["sum_current"]
        max_hashrate = value["sum_max"]
        if sum_hashrate < 0:
            sum_hashrate = 0
        if max_hashrate <= 0:
            max_hashrate = 1
        score = sum_hashrate/max_hashrate * 100
        x = x + 1
        if score>0:
            score = "{:3.2f}".format(score)
            model_list.append({"id": model, "order": x, "score": score, "weight": score, "label": text})
    return jsonify(model_list)
def hashrate_by_model ( ) : from phenome_core . core . globals import results_collector model_hashrates = dict ( ) try : model_hashrates = results_collector [ 'CRYPTO_MINER' ] . hash_rate_per_model except : pass model_list = [ ] x = 0 for model , value in model_hashrates . items ( ) : text = "{} - {:3.2f} {} " . format ( model , value [ "sum_current" ] , value [ "units" ] ) sum_hashrate = value [ "sum_current" ] max_hashrate = value [ "sum_max" ] if sum_hashrate < 0 : sum_hashrate = 0 if max_hashrate <= 0 : max_hashrate = 1 score = sum_hashrate / max_hashrate * 100 x = x + 1 if score > 0 : score = "{:3.2f}" . format ( score ) model_list . append ( { "id" : model , "order" : x , "score" : score , "weight" : score , "label" : text } ) return jsonify ( model_list )
Creates a JSON dict of HashRates By Model.
Creates a JSON dict of HashRates By Model .
"""
    Creates a JSON dict of HashRates By Model. Can be called directly.
    Used by an AJAX js method called by "/hashrate" screen.

    :return: JSON with Hashrate Info
    """
JSON with Hashrate Info
JSON with Hashrate Info