Giter Club home page Giter Club logo

Comments (5)

guybartal avatar guybartal commented on August 22, 2024

+1
i didn't update ipywidgets, i've just clone this repo into new DSVM and got the same error:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-12-861d7cb8f6e1> in <module>()
----> 1 i = interactive(TargetAnalytics.custom_barplot, df=fixed(df),                                                     filename=fixed(filename), col1=w1, Export=w_export)

C:\Anaconda\envs\py35\lib\site-packages\ipywidgets\widgets\interaction.py in __init__(self, _interactive__interact_f, _interactive__options, **kwargs)
    192             getcallargs(f, **{n:v for n,v,_ in new_kwargs})
    193         # Now build the widgets from the abbreviations.
--> 194         self.kwargs_widgets = self.widgets_from_abbreviations(new_kwargs)
    195 
    196         # This has to be done as an assignment, not using self.children.append,

C:\Anaconda\envs\py35\lib\site-packages\ipywidgets\widgets\interaction.py in widgets_from_abbreviations(self, seq)
    292             if not (isinstance(widget, ValueWidget) or isinstance(widget, fixed)):
    293                 if widget is None:
--> 294                     raise ValueError("{!r} cannot be transformed to a widget".format(abbrev))
    295                 else:
    296                     raise TypeError("{!r} is not a ValueWidget".format(widget))

ValueError: Button(description='Export', style=ButtonStyle()) cannot be transformed to a widget

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-12-b4e23ca35cec> in <module>()
     21     get_ipython().magic('reset_report')
     22     get_ipython().magic('add_interaction_code_to_report i = interactive(TargetAnalytics.custom_barplot, df=fixed(df),                                                     filename=fixed(filename), col1=w1, Export=w_export)')
---> 23     hbox = widgets.HBox(i.children)
     24     display(hbox)
     25     hbox.on_displayed(TargetAnalytics.custom_barplot(df=df0, filename=filename, col1=w1.value, Export=w_export))

AttributeError: 'int' object has no attribute 'children'


when running this cell:

md_text = '## Target Variable'
filename = 'tmp/target_variables.csv'
export_filename = 'target_report2.ipynb'

if conf_dict['Target'] in conf_dict['CategoricalColumns']:
    w1_value,w2_value,w3_value = '','',''
    w1, w2, w3, w4 = None, None, None, None
    silentremove(filename)    
    w1 = widgets.Dropdown(
        options=[conf_dict['Target']],
        value=conf_dict['Target'],
        description='Target Variable:',
    )

    ReportMagic.var_files = filename
    w_export = widgets.Button(description='Export', value='Export')
    handle_export_partial = partial(handle_export, w1=w1, w2=w2, w3=w3, export_filename=export_filename, md_text=md_text)      
    w1.observe(handle_change,'value')
    w_export.on_click(handle_export_partial)

    %reset_report
    %add_interaction_code_to_report i = interactive(TargetAnalytics.custom_barplot, df=fixed(df), \
                                                    filename=fixed(filename), col1=w1, Export=w_export)
    hbox = widgets.HBox(i.children)
    display(hbox)
    hbox.on_displayed(TargetAnalytics.custom_barplot(df=df0, filename=filename, col1=w1.value, Export=w_export))
else:
    w1_value, w2_value, w3_value = '', '', ''
    w1, w2, w3, w4 = None, None, None, None
    silentremove(filename) 
    w1 = widgets.Dropdown(
            options=[conf_dict['Target']],
            value=conf_dict['Target'],
            description='Target Variable:',
        )
    w_export = widgets.Button(description='Export', value='Export')
    handle_export_partial = partial(handle_export, w1=w1, w2=w2, w3=w3, export_filename=export_filename, md_text=md_text)       
    w1.observe(handle_change,'value')
    w_export.on_click(handle_export_partial)

    %reset_report
    %add_interaction_code_to_report i = interactive(NumericAnalytics.custom_barplot, df=fixed(df), filename=fixed(filename),\
                                                    col1=w1, Export=w_export)
    hbox = widgets.HBox(ii.children)
    display(hbox)
    hbox.on_displayed(NumericAnalytics.custom_barplot(df=df, filename=filename, col1=w1.value, Export=w_export))

from azure-tdsp-utilities.

murwebb avatar murwebb commented on August 22, 2024

i am having the same issue

from azure-tdsp-utilities.

Norticaranda avatar Norticaranda commented on August 22, 2024

I am too
Any track?
Thanks

from azure-tdsp-utilities.

elenaterenzi avatar elenaterenzi commented on August 22, 2024

as per my comment in the other open issue (#38):

so it looks like all you need to do is downgrade ipywidgets to 4:
i did the following:

pip uninstall ipywidgets
pip install ipywidgets==4

and it worked
I would highly recommend the team developing this tooling to provide a conda dependencies yml file to ensure environment is created with all the right dependencies

from azure-tdsp-utilities.

jreynolds01 avatar jreynolds01 commented on August 22, 2024

I've just created a pull request to add a conda environment yml file to address this.

from azure-tdsp-utilities.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.