QuantEcon.py
QuantEcon.py copied to clipboard
Watcher for long computations
I have been using this code on my server to track long computations: https://gist.github.com/albop/8c94e8694369474f7c85 . It is used to track long computations and send an email when they are finished. It uses a context-manager in the following way:
with watcher('computation name', email='[email protected]'):
run_long_computation()
When the computation is finished it prints on screen the number of days or seconds elapsed and sends a notification by email. A few easy improvements could be made to it:
- allow to use desktop notification instead of email
- add an IPython cell/line magic to do the same
What do you think ? If polished a little bit (no docstring), it could be a nice addition.
This is neat. +1 for adding it to the library once the docstring is included, perhaps in timing.py. Alternatively timing.py can be renamed utils.py as per @spencerlyon2 's suggestion.
Good idea ... +1 for adding it to the library. I have just recently been thinking of implementing something similar.
On Sun, Feb 15, 2015 at 9:22 AM, John Stachurski [email protected] wrote:
This is neat. +1 for adding it to the library once the docstring is included, perhaps in timing.py. Alternatively timing.py can be renamed utils.py as per @spencerlyon2 https://github.com/spencerlyon2 's suggestion.
— Reply to this email directly or view it on GitHub https://github.com/QuantEcon/QuantEcon.py/issues/125#issuecomment-74394541 .
@albop I will write and docstring and include this in the new utils subpackage once the RandomMarkov PR has been merged. There is a reorganisation of utilities in that branch and I don't want to cause any merge conflicts.
Basic tic, tac, tok functions are now in utils sub-package. Leaving open for suggested improvements.
@mmcky: where does this one stands ? I just realized that I may have forgotten to make the gist public.
Hey @albop - thanks for the reminder. Do you want to submit a PR or should I just add this to the utils subpackage? We will probably want to have an email parameter for the test function - otherwise you may get a lot of test responses :).
Good catch about the email ! That was careless of me... I honestly don't know if it's ready to merge. This was more a proof of concept and should probably be tested on a few platforms before merging. I don't know whether it works on windows for instance. Desktop notification would be good too, although not mandatory.
Ok - Cool. I will have a look into this feature next week. I really would like this functionality.