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

Compatibility with Google Colab #35

Open
tsuchm opened this issue Nov 4, 2023 · 1 comment
Open

Compatibility with Google Colab #35

tsuchm opened this issue Nov 4, 2023 · 1 comment

Comments

@tsuchm
Copy link

tsuchm commented Nov 4, 2023

I tried watchpoints in Google Colab as follows:

!pip install watchpoints
from watchpoints import watch
x = 0
watch(x)

but it raised the following exception:

Exception                                 Traceback (most recent call last)
[<ipython-input-6-68c97bf397ec>](https://localhost:8080/#) in <cell line: 3>()
      1 from watchpoints import watch
      2 x = 0
----> 3 watch(x)

1 frames
[/usr/local/lib/python3.10/dist-packages/watchpoints/watch.py](https://localhost:8080/#) in __call__(self, *args, **kwargs)
     25         with self.set_lock:
     26             frame = inspect.currentframe().f_back
---> 27             argnodes = getargnodes(frame)
     28             for node, name in argnodes:
     29                 self.watch_list.append(

[/usr/local/lib/python3.10/dist-packages/watchpoints/util.py](https://localhost:8080/#) in getargnodes(frame)
     58     m = re.match(r".*?\((.*)\)", line)
     59     if not m:  # pragma: no cover
---> 60         raise Exception(f"Unable to locate watch line {line}")
     61     args = ["".join(s.strip().split()) for s in m.group(1).split(",")]
     62     try:

Exception: Unable to locate watch line from watchpoints import watch

I think that it will be difficult to make watchpoints compatible to Google Colab and Jupyter Notebook, but I will be happy if watchpoints will be available on them.

@gaogaotiantian
Copy link
Owner

Yeah watchpoints need to parse the file to determine which variable to trace, so colab probably won't work.

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

No branches or pull requests

2 participants