import shelve


def read_net_cp(namefile):
    """Read pre-computed network cp assignation."""
    db = shelve.open(namefile)
    cps = db['cps']
    net = db['net']
    methodvalues = db['methodvalues']
    db.close()
    return cps, net, methodvalues