From stappers at stappers.nl Sat Sep 3 09:57:04 2016 From: stappers at stappers.nl (Geert Stappers) Date: Sat, 3 Sep 2016 15:57:04 +0200 Subject: [python-nl] visualisatie van voortgang Message-ID: <20160903135704.GZ4220@gpm.stappers.nl> Hoi, Wat is geschikte libary of framework om voortgang te visualiseren? Een "progress bar" zou een mooi begin zijn. Een "array of progress bars" is meer wat ik zoek. Input voor het generen van statische output is dan iets als prj[0] = 80 prj[1] = 20 prj[2] = 50 prj[3] = 0 prj[4] = 0 Output _____ _____ #____ #____ #____ #_#__ #_#__ #_#__ ###__ ###__ 01234 In de "grafische weergave" is te zien dat aan [3] en [4] nog begonnen moet worden. Is er zo iets? Iets dat histogramen aanmaakt? Groeten Geert Stappers -- Leven en laten leven -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: From dorian.hoxha at gmail.com Sat Sep 3 10:14:23 2016 From: dorian.hoxha at gmail.com (Dorian Hoxha) Date: Sat, 3 Sep 2016 16:14:23 +0200 Subject: [python-nl] visualisatie van voortgang In-Reply-To: <20160903135704.GZ4220@gpm.stappers.nl> References: <20160903135704.GZ4220@gpm.stappers.nl> Message-ID: Something like this: https://pypi.python.org/pypi/tqdm ? 2016-09-03 15:57 GMT+02:00 Geert Stappers : > > Hoi, > > Wat is geschikte libary of framework om voortgang te visualiseren? > > Een "progress bar" zou een mooi begin zijn. > > Een "array of progress bars" is meer wat ik zoek. > > > Input voor het generen van statische output is dan iets als > > prj[0] = 80 > prj[1] = 20 > prj[2] = 50 > prj[3] = 0 > prj[4] = 0 > > > Output > > _____ > _____ > #____ > #____ > #____ > #_#__ > #_#__ > #_#__ > ###__ > ###__ > 01234 > > In de "grafische weergave" is te zien dat aan [3] en [4] nog begonnen moet > worden. > > Is er zo iets? Iets dat histogramen aanmaakt? > > > Groeten > Geert Stappers > -- > Leven en laten leven > > _______________________________________________ > Python-nl mailing list > Python-nl at python.org > https://mail.python.org/mailman/listinfo/python-nl > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stappers at stappers.nl Sat Sep 3 11:13:48 2016 From: stappers at stappers.nl (Geert Stappers) Date: Sat, 3 Sep 2016 17:13:48 +0200 Subject: [python-nl] visualisatie van voortgang In-Reply-To: References: <20160903135704.GZ4220@gpm.stappers.nl> Message-ID: <20160903151348.GC4220@gpm.stappers.nl> On Sat, Sep 03, 2016 at 04:14:23PM +0200, Dorian Hoxha wrote: > 2016-09-03 15:57 GMT+02:00 Geert Stappers : > > > > > Hoi, > > > > Wat is geschikte libary of framework om voortgang te visualiseren? > > > > Een "progress bar" zou een mooi begin zijn. > > > > Een "array of progress bars" is meer wat ik zoek. > > > > > > Input voor het generen van statische output is dan iets als > > > > prj[0] = 80 > > prj[1] = 20 > > prj[2] = 50 > > prj[3] = 0 > > prj[4] = 0 > > > > > > Output > > > > _____ > > _____ > > #____ > > #____ > > #____ > > #_#__ > > #_#__ > > #_#__ > > ###__ > > ###__ > > 01234 > > > > In de "grafische weergave" is te zien dat aan [3] en [4] nog begonnen moet > > worden. > > > > Is er zo iets? Iets dat histogramen aanmaakt? > > > > Something like this: https://pypi.python.org/pypi/tqdm ? > Die heeft als input een "iterable", is dynamisch en 1-dimensionaal. Dus nee, maar wel bedankt voor het melden. Groeten Geert Stappers -- Leven en laten leven From martin.fitzpatrick at gmail.com Sat Sep 3 13:26:42 2016 From: martin.fitzpatrick at gmail.com (Martin Fitzpatrick) Date: Sat, 3 Sep 2016 19:26:42 +0200 Subject: [python-nl] visualisatie van voortgang In-Reply-To: <20160903135704.GZ4220@gpm.stappers.nl> References: <20160903135704.GZ4220@gpm.stappers.nl> Message-ID: Hey It sounds like bashplotlib might do what you're looking for? https://github.com/glamp/bashplotlib Specifically the plot_hist function allows you to plot a histogram (which is basically what you've drawn). Hope that helps Martin (Apologies for the English) 2016-09-03 15:57 GMT+02:00 Geert Stappers : > > Hoi, > > Wat is geschikte libary of framework om voortgang te visualiseren? > > Een "progress bar" zou een mooi begin zijn. > > Een "array of progress bars" is meer wat ik zoek. > > > Input voor het generen van statische output is dan iets als > > prj[0] = 80 > prj[1] = 20 > prj[2] = 50 > prj[3] = 0 > prj[4] = 0 > > > Output > > _____ > _____ > #____ > #____ > #____ > #_#__ > #_#__ > #_#__ > ###__ > ###__ > 01234 > > In de "grafische weergave" is te zien dat aan [3] en [4] nog begonnen moet > worden. > > Is er zo iets? Iets dat histogramen aanmaakt? > > > Groeten > Geert Stappers > -- > Leven en laten leven > > _______________________________________________ > Python-nl mailing list > Python-nl at python.org > https://mail.python.org/mailman/listinfo/python-nl > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vm at klankschap.nl Sat Sep 3 18:20:40 2016 From: vm at klankschap.nl (Floris van Manen) Date: Sun, 4 Sep 2016 00:20:40 +0200 Subject: [python-nl] visualisatie van voortgang In-Reply-To: <20160903135704.GZ4220@gpm.stappers.nl> References: <20160903135704.GZ4220@gpm.stappers.nl> Message-ID: <8519CC20-7D52-4B02-98D2-C00519F39B73@klankschap.nl> > On 3 Sep 2016, at 15:57, Geert Stappers wrote: > > > Hoi, > > Wat is geschikte libary of framework om voortgang te visualiseren? De eerste vraag die rijst is natuurlijk de voortgang waarvan ? Als het er om gaat om een proces in de verschillende stappen te volgen, dan is de eerder voorgestelde tqdm module erg geschikt. Je kunt het gestapeld gebruiken: for i in tqdm(range(10)): for j in tqdm(range(100)): pass for j in tqdm(range(300)): pass for j in tqdm(range(50)): pass Dit geeft je twee progress bars, een voor het totaal en een voor de sub task. Als je de status van verschillende tellers wilt kunnen volgen binnen een loop, kun je ook een enkele regel aanmaken en die telkens overschrijven. while process_going(): print(teller1, teller2, teller3, end=?\r?) print(?\nKlaar?) ipv de teller als getal, kun je die vervangen door een aantal ?*? + een aantal ? ? Daar kun je natuurlijk zelf een functie voor bedenken ;-) .F > > Een "progress bar" zou een mooi begin zijn. > > Een "array of progress bars" is meer wat ik zoek. > > > Input voor het generen van statische output is dan iets als > > prj[0] = 80 > prj[1] = 20 > prj[2] = 50 > prj[3] = 0 > prj[4] = 0 > > > Output > > _____ > _____ > #____ > #____ > #____ > #_#__ > #_#__ > #_#__ > ###__ > ###__ > 01234 > > In de "grafische weergave" is te zien dat aan [3] en [4] nog begonnen moet worden. > > Is er zo iets? Iets dat histogramen aanmaakt? > > > Groeten > Geert Stappers > -- > Leven en laten leven > _______________________________________________ > Python-nl mailing list > Python-nl at python.org > https://mail.python.org/mailman/listinfo/python-nl -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 842 bytes Desc: Message signed with OpenPGP using GPGMail URL: From martin.fitzpatrick at gmail.com Sat Sep 3 15:02:42 2016 From: martin.fitzpatrick at gmail.com (Martin Fitzpatrick) Date: Sat, 3 Sep 2016 21:02:42 +0200 Subject: [python-nl] Error in python multiprocessing! In-Reply-To: <111968693.570469.1472285791495@mail.yahoo.com> References: <111968693.570469.1472285791495.ref@mail.yahoo.com> <111968693.570469.1472285791495@mail.yahoo.com> Message-ID: Hi Akshay It's a little difficult to understand what you're doing, but as a general rule I would avoid using both multiprocessing and Qt threads (if only because this is going to confuse things). The error you're receiving looks like it is coming from the serialisation (pickle?) of the data in/out of the task. For a problem like this I would suggest sticking with Qt threads and implementing something via QRunnable/QThreadpool. I have a brief (draft) writeup of this process on my site at: http://mfitzp.io/application-multithreading-with-pyqt/ ...will be finished up in a few weeks. The approach is to create a QRunnable class that accepts a function to run and passes notification/results out as signals. To start a job (e.g. process a file) you would pass in your function, the filename and then attach a listener to the 'result' signal. Once the task is run your data will come back out via that. You can for example attach this signal to a slot (python function) to update your GUI. If the plotting is causing a slow down, you might also want to try PyQtGraph. Hope that helps Martin On 27 August 2016 at 10:16, Akshay Verma via Python-nl wrote: > Hi all, > > After a lot of searching on the internet, I am looking for help from you > guys. > > I am working on a Qt based GUI which takes in a stream of file paths > coming from a separate process and reads those data file for > post-processing and plotting. Since post-processing and plotting have > become a bit involved, there is a request to improve the performance of the > GUI. Currently the GUI takes in the input message with the path of the file > and gives a SIGNAL to the Worker thread (Qt thread) to process the file. > The processing results are saved in the object for reference and display > within the GUI. Simple separation of the threads does not help a lot for > intensive processing cases. I had to add a sleep of 1 sec to quick fix the > GIL of Python and make the GUI responsive. To improve the solution, I > thought of using Multiprocessing for the post-processing task. I am trying > to add the task to queue and get back the result in a queue. When I > implement this solution, I get '*TypeError: cannot serailize > '_io.TextIOWrapper' object'* at the call of start() of the Process. > > What could be the cause of this error? Is there a better way to solve this > issue? Any suggestions are welcome. > > Regards, Akshay Verma > > _______________________________________________ > Python-nl mailing list > Python-nl at python.org > https://mail.python.org/mailman/listinfo/python-nl > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnnydebris at gmail.com Sun Sep 4 04:11:00 2016 From: johnnydebris at gmail.com (Guido Wesdorp) Date: Sun, 4 Sep 2016 10:11:00 +0200 Subject: [python-nl] Error in python multiprocessing! In-Reply-To: References: <111968693.570469.1472285791495.ref@mail.yahoo.com> <111968693.570469.1472285791495@mail.yahoo.com> Message-ID: Hi there, Seems like Martin is right, the error seems to be that your object isn't serializable, and it indeed seems to be 'pickle' that's used for serialization (though I'm not 100% sure). The _io.TextIOWrapper you're trying to queue is probably a 'foreign' object, implemented in C or C++ or sth, and can therefore not be serialized. A solution would be to store your data in a simpler structure such as a dict or a simple object and add that to the queue instead. Hope this helps. Cheers, Guido On Sat, Sep 3, 2016 at 9:02 PM, Martin Fitzpatrick < martin.fitzpatrick at gmail.com> wrote: > Hi Akshay > > It's a little difficult to understand what you're doing, but as a general > rule I would avoid using both multiprocessing and Qt threads (if only > because this is going to confuse things). The error you're receiving looks > like it is coming from the serialisation (pickle?) of the data in/out of > the task. > > For a problem like this I would suggest sticking with Qt threads and > implementing something via QRunnable/QThreadpool. I have a brief (draft) > writeup of this process on my site at: http://mfitzp.io/ > application-multithreading-with-pyqt/ ...will be finished up in a few > weeks. > > The approach is to create a QRunnable class that accepts a function to run > and passes notification/results out as signals. To start a job (e.g. > process a file) you would pass in your function, the filename and then > attach a listener to the 'result' signal. Once the task is run your data > will come back out via that. You can for example attach this signal to a > slot (python function) to update your GUI. > > If the plotting is causing a slow down, you might also want to try > PyQtGraph. > > Hope that helps > > Martin > > > > On 27 August 2016 at 10:16, Akshay Verma via Python-nl < > python-nl at python.org> wrote: > >> Hi all, >> >> After a lot of searching on the internet, I am looking for help from you >> guys. >> >> I am working on a Qt based GUI which takes in a stream of file paths >> coming from a separate process and reads those data file for >> post-processing and plotting. Since post-processing and plotting have >> become a bit involved, there is a request to improve the performance of the >> GUI. Currently the GUI takes in the input message with the path of the file >> and gives a SIGNAL to the Worker thread (Qt thread) to process the file. >> The processing results are saved in the object for reference and display >> within the GUI. Simple separation of the threads does not help a lot for >> intensive processing cases. I had to add a sleep of 1 sec to quick fix the >> GIL of Python and make the GUI responsive. To improve the solution, I >> thought of using Multiprocessing for the post-processing task. I am trying >> to add the task to queue and get back the result in a queue. When I >> implement this solution, I get '*TypeError: cannot serailize >> '_io.TextIOWrapper' object'* at the call of start() of the Process. >> >> What could be the cause of this error? Is there a better way to solve >> this issue? Any suggestions are welcome. >> >> Regards, Akshay Verma >> >> _______________________________________________ >> Python-nl mailing list >> Python-nl at python.org >> https://mail.python.org/mailman/listinfo/python-nl >> >> > > _______________________________________________ > Python-nl mailing list > Python-nl at python.org > https://mail.python.org/mailman/listinfo/python-nl > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stappers at stappers.nl Sun Sep 4 06:27:24 2016 From: stappers at stappers.nl (Geert Stappers) Date: Sun, 4 Sep 2016 12:27:24 +0200 Subject: [python-nl] visualisatie van voortgang: chartkick.py In-Reply-To: <8519CC20-7D52-4B02-98D2-C00519F39B73@klankschap.nl> References: <20160903135704.GZ4220@gpm.stappers.nl> <8519CC20-7D52-4B02-98D2-C00519F39B73@klankschap.nl> Message-ID: <20160904102724.GJ4220@gpm.stappers.nl> On Sun, Sep 04, 2016 at 12:20:40AM +0200, Floris van Manen wrote: > > On 3 Sep 2016, at 15:57, Geert Stappers wrote: > > > > > > Wat is geschikte libary of framework om voortgang te visualiseren? > > > > Een "progress bar" zou een mooi begin zijn. > > > > Een "array of progress bars" is meer wat ik zoek. > > > > > > Input voor het generen van statische output is dan iets als > > > > prj[0] = 80 > > prj[1] = 20 > > prj[2] = 50 > > prj[3] = 0 > > prj[4] = 0 > > > > > > Output > > > > _____ > > _____ > > #____ > > #____ > > #____ > > #_#__ > > #_#__ > > #_#__ > > ###__ > > ###__ > > 01234 > > > > In de "grafische weergave" is te zien dat aan [3] en [4] nog begonnen moet worden. > > > > Is er zo iets? Iets dat histogramen aanmaakt? > > > > De eerste vraag die rijst is natuurlijk de voortgang waarvan ??? Allerlei zaken die buiten een computer gebeuren. Wat voorbeelden: * T-shirts bedrukken * Taarten bakken * Nieuwbouwwijk Dat dan zichtbaar maken voor anderen. Het is https://github.com/mher/chartkick.py wat ik inmiddels gevonden hebben. Voorbeeld visualisatie op http://mher.github.io/chartkick.py/ Groeten Geert Stappers -- Leven en laten leven -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: From vm at klankschap.nl Sun Sep 4 06:57:11 2016 From: vm at klankschap.nl (Floris van Manen) Date: Sun, 4 Sep 2016 12:57:11 +0200 Subject: [python-nl] visualisatie van voortgang: chartkick.py In-Reply-To: <20160904102724.GJ4220@gpm.stappers.nl> References: <20160903135704.GZ4220@gpm.stappers.nl> <8519CC20-7D52-4B02-98D2-C00519F39B73@klankschap.nl> <20160904102724.GJ4220@gpm.stappers.nl> Message-ID: <493830A7-9459-41FB-AEDB-B218EB960D67@klankschap.nl> > On 4 Sep 2016, at 12:27, Geert Stappers wrote: > > Allerlei zaken die buiten een computer gebeuren. Wat voorbeelden: > > * T-shirts bedrukken > * Taarten bakken > * Nieuwbouwwijk > > Dat dan zichtbaar maken voor anderen. Aha, gewoon een plaatje met wat lijnen ? Een excel / libre-office graph Dat was niet helemaal duidelijk op te maken uit je eerste vraag. Hoe wil je het plaatje zichtbaar maken voor anderen, hoe wil je het weergeven? Als pdf, als png, als csv, als json, als html, als text ? .F -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 842 bytes Desc: Message signed with OpenPGP using GPGMail URL: From jack.jansen at cwi.nl Sun Sep 4 16:14:45 2016 From: jack.jansen at cwi.nl (Jack Jansen) Date: Sun, 4 Sep 2016 22:14:45 +0200 Subject: [python-nl] visualisatie van voortgang: chartkick.py In-Reply-To: <493830A7-9459-41FB-AEDB-B218EB960D67@klankschap.nl> References: <20160903135704.GZ4220@gpm.stappers.nl> <8519CC20-7D52-4B02-98D2-C00519F39B73@klankschap.nl> <20160904102724.GJ4220@gpm.stappers.nl> <493830A7-9459-41FB-AEDB-B218EB960D67@klankschap.nl> Message-ID: Kijk ook eens naar pyplot/matplotlib. Dat wordt vooral gebruikt om wetenschappelijk uitziende grafieken te maken, maar kan meer, kijk bijvoorbeeld eens op de gallery pagina: http://matplotlib.org/gallery.html Heeft alleen het nadeel dat er maar 2 soorten voorbeeldcode zijn: (1) super simpele dingen, en (2) onwaarschijnlijk ingewikkelde dingen. En als je live data wilt visualiseren op een webpagina dan zou je kunnen denken aan d3, maar (vloeken in de kerk) dat is Javascript en geen Python. Jack > On 04-Sep-2016, at 12:57 , Floris van Manen wrote: > > >> On 4 Sep 2016, at 12:27, Geert Stappers wrote: >> >> Allerlei zaken die buiten een computer gebeuren. Wat voorbeelden: >> >> * T-shirts bedrukken >> * Taarten bakken >> * Nieuwbouwwijk >> >> Dat dan zichtbaar maken voor anderen. > > > Aha, gewoon een plaatje met wat lijnen ? > Een excel / libre-office graph > Dat was niet helemaal duidelijk op te maken uit je eerste vraag. > > Hoe wil je het plaatje zichtbaar maken voor anderen, hoe wil je het weergeven? > Als pdf, als png, als csv, als json, als html, als text ? > > .F > _______________________________________________ > Python-nl mailing list > Python-nl at python.org > https://mail.python.org/mailman/listinfo/python-nl -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman