From bcc7afbee2c1b4ee13d6f3f7bff83833c6094181 Mon Sep 17 00:00:00 2001 From: AJRubio-Montero <AJRubio-Montero@github.com> Date: Thu, 10 Sep 2020 13:50:29 +0200 Subject: [PATCH] Python2 to Python3 transition --- LAGOmapa-sitios.py | 40 +++++++++++++++++----------------- README.md | 2 +- SitiosAlturas/plotalturas3.py | 8 +++---- lagoplano.png | Bin 8883084 -> 8883174 bytes mapingLAGO/AutoMap.py | 4 ++-- sorteador.py | 2 +- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/LAGOmapa-sitios.py b/LAGOmapa-sitios.py index b70c1df..9666d09 100644 --- a/LAGOmapa-sitios.py +++ b/LAGOmapa-sitios.py @@ -5,29 +5,29 @@ import matplotlib.image as mpimg import numpy as np def logo(): - print " \n\n\n " - print " ___ ___ ___ ___" - print " /\__\ /\ \ /\ \ /\ \ " - print " /:/ / /::\ \ /::\ \ /::\ \ " - print " /:/ / /:/\:\ \ /:/\:\ \ /:/\:\ \ " - print " /:/ / /::\~\:\ \ /:/ \:\ \ /:/ \:\ \ " - print " /:/__/ /:/\:\ \:\__\ /:/__/_\:\__\ /:/__/ \:\__\ " - print " \:\ \ \/__\:\/:/ / \:\ /\ \/__/ \:\ \ /:/ / " - print " \:\ \ \::/ / \:\ \:\__\ \:\ /:/ / " - print " \:\ \ /:/ / \:\/:/ / \:\/:/ / " - print " \:\__\ /:/ / \::/ / \::/ / " - print " \/__/ __ _\/__/__ _ _ __\/____ ___ _\/__/ " - print " | '_ ` _ \ / _` | '_ \| '_ \ / _ \ '__| " - print " | | | | | | (_| | |_) | |_) | __/ | " - print " |_| |_| |_|\__,_| .__/| .__/ \___|_| " - print " | | | | " - print " |_| |_| " + print (" \n\n\n ") + print (" ___ ___ ___ ___") + print (" /\__\ /\ \ /\ \ /\ \ ") + print (" /:/ / /::\ \ /::\ \ /::\ \ ") + print (" /:/ / /:/\:\ \ /:/\:\ \ /:/\:\ \ ") + print (" /:/ / /::\~\:\ \ /:/ \:\ \ /:/ \:\ \ ") + print (" /:/__/ /:/\:\ \:\__\ /:/__/_\:\__\ /:/__/ \:\__\ ") + print (" \:\ \ \/__\:\/:/ / \:\ /\ \/__/ \:\ \ /:/ / ") + print (" \:\ \ \::/ / \:\ \:\__\ \:\ /:/ / ") + print (" \:\ \ /:/ / \:\/:/ / \:\/:/ / ") + print (" \:\__\ /:/ / \::/ / \::/ / ") + print (" \/__/ __ _\/__/__ _ _ __\/____ ___ _\/__/ ") + print (" | '_ ` _ \ / _` | '_ \| '_ \ / _ \ '__| ") + print (" | | | | | | (_| | |_) | |_) | __/ | ") + print (" |_| |_| |_|\__,_| .__/| .__/ \___|_| ") + print (" | | | | ") + print (" |_| |_| ") return logo() -comand='python mapingLAGO/AutoMap.py ' +comand='python3 mapingLAGO/AutoMap.py ' comand2='python3 SitiosAlturas/plotalturas3.py ' for i in range(1, len(sys.argv)): @@ -37,9 +37,9 @@ for i in range(1, len(sys.argv)): -print "\n\n\ngenerando mapa..... " +print ("\n\n\ngenerando mapa..... ") os.system(comand) -print "\n\n\ngenerando curva de alturas... \n\n\n" +print ("\n\n\ngenerando curva de alturas... \n\n\n") os.system(comand2) fig = plt.figure() diff --git a/README.md b/README.md index fbbe8a3..d7c95ff 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Realiza un mapa de los sitios del proyecto [LAGO](http://lagoproject.net/) en en Desde la terminal correr: -``python LAGOmapa-sitios.py DATOS_DE_LOS_SITIOS.dat`` +``python3 LAGOmapa-sitios.py DATOS_DE_LOS_SITIOS.dat`` el formato del archivo DATOS_DE_LOS_SITIOS debe ser como el que se muestra en la cabecera del archivo ``DatosRC.dat``: Nombre, altura, Lat, Long, Status, R_U, R_C, R_L, diff --git a/SitiosAlturas/plotalturas3.py b/SitiosAlturas/plotalturas3.py index 23b0f8c..2faf7a6 100644 --- a/SitiosAlturas/plotalturas3.py +++ b/SitiosAlturas/plotalturas3.py @@ -18,7 +18,7 @@ if ig==3: sys.exit("ERROR--IGNORANDO TODO!!!") ######################################################################### -os.system("python sorteador.py "+sys.argv[1]+" 2 > misdatos.dat") +os.system("python3 sorteador.py "+sys.argv[1]+" 2 > misdatos.dat") files=open('misdatos.dat') labels=[] @@ -105,13 +105,13 @@ for y in range(-80,30,10): if ignore[0]==0: #plot(xon,yon,lw=2.5,color='#0033CC',marker='^',ms=30,label='working') - scatter(xon,yon,marker='^',zorder=10,s=300,color='#0033CC',label='Up and running') + scatter([xon],[yon],marker='^',zorder=10,s=300,color='#0033CC',label='Up and running') if ignore[1]==0: #plot(xso,yso,lw=2.5,color='#CC0000',marker='s',ms=30,label='coming soon') - scatter(xso,yso,marker='s',zorder=10,s=300,color='#FF8C00',label='Deploying') + scatter([xso],[yso],marker='s',zorder=10,s=300,color='#FF8C00',label='Deploying') if ignore[2]==0: #plot(xuc,yuc,lw=2.5,color='#FFFF00',marker='o',ms=30,label='under consideration') - scatter(xuc,yuc,marker='o',zorder=10,s=300,color='#CC0000',label='Planned') + scatter([xuc],[yuc],marker='o',zorder=10,s=300,color='#CC0000',label='Planned') ###################################################################### diff --git a/lagoplano.png b/lagoplano.png index 5ac334ec989677c2e6dadbcef42f3503e507b7f5..ea48ec3253d117fa32f2e525bff3f65b52d0b337 100644 GIT binary patch delta 508 zcmYMu$wQ0*06_6CvScSw)~QIyH@zmbAX~{6m1Qd1q^X9fZ_IqAtQ8&y4sLGU93A~j z{th`g{BG~?zWrFP{IlYFDjif6`bSDZ5H|i(G5@ot90WmU+?$Svqse$KQ_Kc4nYfUT z;(TsAQO*`ixo9?#3R}armc(=%7rK(k|3MfPr;;6u-M^NQ3RxwqrBc?&T3ILSrAju) zM%g5rWs7W;ZL(c<NVV*g8rdbgrB>=>kL;CwvR@9!K}krxG)SWylEcy@N2FPf$}u@E zEpkFaNlL4%EVW5W+U2C2lGD;5ozf-Uaz@U|Iq8w}azQT2CAloU(kEA>U#`kExh^;4 zrVPj}xh;b-B*St??#ey6FKHQ(Q5lm5@=zYhV|gMO8JDLrAz7J}DVdg>Jd@{=ml>Ir sNDA^oic*qTUP@W!WL{p$Yk4DY<(<5j1zD6O`5+(VlPI5m^JVPoU%O7GIRF3v delta 419 zcmWN=*ESFU0D$3R@4YusM)r(k6dB2A$SBGvdxSDV#-EG)=eTp{ExeNF;5+BLyS@p& ze0WuNA_ia}24OIUU?_%RI7VP3MqxC@U@XRAJSJcwCSfwBU@E3zI%Z%dW??qwU@qoi zJ{I63EW{#wj8Cu_ORyBn@F|vK1y*7eR$~p;Vjb3F12$q4KEq~g!ROeDFR%^Uu>(8t zCBDKg?8evFgT2^?{rCn4@GTDF5Dw!AzQgzU0YBm>e!?*v#|fOo&-ewWa2mhjH=My) zoWptijz4e#7jX%faRpa#4cBo4H}NNK;WqBzFZ_+WxQF|AfPe51kMJ1(;t8JO8J;8f J@79a)|MznayCeVr diff --git a/mapingLAGO/AutoMap.py b/mapingLAGO/AutoMap.py index a4eea50..ecd22f3 100644 --- a/mapingLAGO/AutoMap.py +++ b/mapingLAGO/AutoMap.py @@ -28,13 +28,13 @@ def estatus(x): elif x=='planned': status=('o','#CC0000') else: - print x + print (x) sys.exit("ERROR--ESTAUS DE SITIO NO VALIDO!!!") return status ################### ordena el archivo de datos por latitud####### -os.system('python sorteador.py '+sys.argv[1]+' 2 > misdatos.dat') +os.system('python3 sorteador.py '+sys.argv[1]+' 2 > misdatos.dat') files=open('misdatos.dat') diff --git a/sorteador.py b/sorteador.py index 2420e11..15d8532 100644 --- a/sorteador.py +++ b/sorteador.py @@ -13,4 +13,4 @@ for line in file: array=sorted(lats, key=lambda lat: lat[int(sys.argv[2])]) for i in range(0,len(array)): - print str(array[i][0])+','+str(array[i][1])+','+str(array[i][2])+','+str(array[i][3])+','+str(array[i][4])+','+str(array[i][5])+','+str(array[i][6])+','+str(array[i][7])+',' + print ( str(array[i][0])+','+str(array[i][1])+','+str(array[i][2])+','+str(array[i][3])+','+str(array[i][4])+','+str(array[i][5])+','+str(array[i][6])+','+str(array[i][7])+',' ) -- GitLab