lgpage / nbtutor Goto Github PK
View Code? Open in Web Editor NEWVisualize Python code execution (line-by-line) in Jupyter Notebook cells.
License: Other
Visualize Python code execution (line-by-line) in Jupyter Notebook cells.
License: Other
I notice that the original Python Tutor application can be used with with "Python, Java, JavaScript, TypeScript, Ruby, C, and C++" programmes, though I'm not sure how it actually works...
Which got me wondering - will this plugin be able to work with other kernels? If so, to what extent might the approach generalise to other language kernels too, such as R
?
I encountered a strange behavior when trying to install nbtutor
.
The strange thing is that I was able to install it in my ~/tmp
directory and everything worked fine. When I was trying to install it in the project directory I wanted it, I got the following error message:
[W 06:51:57.701 NotebookApp] 404 GET /nbextensions/nbtutor/js/nbtutor.deps.min.js.js (127.0.0.1) 1.260000ms referer=http://localhost:8888/notebooks/src/jupyter/Untitled.ipynb?kernel_name=python3
This is in ubuntu 20.04; python 3.8.10.
The install process (in both directories) was:
$ python3 -m venv nbtutor_venv
$ source nbtutor_venv/bin/activate
(nbtutor_venv) $ pip install --upgrade pip
(nbtutor_venv) $ pip install nbtutor
(nbtutor_venv) $ jupyter nbextension install --overwrite --py nbtutor --sys-prefix
(nbtutor_venv) $ jupyter nbextension enable nbtutor --py --sys-prefix
(nbtutor_venv) $ jupyter notebook
I do not see any files in the project directory that might affect the behavior or jupyter... Any ideas?
Thanks a lot for such a great tool & best regards!
jsPlumb clears all connectors, not just the connectors in a specified container. I'm guessing I need to look into using jsPlumb instances.
For example
foo = list()
foo.append(foo)
"Run all cells" triggers multiple toolbar builds when the toolbar is off
Rewrite nbtutor
for easier maintainability:
To provide more real estate for the stepper visualisation, it might be useful to pop the stepper visualation out into a floating JQuery dialog widget.
As a proof of concept, if we find the div id for (the div has class nbtutor-canvas
) we can pop it out into its own window if we have jquery and jquery-ui loaded using the following:
%%HTML
<script>$( "#SPECIFIC_ID" ).dialog()</script>
Peeking at the code, the corresponding div appears to be defined here:
nbtutor/src/es6/notebook/notebook.es6
Line 49 in 07798a0
Also include IPython's out[]
output.
how can i run this projekt on docker
From https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/45fNK2ni_so:
(Windows +Mac OSx) When i run "%%nbtutor -r -f" the GUI does not display on the right hand side. I have installed nbtutor and no error message is displayed.
Thank you for the help.
nbtutor
makes notebook un-usable when both nbtutor
and nbgrader
create_assignment
extensions are enabled. It is nbtutor
that is breaking things with the following web console error:
too much recursion
initEvents/CellToolbar.prototype.rebuild nbtutor/js/nbtutor.min.js:48:1
A cell's code is pointlessly re-run again via ipython to get the "<ipython-input-{0}-{1}>" f_code.co_filename
set and the code cached.
I don't know enough, yet, about the IPython API to do this better inside the debugger
https://github.com/lgpage/nbtutor/blob/master/nbtutor/ipython/magic.py#L66
Hello there,
I suspect this project is now unmaintained, last commit was in 2016...
@lgpage are you still maintaining this project?
It's very interesting and it would be valuable to keep it running! Thanks in advance!
I'm willing to try to help it, but I'm not feeling confident it taking the full responsibility.
Regards from France, @Naereen
This extension works very well for me, and I'm a big fan and intense user of the RISE jupyter extension to teach with Jupyter notebook being displayed in full screen as slides.
using nbtutor from the RISE live show mode (regardless of being full-screen) works from the backend side, but not from the frontend UI side: the control buttons are hidden!
But exiting the RISE mode shows that the buttons are there, they work and everything is fine.
This issue is here to notify about this bug, and I can try to help, but I'm not an expert on the architecture of nbtutor, so I would need your help @lgpage!
Thanks in advance!
Add line marker legend after fixing #6
The colour theme in the animation offers low contrast displays when stepping through the trace. Is there an easy way of setting background and font colours, or selecting a high contrast / websafe / colourblind safe palette?
Look over this again.
Add a cutoff for the sizes/length of "sequence" type objects and a cell magics option
Line numbers for the line markers needs to be restricted to only the objects created in the current cell.
Hi, Logan,
I liked to try nbtutor with nbgrader. This is weird issue, after enabling nbtutor globally - I am unable to make anything with cells - especially create cell below current cell (by menu item Insert -> Insert Cell Below
or by keyboard shortcut). I am sure this is nbtutor issue, because
My actual software versions you can see from nbgrader issue jupyter/nbgrader#891, which I submitted today.
Edit: link to nbgrader issue
Running nbtutor
in a recent Jupyter notebooks build gives a Failed to load extension - Error: Script error for "nbextensions/nbtutor/js/nbtutor.min"
error?
ImportError: cannot import name 'Literal' from 'typing'
I use jupyterlab for python trainings and your extension can be very useful for this job.
Is there a plan to support Jupyterlab?
Regards
Hi Team,
I am new with jupyter notebook and pythong. I just installed fresh jupyter notebook and jupyter lab. then i followed the suggested method to install nbtutor for jupyter i.e.(conda install -c conda-forge nbtutor) after installtion when i am trying to use nbtutor in my notebook while loading nbtutor i am getting traceback saying there is not module exist. i tried multiple time but nbtutor not working. can someone help me to resolve the problem.
here is the traceback detail.
%load_ext nbtutor
ModuleNotFoundError Traceback (most recent call last)
in
----> 1 get_ipython().run_line_magic('load_ext', 'nbtutor')
/usr/local/lib/python3.8/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
2315 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2316 with self.builtin_trap:
-> 2317 result = fn(*args, **kwargs)
2318 return result
2319
in load_ext(self, module_str)
/usr/local/lib/python3.8/site-packages/IPython/core/magic.py in (f, *a, **k)
185 # but it's overkill for just that one bit of state.
186 def magic_deco(arg):
--> 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):
/usr/local/lib/python3.8/site-packages/IPython/core/magics/extension.py in load_ext(self, module_str)
31 if not module_str:
32 raise UsageError('Missing module name.')
---> 33 res = self.shell.extension_manager.load_extension(module_str)
34
35 if res == 'already loaded':
/usr/local/lib/python3.8/site-packages/IPython/core/extensions.py in load_extension(self, module_str)
78 if module_str not in sys.modules:
79 with prepended_to_syspath(self.ipython_extension_dir):
---> 80 mod = import_module(module_str)
81 if mod.file.startswith(self.ipython_extension_dir):
82 print(("Loading extensions from {dir} is deprecated. "
/usr/local/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/init.py in import_module(name, package)
125 break
126 level += 1
--> 127 return _bootstrap._gcd_import(name[level:], package, level)
128
129
/usr/local/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/_bootstrap.py in _gcd_import(name, package, level)
/usr/local/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/_bootstrap.py in find_and_load(name, import)
/usr/local/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/_bootstrap.py in find_and_load_unlocked(name, import)
ModuleNotFoundError: No module named 'nbtutor'
Title: Missing "Visualize" option in "Cell Toolbar"
Description:
I am using nbtutor and I have noticed that the "Visualize" option is missing from the "Cell Toolbar" menu. This makes it difficult for me to use the visualization feature of nbtutor.
Steps to reproduce:
Expected behavior:
The "Visualize" option should be present in the "Cell Toolbar" menu, allowing me to use the visualization feature of nbtutor.
Actual behavior:
The "Visualize" option is missing from the "Cell Toolbar" menu.
I've install in my python repository
./pip --proxy=proxy.utbm.fr:3128 install nbtutor
./jupyter nbextension install --overwrite --py nbtutor --sys-prefix
./jupyter nbextension enable nbtutor --py --sys-prefix
now in a notebook I have in a first cell :
%load_ext nbtutor
and in a second cell :
%%nbtutor blutch = 7 print (blutch)
then I execute the code in the first cell, nothing appends
And now in a second cell, nothing happends but I have this exception (just replacing my login by ...) in my javascript console (firefox):
Exception in event handler for toolbar_rebuild.CellToolbar InternalError columnNumber: 13 fileName: "http://localhost:8080/user/.../static/notebook/js/main.min.js?v=fc2a61bcf6f091823db7fb553a838e7f" lineNumber: 28677 message: "too much recursion" stack: "events.trigger@http://localhost:8080/user/.../static/notebook/js/main.min.js?v=fc2a61bcf6f091823db7fb553a838e7f:28677:13\nCellToolbar.prototype.rebuild@http://localhost:8080/user/.../nbextensions/create_assignment/main.js?v=20181009123455:22:9\nCellToolbar.prototype.rebuild@http://localhost:8080/user/.../nbextensions/create_assignment/main.js?v=20181009123455:23:9\nCellToolbar.prototype.rebuild@http://localhost:8080/user/.../nbextensions/create_assignment/main.js?v=20181009123455:23:9\nCellToolbar.prototype.rebuild@http://localhost:8080/user/.../nbextensions/create_assignment/main.js?v=20181009123455:23:9\nCellToolbar.prototype.rebuild@http://localhost:8080/user/.../nbextensions/create_assignment/main.js?v=20181009123455:23:9\nCellToolbar.prototype.rebuild@http://localhost:8080/user/.../nbextensions/create_assignment/main.js?v=20181009123455:23:9\nCellToolbar.prototype.rebuild@http://localhost:8080/user/..../nbextensions/create_assignment/main.js?v=20181…" __proto__: Object { stack: "", … } Arguments 0: "toolbar_rebuild.CellToolbar" 1: Object { selected: false, anchor: false, rendered: true, … } callee: Getter & Setter length: 2 Symbol(Symbol.iterator): function values() __proto__: {…} __defineGetter__: function __defineGetter__() __defineSetter__: function __defineSetter__() __lookupGetter__: function __lookupGetter__() __lookupSetter__: function __lookupSetter__() constructor: function Object() hasOwnProperty: function hasOwnProperty() isPrototypeOf: function isPrototypeOf() propertyIsEnumerable: function propertyIsEnumerable() toLocaleString: function toLocaleString() toSource: function toSource() toString: function toString() valueOf: function valueOf()
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
codemirror
, @types/codemirror
)uuid
, @types/uuid
)jquery
, @types/jquery
)@angular-devkit/build-angular
, @angular/cli
)@angular-eslint/builder
, @angular-eslint/eslint-plugin
, @angular-eslint/eslint-plugin-template
, @angular-eslint/schematics
, @angular-eslint/template-parser
)@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
)@angular/animations
, @angular/common
, @angular/compiler
, @angular/compiler-cli
, @angular/core
, @angular/forms
, @angular/language-service
, @angular/localize
, @angular/platform-browser
, @angular/platform-browser-dynamic
, @angular/router
)@angular/cdk
, @angular/material
)@ngrx/effects
, @ngrx/entity
, @ngrx/eslint-plugin
, @ngrx/schematics
, @ngrx/store
, @ngrx/store-devtools
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@angular-devkit/build-angular
, @angular/cli
)@angular/animations
, @angular/common
, @angular/compiler
, @angular/compiler-cli
, @angular/core
, @angular/forms
, @angular/language-service
, @angular/localize
, @angular/platform-browser
, @angular/platform-browser-dynamic
, @angular/router
, zone.js
)@angular/cdk
, @angular/material
)@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
)These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
.github/workflows/angular-test.yml
actions/checkout v3
actions/setup-node v3
.github/workflows/python-check.yml
actions/checkout v3
actions/setup-python v4
.github/workflows/python-publish.yml
actions/checkout v3
actions/setup-python v4
pypa/gh-action-pypi-publish c542b72dc68d2280248f2d864ba901e0c31a3ee7
.github/workflows/python-test.yml
actions/checkout v3
actions/setup-python v4
package.json
@angular/animations ^15.2.4
@angular/cdk ^15.2.3
@angular/common ^15.2.4
@angular/compiler ^15.2.4
@angular/core ^15.2.4
@angular/forms ^15.2.4
@angular/material ^15.2.3
@angular/platform-browser ^15.2.4
@angular/platform-browser-dynamic ^15.2.4
@angular/router ^15.2.4
@jsplumb/browser-ui ^5.13.7
@jsplumb/connector-bezier ^5.13.7
@ngrx/effects ~15.4.0
@ngrx/entity ~15.4.0
@ngrx/store ~15.4.0
rxjs ~7.8.0
store ~2.0.12
tslib ^2.5.0
uuid ~9.0.0
zone.js ~0.13.0
@angular-devkit/build-angular ^15.2.4
@angular-eslint/builder ^15.2.1
@angular-eslint/eslint-plugin ^15.2.1
@angular-eslint/eslint-plugin-template ^15.2.1
@angular-eslint/schematics ^15.2.1
@angular-eslint/template-parser ^15.2.1
@angular/cli ^15.2.4
@angular/compiler-cli ^15.2.4
@angular/language-service ^15.2.4
@angular/localize ^15.2.4
@ngrx/eslint-plugin ^15.4.0
@ngrx/schematics ^15.4.0
@ngrx/store-devtools ^15.4.0
@types/codemirror ^5.60.7
@types/jasmine ^4.3.1
@types/jasminewd2 ^2.0.10
@types/jquery ^3.5.16
@types/uuid ^9.0.1
@typescript-eslint/eslint-plugin ^5.58.0
@typescript-eslint/parser ^5.58.0
codemirror ^5.65.12
concat ^1.0.3
eslint ^8.38.0
eslint-plugin-rxjs ^5.0.2
fibers ^5.0.3
fs-extra ^11.1.1
jasmine-core ~4.6.0
jasmine-marbles ~0.9.2
jasmine-spec-reporter ^7.0.0
jquery ^3.6.4
karma ^6.4.1
karma-chrome-launcher ^3.1.1
karma-coverage ^2.2.0
karma-jasmine ^5.1.0
karma-jasmine-html-reporter ^2.0.0
karma-junit-reporter ^2.0.1
ng-mocks ^14.8.0
protractor ^7.0.0
ts-node ^10.9.1
typescript ~4.9.5
webpack-bundle-analyzer ^4.8.0
requirements-dev.txt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.