Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Watcher for long computations #125

Open
albop opened this issue Feb 13, 2015 · 8 comments
Open

Watcher for long computations #125

albop opened this issue Feb 13, 2015 · 8 comments

Comments

@albop
Copy link
Contributor

albop commented Feb 13, 2015

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='my@email.com'):
    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.

@jstac
Copy link
Contributor

jstac commented Feb 14, 2015

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.

@mmcky
Copy link
Contributor

mmcky commented Feb 15, 2015

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 notifications@github.com
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
#125 (comment)
.

@mmcky
Copy link
Contributor

mmcky commented Aug 5, 2015

@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.

@mmcky
Copy link
Contributor

mmcky commented Aug 28, 2015

Basic tic, tac, tok functions are now in utils sub-package. Leaving open for suggested improvements.

@albop
Copy link
Contributor Author

albop commented Jan 22, 2016

@mmcky: where does this one stands ? I just realized that I may have forgotten to make the gist public.

@mmcky
Copy link
Contributor

mmcky commented Jan 22, 2016

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 :).

@albop
Copy link
Contributor Author

albop commented Jan 22, 2016

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.

@mmcky
Copy link
Contributor

mmcky commented Jan 22, 2016

Ok - Cool. I will have a look into this feature next week. I really would like this functionality.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants