Hi Sandya
I took the liberty to refactor your dodo.py file, see: https://gist.github.com/vlcinsky/fb33a5d9b0fa67c39a54de7d20d4789f
Things changed:
Some prerequisites which may cause the process to fail:
Regarding your questions:
Btw, I think your use case is really good one for using doit. It shall bring you advantages as:
Enjoy python and doit
With best regards
Jan Vlčinský
--
You received this message because you are subscribed to the Google Groups "python-doit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-doit...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Sandhya (sorry for misspelling your name last time).
If you do not set basename explicitly in your dictionary describing the task, it is derived from name of function generating it, e.g. if it is "task_all" function the basename will be "all".
The dictionary with task can explicitly use attribute "basename".
Regarding PEP8: the code will run regardless of the formatting, but you as a programmer will have more joy from coding, if the code is well formatted. I used to code in Lisp and adopting proper coding style increased my productivity at least 4 times :-).
There are weapons to kill old code formatting habits such as editor built in code formatting. I use vim and currently moving to emacs and both support great formatting tool called yapf. To me, after I integrated it to my editor, formatting my code is no-brain activity (exactly as presented in End the Holly Wars of Formatting talk by Paul Bailey).
With best regards
Jan
SandhyaThanks,I tried doing '$ doit list --all' and saw that no tasks were printed, instead I only get the stdout of the programs I am using within my functions. Somehow the basename doesn't register?Hi Jan,Thanks for the quick reply! I will attempt to pep8 format the code, old bad habits die hard.
Re. '-n 100', I usually put a much lower number, I have quite a few cores on my workstation so I am always curious to see how many tasks run in parallel.
On 4 December 2017 at 23:08, Jan Vlčinský <jan.vl...@gmail.com> wrote:
Hi Sandya
Nice that you have provided code snippet. However, to run it I miss a file "B_files.out" and I got a bit confused by 8-char long indentation (would be great, if you pep8 format the code.).
From what I can guess from reading your code I would recommend doing `$ doit list --all` to see, what task names are planned (feel free to provide this list of task names here).
Take into account, that doit does parallel processing only for files having the same basename, so if your list of taks loks like:
baseA:alfabaseA:betabaseA:deltathese tasks can run in parallel.
However, tasks such as:
baseA_alfabaseA_betabaseA_deltado not share common basename thus cannot run in parallel. If you call it `$ doit -n 10`, it will simply ignore those tasks.
Another note: using `-n 100` seems rather high number. Usually the number relates to number of cores on your CPU or is 2 or 3 times higher, but not much more. I have 4 cores and us `-n 10` for fetching many files from internet. If you expect having high number of subtasks, do not worry about the `-n` matching it, if you have 100 subtasks and run only 4 in parallel, it will process all the subtasks anyway.
With best
Jan
To unsubscribe from this group and stop receiving emails from it, send an email to python-doit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- Jan Vlčinský mob: +420-60897040 Slunečnicová 338/3 CZ-73401 Karviná-Ráj
--
"There is always some madness in love. But there is also always some reason in madness." - Nietszche
-- Jan Vlčinský mob: +420-60897040 Slunečnicová 338/3 CZ-73401 Karviná-Ráj