def eachYearHeight(catalog):
    """
    RETO3 - REQ1
    Altura del árbol de cada año.
    """       
    y1 = om.height(catalog['2016'])
    y2 = om.height(catalog['2017'])
    y3 = om.height(catalog['2018'])
    y4 = om.height(catalog['2019'])

    return y1, y2, y3, y4
Exemplo n.º 2
0
def indexHeight(analyzer):
    """
    Altura del arbol
    """

    respuesta = om.height(analyzer['fechas'])
    return (respuesta)
def infAnalyzer(analyzer):
    """
    Dado un analizador retorna informacion sobre este.
    """
    high = om.height(analyzer['dateIndex'])
    nodes = om.size(analyzer['dateIndex'])
    min_key = om.minKey(analyzer['dateIndex'])
    max_key = om.maxKey(analyzer['dateIndex'])
    return (high, nodes, min_key, max_key)
Exemplo n.º 4
0
def crimesHeight(dicci):
    """
    Número de crimenes
    """
    return om.height(dicci['instrumentalness']), om.height(
        dicci['acousticness']), om.height(dicci['liveness']), om.height(
            dicci['speechiness']), om.height(dicci['energy']), om.height(
                dicci['danceability']), om.height(dicci['valence'])
Exemplo n.º 5
0
def rango_caracteristica(catalog, caracteristica, rango_inf, rango_sup):
    map = mp.get(catalog['index_caracteristica'], caracteristica)
    arbol = me.getValue(map)
    valores_rango = om.values(arbol, rango_inf, rango_sup)
    cantidad_eventos = lt.size(valores_rango)
    lista_autores = autores_unicos(valores_rango)
    autores = lt.size(lista_autores)
    tamaño = om.size(arbol)
    altura = om.height(arbol)
    return (tamaño, altura, cantidad_eventos, autores)
Exemplo n.º 6
0
def consulta_propiedades(analyzer):
    mapa = analyzer['EvByCaracteristics']
    keys = mp.keySet(mapa)
    propiedades = lt.newList('SINGLE_LINKED')
    for i in lt.iterator(keys):
        entry = mp.get(mapa, i)
        arbol = me.getValue(entry)
        altura = om.height(arbol)
        elementos = om.size(arbol)
        lt.addFirst(propiedades, (altura, elementos))
    return propiedades
def test_height(tree):
    tree = om.put(tree, 23, 'book21')
    tree = om.put(tree, 7, 'book7')
    tree = om.put(tree, 30, 'book30')
    tree = om.put(tree, 5, 'book5')
    tree = om.put(tree, 4, 'book4')
    tree = om.put(tree, 3, 'book3')
    tree = om.put(tree, 20, 'book20')
    tree = om.put(tree, 25, 'book25')
    tree = om.put(tree, 35, 'book35')
    tree = om.put(tree, 29, 'book29')
    tree = om.put(tree, 11, 'book11')
    tree = om.put(tree, 15, 'book15')
    tree = om.put(tree, 10, 'book10')
    assert om.size(tree) == 13
    assert om.height(tree) == 4
    tree = om.put(tree, 37, 'book11')
    tree = om.put(tree, 40, 'book15')
    tree = om.put(tree, 45, 'book10')
    assert om.size(tree) == 16
    assert om.height(tree) == 5
Exemplo n.º 8
0
def parte2(info):

    tamano = om.size(info["generos"])
    altura = om.height(info["generos"])

    #numero de autores sin repetirse
    valores = om.values(info["generos"], 0, tamano)
    iterador = it.newIterator(valores)
    diccionariototal = mp.newMap()

    while it.hasNext(iterador):

        actual = it.next(iterador)

        ite = it.newIterator(actual)

        while it.hasNext(ite):

            actual = it.next(ite)

            if mp.contains(diccionariototal, actual["artist_id"]):

                ola = mp.get(diccionariototal, actual["artist_id"])
                listo = me.getValue(ola)

                lt.addLast(listo, actual)
            else:

                listo = lt.newList()
                mp.put(diccionariototal, actual["artist_id"], listo)
                lt.addLast(listo, actual)

    tamanototal = mp.size(diccionariototal)

    val = om.values(info["generos"], 0, tamano)
    iterador = it.newIterator(val)
    x = 0
    while it.hasNext(iterador):

        actual = it.next(iterador)

        x += lt.size(actual)

    return tamano, altura, tamanototal, x
def index_height(analyzer):
    """
    Altura del árbol.
    """
    return om.height(analyzer['date_index'])
Exemplo n.º 10
0
def indexHeight(analyzer):
    
    return om.height(analyzer['pistas'])
Exemplo n.º 11
0
        print("Cargando información de los archivos...")
        answer = controller.loadData(analyzer, events_analysis_file,
                                     hashtag_file, sentiment_values)
        print('Registro de eventos Cargados: ' +
              str(controller.eventsSize(analyzer)))
        print('Artistas únicos Cargados: ' +
              str(controller.artistsSize(analyzer)))
        print('Pistas únicas Cargados: ' +
              str(controller.tracksSize(analyzer)))
        print('\n')
        print('Primeros y últimos 5 cargados, respectivamente: ')
        printfirstandlast5(analyzer)
        print('\n')
        print("Tiempo [ms]: ", f"{answer[0]:.3f}", "  ||  ", "Memoria [kB]: ",
              f"{answer[1]:.3f}")
        print('instrumentalness: ', om.height(analyzer['instrumentalness']))
        print('acousticness: ', om.height(analyzer['acousticness']))
        print('liveness: ', om.height(analyzer['liveness']))
        print('speechiness: ', om.height(analyzer['speechiness']))
        print('energy: ', om.height(analyzer['energy']))
        print('danceability: ', om.height(analyzer['danceability']))
        print('valence: ', om.height(analyzer['valence']))
        print('tempo: ', om.height(analyzer['tempo']))
        print('created_at: ', om.height(analyzer['created_at']))

    elif int(inputs[0]) == 2:
        criteria = input("Ingrese el criterio a evaluar: ")
        initial = float(input("Ingrese el límite inferior: "))
        final = float(input("Ingrese el límite superior: "))
        print("Buscando en la base de datos ....")
        result = controller.getEventsByRange(analyzer, criteria, initial,
Exemplo n.º 12
0
def indexHeight(analyzer):
    """Numero de accidentes leido
    """
    return om.height(analyzer['dateIndex'])
Exemplo n.º 13
0
def indexHeight(catalog):
    return om.height(catalog['req1'])
def consultar_altura(mapa):
    altura = om.height(mapa)
    return altura
Exemplo n.º 15
0
def indexHeight(analyzer):
    """
    Altura del arbol
    """
    return om.height(analyzer['created_at'])
Exemplo n.º 16
0
def hourHeight(catalog):
    """
    Altura del árbol de horas.
    """
    return om.height(catalog['Hour_RBT'])
while True:
    printMenu()
    inputs = input('Seleccione una opci贸n para continuar\n>')

    if int(inputs[0]) == 1:
        print("\nInicializando....")
        # analyzer es el controlador que se usar谩 de ac谩 en adelante
        analyzer = controller.init()
        print("\nAnalizador cargado.")

    elif int(inputs[0]) == 2:
        print("\nCargando informaci贸n de accidentes ....")
        controller.loadData(analyzer, file)
        print("\nInformacion caragada exitosamente")
        print("Se cargaron", m.size(analyzer["accidentes"]), "elementos.")
        print("altura del arbol fechas", om.height(analyzer["index"]))
        print("elementos del arbol fechas", om.size(analyzer["index"]))
        print("tama帽o del arbol horas", om.height(analyzer["index_horas"]))
        print("elementos del arbol horas", om.size(analyzer["index_horas"]))
    elif int(inputs[0]) == 3:
        criterio = input(str("\nBuscando accidentes en un rango de fechas: "))
        Monika = controller.obtener_accidentes_por_fecha(analyzer, criterio)
        impresor_de_datos_elefante_de_batalla_psiquico_ancestral(Monika)

    elif int(inputs[0]) == 4:
        fecha1 = str(om.minKey(analyzer["index"]))
        fecha2 = input("\nIngrese una fecha (YYYY-MM-DD): ")
        listafechas = controller.accidentes_antes_de_una_fecha(
            analyzer, fecha1, fecha2)
        print("*******************************************")
        print(listafechas)
def heightDistanceIndex(analyzer):
    return om.height(analyzer["DistanceIndex"])
Exemplo n.º 19
0
def indexHeight(analyzer):
    """
    Altura del arbol
    """
    return om.height(analyzer['dateIndex'])
Exemplo n.º 20
0
def indexHeight(analyzer):
    """
    Altura del arbol
    """
    return om.height(analyzer["user_track"])
Exemplo n.º 21
0
def alturA_arbol(catalog):
    altura = om.height(catalog["Indice_fechas"])
    return altura
Exemplo n.º 22
0
def indexHeight(analyzer):
    """Numero de fechas leidas
    """
    return om.height(analyzer['dateIndex'])
def heightDateIndex(analyzer):
    return om.height(analyzer['DateIndex'])
Exemplo n.º 24
0
def indexHeight(analyzer):
    """
    """
    return om.height(analyzer["dateIndex"])
def heightTimeIndex(analyzer):
    return om.height(analyzer["TimeIndex"])
def indexHeight(analyzer):
    """Numero de autores leido
    """
    return om.height(analyzer['dateIndex']), om.height(analyzer['timeIndex'])
Exemplo n.º 27
0
def indexHeight(analyzer):
    """Numero de autores leido
    """
    return om.height(analyzer['index'])
Exemplo n.º 28
0
def indexHeight(analyzer, type):
    """
    Altura del arbol
    """
    return om.height(analyzer[type])
def indexHeight(analyzer):

    return om.height(analyzer['dateIndex'])
Exemplo n.º 30
0
def indexHeight1(analyzer):

    return om.height(analyzer['artistIndex'])