osscar-org / widget-code-input Goto Github PK
View Code? Open in Web Editor NEWA jupyter widget to allow input of a python function, with syntax highlighting
License: BSD 3-Clause "New" or "Revised" License
A jupyter widget to allow input of a python function, with syntax highlighting
License: BSD 3-Clause "New" or "Revised" License
My conda environment (it is a yml, but I changed to txt so I can upload ir) environments.txt
Also, I think we should leave the default to 'default'
Hello everyone,
When we display(codeinput)
multiple times, the content of the WidgetCodeInput is rendered only on the output of the first display()
call, and the following calls yield blank boxes.
The expected behaviour would be to have two separate renderings of the same Widget connected to the same backend View, according to the ipywidgets doc. This happens without problem for standard ipywidget Widgets.
My impression after reading this bit about WidgetModels is that the Typescript back-end object has trouble identifying which one of the WidgetView is trying to render the WidgetModel.
I am using Safari/Firefox and
widget_code_input : 3.5.5
IPython : 8.3.0
ipykernel : 6.9.1
ipywidgets : 8.0.3
jupyter_client : 7.2.2
jupyter_core : 4.11.1
jupyter_server : 1.18.1
jupyterlab : 3.4.8
nbclient : 0.5.13
nbconvert : 6.4.4
nbformat : 5.3.0
notebook : 6.4.11
qtconsole : 5.3.1
traitlets : 5.3.0
ipywidgets : 8.0.3
Code to reproduce :
#first cell
from widget_code_input import WidgetCodeInput
codeinput = WidgetCodeInput(
function_name="foo",
function_parameters="",
docstring=""" """,
function_body="""
return True
"""
)
display(codeinput)
# second cell
display(codeinput)
Thank you very much for the help,
João
def my_function():
return 'test'
When input string into the widget, it keeps throwing out errors. It seems related to quotation mark.
More detailed investigate needs to be done.
Hi!
Does this widget support jupyterlab 2.x?
I'm planning to move Noto to JL 2.
Best regards,
Pierre-Olivier
I've been waiting >15 minutes (15!!) to open the projectile example in binder, and binder is still building the container!
I think that
requirements.txt
. Otherwise let's discuss.But I think it critical that demos open super quick, otherwise nobody will ever see them if they take more than 1 min to open.
@dou-du could you check the requirements and limit to really required ones? Thanks!
(Also check this comment)
The error traceback does not go into the code input. Compare the error message of these two functions in the image, one time defined in a code input and one time in a usual way.
from widget_code_input import WidgetCodeInput
code_input = WidgetCodeInput(
function_name="foo",
function_parameters="",
docstring="""
""",
function_body="""
return a
"""
)
code_input.get_function_object()()
def foo():
return a
foo()
Basically you don't know in which line the error happens in the code widget.
Need to figure out how to have the uniqueID count persist when several instances of the widget are instantiated in a single notebook (currently there is an issue if >1 instance is created). _.uniqueID appears to reset to 1 each time.
The widget is NOT showing properly in the JupyterLb 4.x. The height is very large and the code content is out the range of the widget.
Hi Giovanni,
I can't seem to install through pip this widget using python 3.6. I did not try with other versions.
Here is the error message I get:
Could not find a version that satisfies the requirement widget_code_input (from versions: )
No matching distribution found for widget_code_input
Otherwise I can install the repo but it seems that the requirements are not properly read.
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.