Visualizza post

Questa sezione ti permette di visualizzare tutti i post inviati da questo utente. N.B: puoi vedere solo i post relativi alle aree dove hai l'accesso.


Topics - Aezio

Pagine: [1] 2 3 ... 5
1
ForumPython.it cafè / Microsoft acquisice GitHub
« il: Giugno 05, 2018, 09:07 »
https://blog.github.com/2018-06-04-github-microsoft/

Nutro sentimenti contrastanti in merito, Microsoft non e' piu' quella di qualche anno fa ma...

2
Mondo Python / browser in python+GTK
« il: Agosto 07, 2017, 10:03 »
https://lleksah.wordpress.com/2017/07/31/writing-my-first-web-browser-in-python-with-gtk/

OK, e' una scemata, ma e' divertente vedere com'e' facile con poche decine di righe avere il proprio browser in python (certo fa tutto webkit dietro...)

3
Feedback / nuovo forum
« il: Marzo 01, 2017, 18:43 »
Uau siamo negli anni 2000  :batti5:  :ok: :ok: :ok: :ok:!

4
Mondo Python / Matplotlib 2.0
« il: Gennaio 18, 2017, 11:34 »
Di pacchetti per grafici oramai ce ne sono a bizzeffe, ma alla fine torno sempre da mamma (o papa' ?) matplotlib.

Ecco il changelog

5
Mondo Python / never write for loops again
« il: Novembre 21, 2016, 09:41 »

6
Mondo Python / meglio stare alla larga da php devs...
« il: Settembre 02, 2016, 15:42 »

7
Mondo Python / conda vs. pip
« il: Agosto 26, 2016, 11:29 »
Interessante post di Jake Vanderplas sulle differenze tra conda e pip.

L'autore e' abbastanza pro-conda, ma direi che spiega bene quando scegliere uno strumento o un altro.


8
ForumPython.it cafè / PowerShell su linux
« il: Agosto 25, 2016, 16:51 »
https://azure.microsoft.com/en-us/blog/powershell-is-open-sourced-and-is-available-on-linux/

Trovata su twitter (dove e' definita piu' inutile del bagnino alle olimpiadi), ma secondo me RicPol apprezzera' (mentre guarda DVD)

9
Calcolo scientifico / multiprocessing parallelo [risolto]
« il: Agosto 16, 2016, 17:03 »
DISCLAIMER = questa per me e' roba nuova, please have mercy

Avrei bisogno di lanciare n istanze di un simulatore (S d'ora in vanti) in parallelo. S non e' parallelo, ogni volta che viene lanciato il relativo processo occupa un core della CPU (we love the 90's).
Avendo a disposizione N processori vorrei lanciare N-1 istanze di S. Non vi e' nessun legame tra le simulazioni, per questo processi distinti mi sembrava la via da seguire. Ho scrittlo la funzione che lo lancia e bisticciato con Google per un po'.

La cosa migliore che sono riuscito a fare e' (in pseudocodice):

[codice]from multiprocessing import Process

def f(subcase):
    run_S(subcase) # pseudocodice per simula sc con S

subcases = (sc0, sc1, sc2)
processes = [Process(target=f, args=(sc)) for sc in subcases]

for p in processes:
    p.start()
    p.join()
    p.run()  [/codice]

Come output ottengo 3 processi python che lanciano S e fanno quello che devono fare ma lo fanno in maniera sequenziale e non parallela come vorrei.
Grazie per l'aiuto.

Un po' di background
OS = Win7
Python 3.5.2

P.S. Bentornato forum!




10
ForumPython.it cafè / ipython 5.0
« il: Luglio 08, 2016, 09:16 »
Cool!

http://blog.jupyter.org/2016/07/08/ipython-5-0-released/

Tra le altre cose:
Citazione
End of support for Python 2
Finalmente!

11
ForumPython.it cafè / esercizi di autostima
« il: Maggio 24, 2016, 09:03 »
Recentemente sono stato contattato da uno che voleva vendermi un programma. Per convincermi ha creato un repo su GitHub con una versione "demo".
Ho sostituito alcuni import per evitare che si possa riconoscere chi ha scritto questa cosa sublime:

[codice]from Foo.Bar.Foobar import *
from Foo.Bar.Foobar.DomainObject.Barfoo import *
from Foo.Bar.Core import *
from Foo.Bar.Basics import *

from Foo.Bar.Catalogs import *
from Foo.Bar.Coordinates import *
from Foo.Bar.CoordinateSystems import *
from Foo.Bar.Data import *
from Foo.Bar.Geometry import *
from Foo.Bar.Units import *
from Foo.Bar.Foobar.Basics import *
from Foo.Bar.Foobar.Data import *
from Foo.Bar.Foobar.DomainObject import *
from Foo.Bar.Foobar.DomainObject.Barfoo import *
from Foo.Bar.Foobar.DomainObject.Shapes import *
from Foo.Bar.Foobar.DomainObject.Well import *
from Foo.Bar.Foobar.DomainObject.FaultModel import *
from Foo.Bar.Foobar.IO import *
from Foo.Bar.Foobar.Licensing import *
from Foo.Bar.Foobar.PropertyModeling import *
from Foo.Bar.Foobar.Barfoo import *
from Foo.Bar.Foobar.BarfooAttribute import *
from Foo.Bar.Foobar.Simulation import *
from Foo.Bar.Foobar.UI import *
from Foo.Bar.Foobar.Uncertainty import *
from Foo.Bar.Foobar.Workflow import *

from Foo.Bar.Coordinates import PrePostUnitConversions


def DoTestPoints5100(projCRS,pt_set):
 
  coord_service = CoreSystem.GetService(ICoordinateService)
  catalog_service = CoreSystem.GetService(ICatalogService)
  unit_service = CoreSystem.GetService(IUnitService)

  print "51xx: Projection Test
%s [%s] to %s [%s]" % (projCRS.ReferenceCoordSys,projCRS.ReferenceCoordSys.AuthorityCode,projCRS,projCRS.AuthorityCode)
  opB = coord_service.CreateOperationToReference(projCRS, PrePostUnitConversions.FromSI)[1]
  opA = coord_service.CreateOperationFromReference(projCRS, PrePostUnitConversions.ToSI)[1]
 
  pt_set_len = len(pt_set)
  meter_unit = unit_service.Catalogs[0].GetUnit('Meter')
  m_to_crsunit = FoobarUnitSystem.GetConverter( meter_unit,projCRS.NativeSurfaceUnit)
  crsunit_to_m = FoobarUnitSystem.GetConverter( projCRS.NativeSurfaceUnit,meter_unit)
     
  for i in range(0, pt_set_len):
    if pt_set[2] == 'A':
      result = opA.Convert( Point3( pt_set[1], pt_set[0],0) )[1]
     
     
      result = Point3( m_to_crsunit.Convert(result.X), m_to_crsunit.Convert(result.Y),0)
     
      print "A   %s   %s   %s   %s" % ( pt_set[0], pt_set[1], result.X, result.Y)
    else:
      result = opB.Convert( Point3( crsunit_to_m.Convert(pt_set[0]), crsunit_to_m.Convert(pt_set[1]),0) )[1]
      print "B   %s   %s   %s   %s" % ( result.Y, result.X, pt_set[0], pt_set[1])



def DoTestPoints5200(srcCRS,targetCRS,transform,pt_set):
 
  coord_service = CoreSystem.GetService(ICoordinateService)
  catalog_service = CoreSystem.GetService(ICatalogService)
  unit_service = CoreSystem.GetService(IUnitService)

  print "52xx: Transform Test
%s [%s] (%s) <-> %s [%s] (%s)" % (srcCRS,srcCRS.AuthorityCode,srcCRS.NativeSurfaceUnit,targetCRS,targetCRS.AuthorityCode,targetCRS.NativeSurfaceUnit)
  #transform = coord_service.GetCartographicTransform("EPSG:1764")[1]
  opB = coord_service.CreateOperation(targetCRS,srcCRS, [transform], PrePostUnitConversions.None)[1]
  opA = coord_service.CreateOperation(srcCRS,targetCRS,[transform], PrePostUnitConversions.None)[1]
 
  print opA
  print opB
  pt_set_len = len(pt_set)
  unit_catalog = unit_service.Catalogs[0]
 
  #meter_unit = unit_catalog.GetUnit('Meter')
  #m_to_srcCRSunit = unit_catalog.GetConverter( meter_unit,srcCRS.NativeSurfaceUnit)
  #m_to_targetCRSunit = unit_catalog.GetConverter( meter_unit,targetCRS.NativeSurfaceUnit)
  #targetCRSunit_to_m = unit_catalog.GetConverter( targetCRS.NativeSurfaceUnit,meter_unit)
  #srcCRSunit_to_m = unit_catalog.GetConverter( srcCRS.NativeSurfaceUnit,meter_unit)
     
  for i in range(0, pt_set_len):
    if pt_set[2] == 'A':
      result = opA.Convert( Point3( pt_set[1], pt_set[0],0) )[1]
      #result = Point3( pt_set[0], pt_set[1],0)
     
      #result = Point3( m_to_crsunit.Convert(result.X), m_to_crsunit.Convert(result.Y),0)
     
      print "A   %s   %s   %s   %s" % ( pt_set[0], pt_set[1], result.X, result.Y)
    else:
     
      result = opB.Convert( Point3( pt_set[1], pt_set[0],0) )[1]
      #result = opB.Convert( Point3( crsunit_to_m.Convert(pt_set[0]), crsunit_to_m.Convert(pt_set[1]),0) )[1]
      print "B   %s   %s   %s   %s" % ( result.Y, result.X, pt_set[1], pt_set[0])
      pass


def DoTestPoints5100ThousandIterations(projCRS,pt):
  coord_service = CoreSystem.GetService(ICoordinateService)
  catalog_service = CoreSystem.GetService(ICatalogService)
  unit_service = CoreSystem.GetService(IUnitService)
  print "51xx: 1000 Iteration Projection Test
%s [%s] to %s [%s]" % (projCRS.ReferenceCoordSys,projCRS.ReferenceCoordSys.AuthorityCode,projCRS,projCRS.AuthorityCode)
  opB = coord_service.CreateOperationToReference(projCRS, PrePostUnitConversions.None)[1]
  opA = coord_service.CreateOperationFromReference(projCRS, PrePostUnitConversions.None)[1]
 
 
  meter_unit = unit_service.Catalogs[0].GetUnit('Meter')
  m_to_crsunit = FoobarUnitSystem.GetConverter( meter_unit,projCRS.NativeSurfaceUnit)
  crsunit_to_m = FoobarUnitSystem.GetConverter( projCRS.NativeSurfaceUnit,meter_unit)
 
  tmp_point =  Point3(pt[1],pt[0],0)
 
  #print tmp_point
 
  for i in range(0, 1000):
    tmp_point = opA.Convert( Point3( tmp_point.X, tmp_point.Y,0) )[1] # convert lat long to XY
    tmp_point = Point3( m_to_crsunit.Convert(tmp_point.X), m_to_crsunit.Convert(tmp_point.Y),0)
    tmp_point = opB.Convert( Point3( tmp_point.X, tmp_point.Y,0) )[1] # convert XY to lat long
  print tmp_point[/codice]


13
Mondo Python / PyData Amsterdam
« il: Febbraio 15, 2016, 17:36 »
So che e' un po' fuori mano per molti di voi, ma se passate vi offro una birra:

http://pydata.org/amsterdam2016/

parola d'ordine per la birra: RusPython

P.S. mi hanno anche accettato l'abstract quindi fatemi un in bocca al lupo  :ok:

14
Mondo Python / Pyjion - per una volta utenti *nix rosicate
« il: Febbraio 15, 2016, 10:16 »
TItolo volutamente polemico, non c'e' nulla da rosicare.

Pacchetto microsoft per migliorare la velocita' di python

https://github.com/Microsoft/Pyjion

funziona "tipo" numba ma e' meno sci-oriented, non mi ha entusiasmato ma in fondo ogni contibuto microsoft e' ben accetto in prospettiva.

Ah, btw:

Citazione
Are you going to support OS X and/or Linux?

Yes! Goals #1 and #3 are entirely platform-agnostic while goal #2 of using CoreCLR as a JIT compiler is not an impedence to supporting OS X or Linux as it already supports the major OSs. The only reason Pyjion doesn't directly support Linux or OS X is entirely momentum/laziness: since the work is being driven by Microsoft employees, it simply meant it was easier to get going on Windows.

15
ForumPython.it cafè / conda vs pip
« il: Novembre 25, 2015, 08:37 »
Il tizio dimentica un paio di cose importanti come pyenv e virtualenvwrapper, ma il post mi e' sembrato interessante:

http://stiglerdiet.com/blog/2015/Nov/24/my-python-environment-workflow-with-conda/


Pagine: [1] 2 3 ... 5