- 간단한 대시보드 구축
- 모델을 개발한 후 사람들과 테스트할 수 있는 프로토타입을 만들 때 사용
설치방법
pip3 install voila # JupyterLab 사용시 jupyter labextension install @jupyter-voila/jupyterlab-preview # Jupyter Server 사용시 jupyter serverextension enable voila --sys-prefix
만약 버전이 안맞는다면,
pip install jupyterlab==2.3
설치후,
Voila
를 누르거나 새로고침할 때마다run
된 결과를 확인할 수 있음localhost:8888/voila
로도 접근가능CLI
에서voila
command로도 실행가능
config
# idle 상태인경우 cull(끄기) ## idle 커널을 확인할 간격 --MappingKernelManagee.cull_interval=60 ## 커널을 idle상태로 판단할 기준, 이 시간동안 이벤트가 없으면 idle로 판단함. --MappingKernelManager.cull_idle_timeout=300 ## 하나의 cell이 30초이상 진행되면 TimeoutError발생 ## Timeout 제한 늘리는법 --ExecutePreprocessor.timeout=180 ######################################### # 다음과 같이 설정할 수 있음 1) voila your_notebook.ipynb --enable_nbextensions=True 2) jupyter notebook --~
Issue
jupyter nbextension install --user --py widgetsnbextension jupyter nbextension enable --user --py widgetsnbextension
int_slider.value = 9
실행시slider
가 9로 옮겨감IntSlider
,FloatSlider
,IntRangeSlider
,BoundedIntText
등이 존재Text
,Textarea
,Password
ToggleButton
,Checkbox
Dropdown
RadioButtons
FileUpload
Image
DataPicker
Button
- 버튼이 클릭되었을 때, 어떤 함수가 동작하길 원하는 경우
on_click
인자에 함수 넘겨주면됨click
함수에 인자를 안줄경우 오류 발생
observe
change
라는 인자에old
와 `new'가 dictionary의 key로 들어옴
decorator
VBox
,HBox
- 위젯의 레이아웃을 구성하고 싶은 경우에 사용함
응용