Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ability to define watchers in source #614

Open
nils-werner opened this issue Feb 10, 2017 · 3 comments
Open

ability to define watchers in source #614

nils-werner opened this issue Feb 10, 2017 · 3 comments
Labels

Comments

@nils-werner
Copy link

nils-werner commented Feb 10, 2017

It would be really nice to, instead of adding them manually using the GUI, add watchers in the source code, similar to how you can add code cells in the source code. e.g.:

# %%
%reload_ext autoreload
%autoreload 2
%matplotlib inline

import numpy
import matplotlib.pyplot as plt

data = numpy.random.rand(3, 3)

#watch: plt.show(data)

This has been added to the Hydrogen Wiki Plugins. If you close this issue please remove it from the Hydrogen Wiki.

@lgeiger
Copy link
Member

lgeiger commented Feb 24, 2017

Definitely a interesting idea though not trivial.

Could you elaborate a bit more? What would the desired workflow be?
My first thought is, when should the file be parsed for possible watch statements?

@nils-werner
Copy link
Author

nils-werner commented Feb 24, 2017

The idea is to have different watchers in different cells and files and to show them accordingly whenever you execute a cell

E.g. if you need to work on a different project or go home for the day, the next day all your watchers are gone. Or you switch between two cells and need to manually change watchers every time you do.

It is probably non-trivial to add or even replace watchers when you execute a different cell.

@BenRussert
Copy link
Member

BenRussert commented May 17, 2017

I think this could be doable as a "macro" that adds watches based on some addition to the # %% cell methodology. This seems like a great idea for a hydrogen plugin so that it can be used/maintained by those who desire the feature (including me).

I have a minimal concept implemented as a hydrogen plugin, but it requires a small change to hydrogen's watch module. I'll try to post more on this soon.

My first thought is, when should the file be parsed for possible watch statements?

@lgeiger I was thinking as part of run-cell, but modified by a method inside the mentioned plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants