modelwidget module

Created on Mon Aug 9 14:46:11 2021

To define Jupyter widgets show variables. @author: Ib

class modelwidget.basewidget(datachildren: list = <factory>)[source]

Bases: object

basis for widget updating in jupyter

datachildren: list
update_df(df, current_per)[source]

will update container widgets

class modelwidget.tabwidget(tabdefdict: dict, tab: bool = True, selected_index: any = None)[source]

Bases: object

A widget to create tab or acordium contaners

tabdefdict: dict
tab: bool = True
selected_index: any = None
update_df(df, current_per)[source]

will update container widgets

reset(g)[source]

will reset container widgets

class modelwidget.sheetwidget(df_var: ~pandas.core.frame.DataFrame = <factory>, trans: any = <function sheetwidget.<lambda>>, transpose: bool = False, expname: str = 'Carbon tax rate, US$ per tonn ')[source]

Bases: object

class defining a widget which updates from a sheet

df_var: DataFrame
trans()
transpose: bool = False
expname: str = 'Carbon tax rate, US$ per tonn '
update_df(df, current_per=None)[source]
reset(g)[source]
class modelwidget.slidewidget(slidedef: dict, altname: str = 'Alternative', basename: str = 'Baseline', expname: str = 'Carbon tax rate, US$ per tonn ')[source]

Bases: object

class defefining a widget with lines of slides

slidedef: dict
altname: str = 'Alternative'
basename: str = 'Baseline'
expname: str = 'Carbon tax rate, US$ per tonn '
reset(g)[source]
update_df(df, current_per)[source]

updates a dataframe with the values from the widget

set_slide_value(g)[source]

updates the new values to the self.current_vlues will be used in update_df

class modelwidget.sumslidewidget(slidedef: dict, maxsum: any = None, altname: str = 'Alternative', basename: str = 'Baseline', expname: str = 'Carbon tax rate, US$ per tonn ')[source]

Bases: object

class defefining a widget with lines of slides

slidedef: dict
maxsum: any = None
altname: str = 'Alternative'
basename: str = 'Baseline'
expname: str = 'Carbon tax rate, US$ per tonn '
reset(g)[source]
update_df(df, current_per)[source]

updates a dataframe with the values from the widget

set_slide_value(g)[source]

updates the new values to the self.current_vlues will be used in update_df

class modelwidget.updatewidget(mmodel: any, a_datawidget: any, basename: str = 'Business as usual', keeppat: str = '*', varpat: str = '*', showvarpat: bool = True, exodif: ~pandas.core.frame.DataFrame = <factory>, lwrun: bool = True, lwupdate: bool = False, lwreset: bool = True, lwsetbas: bool = True, lwshow: bool = True, outputwidget: str = 'jupviz', prefix_dict: dict = <factory>, display_first: any = None, vline: list = <factory>, relativ_start: int = 0, short: bool = False, legend: bool = False)[source]

Bases: object

class to input and run a model

mmodel: any
a_datawidget: any
basename: str = 'Business as usual'
keeppat: str = '*'
varpat: str = '*'
showvarpat: bool = True
exodif: DataFrame
lwrun: bool = True
lwupdate: bool = False
lwreset: bool = True
lwsetbas: bool = True
lwshow: bool = True
outputwidget: str = 'jupviz'
prefix_dict: dict
display_first: any = None
vline: list
relativ_start: int = 0
short: bool = False
legend: bool = False
update(g)[source]
show(g=None)[source]
run(g)[source]
setbasis(g)[source]
reset(g)[source]
modelwidget.fig_to_image(figs, format='svg')[source]
class modelwidget.htmlwidget_df(mmodel: any, df_var: ~pandas.core.frame.DataFrame = <factory>, trans: any = <function htmlwidget_df.<lambda>>, transpose: bool = False, expname: str = '', percent: bool = False, style: any = '')[source]

Bases: object

class displays a dataframe in a html widget

mmodel: any
df_var: DataFrame
trans()
transpose: bool = False
expname: str = ''
percent: bool = False
style: any = ''
property show
class modelwidget.htmlwidget_fig(figs: any, expname: str = '', format: str = 'svg')[source]

Bases: object

class displays a dataframe in a html widget

figs: any
expname: str = ''
format: str = 'svg'
class modelwidget.htmlwidget_style(styler: any = '')[source]

Bases: object

Class that displays text in an HTML widget.

styler: any = ''
display()[source]
class modelwidget.htmlwidget_label(expname: str = '', format: str = 'svg')[source]

Bases: object

class displays a dataframe in a html widget

expname: str = ''
format: str = 'svg'
class modelwidget.htmlwidget_text(text: str = '', format: str = 'svg')[source]

Bases: object

Class that displays text in an HTML widget.

text: str = ''
format: str = 'svg'
display()[source]
class modelwidget.visshow(mmodel: <built-in function any>, varpat: str = '*', showvarpat: bool = True, show_on: bool = True)[source]

Bases: object

mmodel: any
varpat: str = '*'
showvarpat: bool = True
show_on: bool = True
property show