diff --git a/.gitattributes b/.gitattributes index b215e1c58d..57c8d497e2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15,4 +15,4 @@ # Denote all files that are truly binary and should not be modified. *.png binary *.jpg binary -*.gif binary \ No newline at end of file +*.gif binary diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f75299a07f..d8a1ff6e50 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -49,7 +49,7 @@ jobs: - name: conda setup run: | conda config --set always_yes True - conda install "pip<21.2.1" + conda install "pip<21.2.1" conda install -c pyviz "pyctdev>=0.5" doit ecosystem_setup - name: conda build @@ -115,7 +115,7 @@ jobs: run: | eval "$(conda shell.bash hook)" conda activate test-environment - conda install ${{ env.CHANS_DEV }} "pip<21.2.1" + conda install ${{ env.CHANS_DEV }} "pip<21.2.1" doit develop_install $CHANS_DEV -o build pip uninstall -y panel doit pip_on_conda diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 4f91ab797b..845921c3d7 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -65,7 +65,7 @@ jobs: run: | eval "$(conda shell.bash hook)" conda activate test-environment - conda install "pip<21.2.1" + conda install "pip<21.2.1" conda list doit develop_install -o doc -o examples pip install pyecharts idom==0.24 @@ -73,7 +73,7 @@ jobs: run: | eval "$(conda shell.bash hook)" conda activate test-environment - conda install "jinja2<=3.0.3" + conda install "jinja2<=3.0.3" - name: doit env_capture run: | eval "$(conda shell.bash hook)" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a0e877a54b..7c078d4a65 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,8 +11,24 @@ on: - cron: '0 19 * * SUN' jobs: + pre_commit: + name: Run pre-commit hooks + runs-on: 'ubuntu-latest' + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: "1" + - name: set PY + run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV + - uses: actions/cache@v1 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + - name: pre-commit + uses: pre-commit/action@v2.0.3 test_suite: name: Pytest on ${{ matrix.os }} with Python ${{ matrix.python-version }} + needs: [pre_commit] runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -25,7 +41,7 @@ jobs: timeout-minutes: 60 defaults: run: - shell: bash -l {0} + shell: bash -l {0} env: DESC: "Python ${{ matrix.python-version }} tests" PYTHON_VERSION: ${{ matrix.python-version }} @@ -67,7 +83,7 @@ jobs: run: | eval "$(conda shell.bash hook)" conda activate test-environment - conda install "pip<21.2.1" "toml" + conda install "pip<21.2.1" "toml" conda list doit develop_install -o examples -o recommended -o tests -o build pip install pyecharts idom @@ -84,11 +100,6 @@ jobs: eval "$(conda shell.bash hook)" conda activate test-environment doit env_capture - - name: doit test_flakes - run: | - eval "$(conda shell.bash hook)" - conda activate test-environment - doit test_flakes - name: doit test_unit run: | eval "$(conda shell.bash hook)" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..1bcf9f3df4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,23 @@ +# This is the configuration for pre-commit, a local framework for managing pre-commit hooks +# Check out the docs at: https://pre-commit.com/ + +default_stages: [commit] +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.2.0 + hooks: + - id: check-builtin-literals + - id: check-case-conflict + - id: check-docstring-first + - id: check-executables-have-shebangs + - id: check-toml + - id: detect-private-key + - id: end-of-file-fixer + exclude: \.min\.js$ + - id: trailing-whitespace +- repo: https://github.com/PyCQA/flake8 + rev: 4.0.1 + hooks: + - id: flake8 # See 'setup.cfg' for args + args: [panel] + files: panel/ diff --git a/README.md b/README.md index 2fe25c3497..6bcea1865d 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ## What is it? -[Panel](https://panel.holoviz.org/) provides tools for easily composing widgets, plots, tables, and other viewable objects and controls into custom analysis tools, apps, and dashboards. Panel works with visualizations from [Altair](https://altair-viz.github.io/), [Bokeh](https://bokeh.pydata.org), [HoloViews](https://holoviews.org), [Matplotlib](https://matplotlib.org/), [Plotly](https://plotly.com/), [pydeck](https://pydeck.gl/), [PyVista](https://docs.pyvista.org/) and many other Python plotting libraries, making them instantly viewable either individually or when combined with interactive widgets that control them. +[Panel](https://panel.holoviz.org/) provides tools for easily composing widgets, plots, tables, and other viewable objects and controls into custom analysis tools, apps, and dashboards. Panel works with visualizations from [Altair](https://altair-viz.github.io/), [Bokeh](https://bokeh.pydata.org), [HoloViews](https://holoviews.org), [Matplotlib](https://matplotlib.org/), [Plotly](https://plotly.com/), [pydeck](https://pydeck.gl/), [PyVista](https://docs.pyvista.org/) and many other Python plotting libraries, making them instantly viewable either individually or when combined with interactive widgets that control them. Panel works equally well in [Jupyter Notebooks](http://jupyter.org), for creating quick data-exploration tools, or as standalone deployed apps and dashboards, and allows you to easily switch between those contexts as needed. diff --git a/binder/jupyter-panel-apps-server/examples-icon.svg b/binder/jupyter-panel-apps-server/examples-icon.svg index 8be79f5432..bc4b27d146 100644 --- a/binder/jupyter-panel-apps-server/examples-icon.svg +++ b/binder/jupyter-panel-apps-server/examples-icon.svg @@ -141,4 +141,4 @@ d="m 424.8331,271.7972 -1.5928,-7.8554 -3.2766,0 c -2.502,0 -3.7198,-0.4408 -5.1546,-1.8664 l -1.8786,-1.8664 -1.6408,1.9556 c -0.9028,1.0752 -1.8072,1.7252 -2.0096,1.444 -0.8284,-1.15 -7.8462,-31.3496 -7.8462,-33.7652 0,-2.814 1.7062,2.9396 4.2406,14.3008 1.519,6.8084 3.0924,13.3394 3.497,14.5136 l 0.7354,2.135 1.56,-1.5802 c 1.4462,-1.465 1.683,-1.481 3.2436,-0.2186 0.9262,0.7492 3.3984,1.6176 5.4934,1.9304 l 3.81,0.569 1.5082,7.3338 c 0.83,4.0334 1.6426,7.334 1.8066,7.334 0.164,0 0.8564,-1.2158 1.539,-2.7012 1.2312,-2.6806 1.2572,-2.6934 3.3234,-1.6546 4.2462,2.134 6.8852,-2.1402 10.2804,-16.6524 0.8678,-3.7094 1.6594,-6.047 2.047,-6.0444 0.3476,0 1.244,2.1606 1.992,4.796 0.7478,2.6352 1.4508,4.7934 1.562,4.796 0.112,0 0.9322,-2.6466 1.8242,-5.887 0.8922,-3.2406 2.4332,-7.6592 3.4244,-9.819 l 1.8026,-3.9278 1.4798,3.8246 c 1.263,3.2642 1.51,3.5836 1.6876,2.1818 0.116,-0.9034 0.8762,-11.5596 1.6938,-23.6804 1.6498,-24.463 1.6058,-24.2532 4.1718,-19.857 1.558,2.669 2.8706,2.6834 4.3966,0.048 0.046,-0.084 0.8658,-5.8234 1.8172,-12.756 0.9514,-6.9328 2.507,-16.8924 3.4568,-22.1328 1.6534,-9.1202 1.8032,-9.615 3.4952,-11.5464 1.8996,-2.1678 2.0798,-2.9186 4.1596,-17.3292 1.1142,-7.717 1.3302,-8.2916 3.1174,-8.2916 l 1.4664,0 1.5948,-10.0938 c 0.8772,-5.5514 1.5948,-10.4612 1.5948,-10.9098 0,-0.4492 0.328,-0.8166 0.7288,-0.8166 0.6196,0 0.9448,2.0298 2.1672,13.5286 0.791,7.4406 1.556,13.5264 1.6998,13.524 0.142,0 0.8158,-2.7518 1.4932,-6.1096 0.6774,-3.3578 1.4756,-6.105 1.7738,-6.105 0.3614,0 1.0878,4.1406 2.1814,12.4374 0.9016,6.8406 2.45,18.196 3.4412,25.2342 1.7638,12.5266 1.8272,12.8052 2.9986,13.2064 0.6582,0.2254 1.3462,0.212 1.5288,-0.03 0.182,-0.2418 1.0152,-3.7334 1.851,-7.7584 1.3456,-6.4806 1.7304,-7.584 3.3598,-9.64 1.0126,-1.276 2.5918,-4.415 3.5102,-6.9752 0.9186,-2.5596 1.8828,-4.6542 2.1434,-4.6542 0.4816,0 3.2134,9.3748 6.0136,20.6358 1.4396,5.7892 1.6724,7.7526 3.2614,27.4934 l 1.7114,21.2592 1.3438,1.5264 c 0.7386,0.8392 2.1484,1.5264 3.1322,1.527 l 1.7892,0 1.676,-8.3324 c 1.3364,-6.6436 2.0484,-9.0324 3.511,-11.7832 1.0092,-1.8976 1.941,-3.4502 2.0714,-3.4502 0.128,0 1.2638,1.6994 2.5202,3.7762 3.4598,5.7212 4.3112,6.3142 6.1276,4.2666 0.8248,-0.93 1.7244,-1.5114 1.999,-1.2924 0.2746,0.219 1.1268,3.1948 1.893,6.6136 l 1.3936,6.2158 1.4406,-9.1946 c 0.792,-5.0568 1.5572,-9.6192 1.7002,-10.1382 0.142,-0.5194 1.1294,-1.413 2.1918,-1.9856 l 1.9322,-1.0408 1.8048,3.322 c 2.4582,4.524 5.148,13.7632 7.2974,25.063 1.7084,8.984 3.8948,17.1618 4.5884,17.1618 0.176,0 0.3226,0.7854 0.3226,1.7456 0,0.9598 -0.164,1.7454 -0.3658,1.7454 -0.8328,0 -3.9252,-10.6562 -5.4498,-18.78 -1.989,-10.5968 -4.9452,-21.0326 -7.0188,-24.7752 -1.4506,-2.6184 -1.6234,-2.7194 -3.0326,-1.7716 -1.4134,0.9512 -1.542,1.342 -2.3816,7.2378 -1.6164,11.3462 -2.3932,15.396 -2.953,15.396 -0.3028,0 -1.2616,-3.1756 -2.1308,-7.0574 -1.2722,-5.685 -1.7078,-6.9376 -2.2386,-6.4386 -2.6506,2.4894 -2.7108,2.501 -4.365,0.8256 -0.8978,-0.9094 -2.3544,-2.9436 -3.2374,-4.5202 -0.883,-1.577 -1.78,-2.869 -1.9938,-2.8712 -1.1004,-0.02 -3.2456,6.273 -4.8372,14.1708 l -1.7148,8.5094 -2.2294,0 c -2.831,0 -5.6864,-2.5914 -5.964,-5.412 -0.108,-1.1038 -0.9172,-11.0404 -1.7972,-22.0814 -1.7314,-21.719 -1.6584,-21.2674 -5.9564,-36.8748 -1.0902,-3.9596 -2.0778,-7.1998 -2.194,-7.2006 -0.118,-8e-4 -0.8574,1.9002 -1.6466,4.2248 -0.8496,2.5022 -2.085,4.885 -3.028,5.8404 -1.4204,1.438 -1.8026,2.5518 -3.526,10.2658 l -1.9334,8.6524 -1.8218,-0.595 c -1.0022,-0.3274 -2.026,-1.056 -2.2758,-1.6188 -0.3814,-0.8594 -5.3654,-36.0386 -6.1734,-43.5726 -0.14,-1.3204 -0.4232,-2.4004 -0.6258,-2.4004 -0.2042,0 -0.9126,2.7654 -1.577,6.1458 -1.7632,8.9638 -2.1392,8.2502 -3.7898,-7.1906 -0.753,-7.0464 -1.4824,-13.0576 -1.6206,-13.3578 -0.136,-0.2998 -0.7266,2.7194 -1.3074,6.7102 -1.4726,10.117 -1.8224,11.1838 -3.6694,11.1838 l -1.5186,0 -1.678,11.4922 -1.6786,11.4928 -1.811,1.8178 c -1.7896,1.7966 -1.8314,1.9344 -3.585,11.855 -0.9756,5.5208 -2.4958,15.3396 -3.3782,21.8204 -0.8824,6.4806 -1.7722,12.2452 -1.9766,12.8102 -0.2042,0.565 -1.1318,1.6088 -2.06,2.3194 -1.626,1.2438 -1.7396,1.2116 -3.1148,-0.8872 -0.7848,-1.1978 -1.5098,-1.9932 -1.6104,-1.7668 -0.1,0.226 -0.911,10.91 -1.8004,23.7416 -1.1486,16.5682 -1.7748,23.4656 -2.1604,23.7982 -0.317,0.273 -0.9704,-0.7466 -1.5696,-2.4464 -0.5644,-1.603 -1.2466,-3.5268 -1.5158,-4.2756 -0.4282,-1.1912 -0.6812,-0.888 -2.0272,2.428 -0.8456,2.084 -2.2834,6.5024 -3.1944,9.819 -0.9654,3.513 -1.924,6.03 -2.297,6.03 -0.36,0 -1.2072,-2.1006 -1.9358,-4.8004 -0.7122,-2.6404 -1.3894,-4.797 -1.5048,-4.793 -0.116,0 -0.8212,2.5974 -1.5692,5.7632 -0.748,3.166 -2.3218,8.043 -3.4974,10.8378 -1.8264,4.343 -2.3968,5.166 -3.9222,5.662 -0.9818,0.3192 -2.451,0.168 -3.2646,-0.3378 -1.2544,-0.7778 -1.6376,-0.6636 -2.5238,0.7536 -0.5746,0.919 -1.2692,2.2784 -1.5434,3.0208 -1.076,2.9116 -1.796,1.5452 -3.4286,-6.5052 z" style="fill-opacity:1;stroke:#eeeeee;stroke-width:11;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none" /> - \ No newline at end of file + diff --git a/binder/jupyter-voila-docs-server/examples-icon.svg b/binder/jupyter-voila-docs-server/examples-icon.svg index 8be79f5432..bc4b27d146 100644 --- a/binder/jupyter-voila-docs-server/examples-icon.svg +++ b/binder/jupyter-voila-docs-server/examples-icon.svg @@ -141,4 +141,4 @@ d="m 424.8331,271.7972 -1.5928,-7.8554 -3.2766,0 c -2.502,0 -3.7198,-0.4408 -5.1546,-1.8664 l -1.8786,-1.8664 -1.6408,1.9556 c -0.9028,1.0752 -1.8072,1.7252 -2.0096,1.444 -0.8284,-1.15 -7.8462,-31.3496 -7.8462,-33.7652 0,-2.814 1.7062,2.9396 4.2406,14.3008 1.519,6.8084 3.0924,13.3394 3.497,14.5136 l 0.7354,2.135 1.56,-1.5802 c 1.4462,-1.465 1.683,-1.481 3.2436,-0.2186 0.9262,0.7492 3.3984,1.6176 5.4934,1.9304 l 3.81,0.569 1.5082,7.3338 c 0.83,4.0334 1.6426,7.334 1.8066,7.334 0.164,0 0.8564,-1.2158 1.539,-2.7012 1.2312,-2.6806 1.2572,-2.6934 3.3234,-1.6546 4.2462,2.134 6.8852,-2.1402 10.2804,-16.6524 0.8678,-3.7094 1.6594,-6.047 2.047,-6.0444 0.3476,0 1.244,2.1606 1.992,4.796 0.7478,2.6352 1.4508,4.7934 1.562,4.796 0.112,0 0.9322,-2.6466 1.8242,-5.887 0.8922,-3.2406 2.4332,-7.6592 3.4244,-9.819 l 1.8026,-3.9278 1.4798,3.8246 c 1.263,3.2642 1.51,3.5836 1.6876,2.1818 0.116,-0.9034 0.8762,-11.5596 1.6938,-23.6804 1.6498,-24.463 1.6058,-24.2532 4.1718,-19.857 1.558,2.669 2.8706,2.6834 4.3966,0.048 0.046,-0.084 0.8658,-5.8234 1.8172,-12.756 0.9514,-6.9328 2.507,-16.8924 3.4568,-22.1328 1.6534,-9.1202 1.8032,-9.615 3.4952,-11.5464 1.8996,-2.1678 2.0798,-2.9186 4.1596,-17.3292 1.1142,-7.717 1.3302,-8.2916 3.1174,-8.2916 l 1.4664,0 1.5948,-10.0938 c 0.8772,-5.5514 1.5948,-10.4612 1.5948,-10.9098 0,-0.4492 0.328,-0.8166 0.7288,-0.8166 0.6196,0 0.9448,2.0298 2.1672,13.5286 0.791,7.4406 1.556,13.5264 1.6998,13.524 0.142,0 0.8158,-2.7518 1.4932,-6.1096 0.6774,-3.3578 1.4756,-6.105 1.7738,-6.105 0.3614,0 1.0878,4.1406 2.1814,12.4374 0.9016,6.8406 2.45,18.196 3.4412,25.2342 1.7638,12.5266 1.8272,12.8052 2.9986,13.2064 0.6582,0.2254 1.3462,0.212 1.5288,-0.03 0.182,-0.2418 1.0152,-3.7334 1.851,-7.7584 1.3456,-6.4806 1.7304,-7.584 3.3598,-9.64 1.0126,-1.276 2.5918,-4.415 3.5102,-6.9752 0.9186,-2.5596 1.8828,-4.6542 2.1434,-4.6542 0.4816,0 3.2134,9.3748 6.0136,20.6358 1.4396,5.7892 1.6724,7.7526 3.2614,27.4934 l 1.7114,21.2592 1.3438,1.5264 c 0.7386,0.8392 2.1484,1.5264 3.1322,1.527 l 1.7892,0 1.676,-8.3324 c 1.3364,-6.6436 2.0484,-9.0324 3.511,-11.7832 1.0092,-1.8976 1.941,-3.4502 2.0714,-3.4502 0.128,0 1.2638,1.6994 2.5202,3.7762 3.4598,5.7212 4.3112,6.3142 6.1276,4.2666 0.8248,-0.93 1.7244,-1.5114 1.999,-1.2924 0.2746,0.219 1.1268,3.1948 1.893,6.6136 l 1.3936,6.2158 1.4406,-9.1946 c 0.792,-5.0568 1.5572,-9.6192 1.7002,-10.1382 0.142,-0.5194 1.1294,-1.413 2.1918,-1.9856 l 1.9322,-1.0408 1.8048,3.322 c 2.4582,4.524 5.148,13.7632 7.2974,25.063 1.7084,8.984 3.8948,17.1618 4.5884,17.1618 0.176,0 0.3226,0.7854 0.3226,1.7456 0,0.9598 -0.164,1.7454 -0.3658,1.7454 -0.8328,0 -3.9252,-10.6562 -5.4498,-18.78 -1.989,-10.5968 -4.9452,-21.0326 -7.0188,-24.7752 -1.4506,-2.6184 -1.6234,-2.7194 -3.0326,-1.7716 -1.4134,0.9512 -1.542,1.342 -2.3816,7.2378 -1.6164,11.3462 -2.3932,15.396 -2.953,15.396 -0.3028,0 -1.2616,-3.1756 -2.1308,-7.0574 -1.2722,-5.685 -1.7078,-6.9376 -2.2386,-6.4386 -2.6506,2.4894 -2.7108,2.501 -4.365,0.8256 -0.8978,-0.9094 -2.3544,-2.9436 -3.2374,-4.5202 -0.883,-1.577 -1.78,-2.869 -1.9938,-2.8712 -1.1004,-0.02 -3.2456,6.273 -4.8372,14.1708 l -1.7148,8.5094 -2.2294,0 c -2.831,0 -5.6864,-2.5914 -5.964,-5.412 -0.108,-1.1038 -0.9172,-11.0404 -1.7972,-22.0814 -1.7314,-21.719 -1.6584,-21.2674 -5.9564,-36.8748 -1.0902,-3.9596 -2.0778,-7.1998 -2.194,-7.2006 -0.118,-8e-4 -0.8574,1.9002 -1.6466,4.2248 -0.8496,2.5022 -2.085,4.885 -3.028,5.8404 -1.4204,1.438 -1.8026,2.5518 -3.526,10.2658 l -1.9334,8.6524 -1.8218,-0.595 c -1.0022,-0.3274 -2.026,-1.056 -2.2758,-1.6188 -0.3814,-0.8594 -5.3654,-36.0386 -6.1734,-43.5726 -0.14,-1.3204 -0.4232,-2.4004 -0.6258,-2.4004 -0.2042,0 -0.9126,2.7654 -1.577,6.1458 -1.7632,8.9638 -2.1392,8.2502 -3.7898,-7.1906 -0.753,-7.0464 -1.4824,-13.0576 -1.6206,-13.3578 -0.136,-0.2998 -0.7266,2.7194 -1.3074,6.7102 -1.4726,10.117 -1.8224,11.1838 -3.6694,11.1838 l -1.5186,0 -1.678,11.4922 -1.6786,11.4928 -1.811,1.8178 c -1.7896,1.7966 -1.8314,1.9344 -3.585,11.855 -0.9756,5.5208 -2.4958,15.3396 -3.3782,21.8204 -0.8824,6.4806 -1.7722,12.2452 -1.9766,12.8102 -0.2042,0.565 -1.1318,1.6088 -2.06,2.3194 -1.626,1.2438 -1.7396,1.2116 -3.1148,-0.8872 -0.7848,-1.1978 -1.5098,-1.9932 -1.6104,-1.7668 -0.1,0.226 -0.911,10.91 -1.8004,23.7416 -1.1486,16.5682 -1.7748,23.4656 -2.1604,23.7982 -0.317,0.273 -0.9704,-0.7466 -1.5696,-2.4464 -0.5644,-1.603 -1.2466,-3.5268 -1.5158,-4.2756 -0.4282,-1.1912 -0.6812,-0.888 -2.0272,2.428 -0.8456,2.084 -2.2834,6.5024 -3.1944,9.819 -0.9654,3.513 -1.924,6.03 -2.297,6.03 -0.36,0 -1.2072,-2.1006 -1.9358,-4.8004 -0.7122,-2.6404 -1.3894,-4.797 -1.5048,-4.793 -0.116,0 -0.8212,2.5974 -1.5692,5.7632 -0.748,3.166 -2.3218,8.043 -3.4974,10.8378 -1.8264,4.343 -2.3968,5.166 -3.9222,5.662 -0.9818,0.3192 -2.451,0.168 -3.2646,-0.3378 -1.2544,-0.7778 -1.6376,-0.6636 -2.5238,0.7536 -0.5746,0.919 -1.2692,2.2784 -1.5434,3.0208 -1.076,2.9116 -1.796,1.5452 -3.4286,-6.5052 z" style="fill-opacity:1;stroke:#eeeeee;stroke-width:11;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none" /> - \ No newline at end of file + diff --git a/binder/postBuild b/binder/postBuild index 463468a369..c546cd72c9 100644 --- a/binder/postBuild +++ b/binder/postBuild @@ -8,4 +8,4 @@ SERVICE_URL=https://open-vsx.org/vscode/gallery ITEM_URL=https://open-vsx.org/vs SERVICE_URL=https://open-vsx.org/vscode/gallery ITEM_URL=https://open-vsx.org/vscode/item code-server --install-extension ritwickdey.liveserver bokeh sampledata panel build panel -jupyter serverextension enable panel.io.jupyter_server_extension \ No newline at end of file +jupyter serverextension enable panel.io.jupyter_server_extension diff --git a/binder/start b/binder/start index cf080bc09c..fc5d1163ff 100644 --- a/binder/start +++ b/binder/start @@ -11,4 +11,4 @@ Xvfb :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & sleep 3 jupyter trust examples/**/*.ipynb jupyter trust examples/**/**/*.ipynb -exec "$@" \ No newline at end of file +exec "$@" diff --git a/doc/FAQ.rst b/doc/FAQ.rst index 5cac87e074..72890525fe 100644 --- a/doc/FAQ.rst +++ b/doc/FAQ.rst @@ -84,7 +84,7 @@ When using the pandas plotting API we create the figure and axes in the same way **Q: How can I deploy a Panel app for others to use?** -**A:** There are many options available; see the Deployment section of the user manual. The basic idea is if you can log into a machine and launch a web server process, you can use ``panel serve`` there +**A:** There are many options available; see the Deployment section of the user manual. The basic idea is if you can log into a machine and launch a web server process, you can use ``panel serve`` there **Q: Is Panel 'Shiny for Python'?** @@ -202,7 +202,7 @@ The `Comparisons page `__ describes some of these differ | | Voila | | Voila | | | | +--------------------------------------+-----------------+----------------------+-----------------+--------------------+------------------------+--------------------+ -Each of these libraries are free, open-source software packages, but all of them can be used with the commercial -`Anaconda Enterprise (AE5) `__ server product, and some can be used with other commercial servers +Each of these libraries are free, open-source software packages, but all of them can be used with the commercial +`Anaconda Enterprise (AE5) `__ server product, and some can be used with other commercial servers (Shiny, with `Shiny Server `__, Streamlit, with `Streamlit Teams`, and Dash, with `Dash Enterprise `__), to provide on-premises authenticated deployment within a private network. Most of the servers (including Jupyter, Bokeh Server, Voila, and Dash) can be also deployed on the public sites `mybinder.org `__ or `heroku `__. diff --git a/doc/_static/wordmark.svg b/doc/_static/wordmark.svg index 5c8dcf101e..3b624950cf 100644 --- a/doc/_static/wordmark.svg +++ b/doc/_static/wordmark.svg @@ -79,4 +79,4 @@ y="0" sodipodi:role="line" id="tspan4205">Panel - \ No newline at end of file + diff --git a/doc/about/comparisons.rst b/doc/about/comparisons.rst index 519d1ef270..5784e9057b 100644 --- a/doc/about/comparisons.rst +++ b/doc/about/comparisons.rst @@ -14,7 +14,7 @@ Panel and Bokeh can both be used to create dashboards in Python, but are intende - Bokeh focuses on providing lower-level primitives that can be used to create any dashboard with enough effort, while Panel focuses on making common data-science tasks and making typical types of apps easier. - + Comparing Panel and Dash ------------------------ @@ -73,7 +73,7 @@ Panel takes a different approach, in that output from a notebook cell needs to b Comparing Panel and streamlit ----------------------------- -streamlit is an alternative to all of the above packages. Like Jupyter, streamlit provides an interactive, incremental way to build apps. streamlit works with Python text files written in a separate editor, while Jupyter uses a web-based notebook cell editor. Although a web-based editor makes it simple to work locally on remote files, using a local Python text file allows users to maximize their productivity by choosing their own favorite editor. Dash, Panel, and Bokeh all also support bare Python files developed in a local editor, and like streamlit they can all also watch that file and automatically re-run the file when you change it in the editor (e.g. for Panel or Bokeh, launch ``bokeh serve file.py --dev`` to watch the Python file and re-launch the served app on any changes). +streamlit is an alternative to all of the above packages. Like Jupyter, streamlit provides an interactive, incremental way to build apps. streamlit works with Python text files written in a separate editor, while Jupyter uses a web-based notebook cell editor. Although a web-based editor makes it simple to work locally on remote files, using a local Python text file allows users to maximize their productivity by choosing their own favorite editor. Dash, Panel, and Bokeh all also support bare Python files developed in a local editor, and like streamlit they can all also watch that file and automatically re-run the file when you change it in the editor (e.g. for Panel or Bokeh, launch ``bokeh serve file.py --dev`` to watch the Python file and re-launch the served app on any changes). Streamlit's key difference from those other tools is that with streamlit, the entire Python source file is effectively re-run *every time a widget changes value*, which has the advantage of not allowing confusing out-of-order execution of notebook cells, and also can make it simpler to reason about state in general. However, for this approach to be practical, it requires all lengthy computations to be made cacheable, which is not always straightforward and can introduce its own highly complicated reasoning about state. Moreover, the streamlit approach has similar downsides as for Dash's lack of server-side state, in that it becomes difficult to generate responsive apps for complex situations that need a precise mapping between a widget event and a specific small bit of Python code. Panel thus has better support for fully reactive applications, where each widget or component of a plot is explicitly and specifically tied to a bit of computation, re-running only the tiniest bit of code that is needed for that particular action. diff --git a/doc/index.rst b/doc/index.rst index 7f304e6a6b..64626ceb98 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -31,7 +31,7 @@ Panel makes it simple to: - Support deep interactivity by communicating client-side interactions and events to Python - Stream data large and small to the frontend - Add authentication to your application using the inbuilt OAuth providers - + The `Getting Started `_ will provide a quick introduction to the panel API and get you started while the `User Guide `_ provides a more detailed guide on how to use Panel. For usage questions or technical assistance, please head over to `Discourse `_. If you have any `issues `_ or wish to `contribute code `_, you can visit our `GitHub site `_. @@ -52,7 +52,7 @@ or using PyPI:: Usage ----- -Panel can be used in a wide range of development environments from a simple Python REPL, in a notebook or your favorite IDE such as VSCode. Visit the `Getting Started Guide `_ to discover how to get set up in your favorite development environment. +Panel can be used in a wide range of development environments from a simple Python REPL, in a notebook or your favorite IDE such as VSCode. Visit the `Getting Started Guide `_ to discover how to get set up in your favorite development environment. Sponsors -------- diff --git a/doc/user_guide/index.rst b/doc/user_guide/index.rst index e2c14bda80..dc6fc6ffd0 100644 --- a/doc/user_guide/index.rst +++ b/doc/user_guide/index.rst @@ -68,8 +68,8 @@ when needed. `Profiling and Debugging `_ Learn how to speed up your application and find issues. - - + + Supplementary guides -------------------- diff --git a/dodo.py b/dodo.py index c44026929b..4bfe3fcbc5 100644 --- a/dodo.py +++ b/dodo.py @@ -4,13 +4,13 @@ from pyctdev import * # noqa: api -def task_pip_on_conda(): - """Experimental: provide pip build env via conda""" - return {'actions':[ - # some ecosystem=pip build tools must be installed with conda when using conda... - 'conda install -y pip twine wheel', - # ..and some are only available via conda-forge - 'conda install -y -c conda-forge tox "virtualenv<=20.4.7"', +def task_pip_on_conda(): + """Experimental: provide pip build env via conda""" + return {'actions':[ + # some ecosystem=pip build tools must be installed with conda when using conda... + 'conda install -y pip twine wheel', + # ..and some are only available via conda-forge + 'conda install -y -c conda-forge tox "virtualenv<=20.4.7"', ]} diff --git a/examples/apps/django2/requirements.txt b/examples/apps/django2/requirements.txt index 7d62930496..59fc2ed647 100644 --- a/examples/apps/django2/requirements.txt +++ b/examples/apps/django2/requirements.txt @@ -2,4 +2,4 @@ django==2.2.28 channels==2.2.0 panel==0.9.3 bokeh==2.0.2 -jinja2==3.0.1 \ No newline at end of file +jinja2==3.0.1 diff --git a/examples/apps/django2/sliders/models.py b/examples/apps/django2/sliders/models.py index 8b13789179..e69de29bb2 100644 --- a/examples/apps/django2/sliders/models.py +++ b/examples/apps/django2/sliders/models.py @@ -1 +0,0 @@ - diff --git a/examples/apps/django2/sliders/templates/base.html b/examples/apps/django2/sliders/templates/base.html index 62b74c641a..a6f1072c06 100644 --- a/examples/apps/django2/sliders/templates/base.html +++ b/examples/apps/django2/sliders/templates/base.html @@ -5,7 +5,7 @@ {% block content %} - {{ script|safe }} + {{ script|safe }} {% endblock %} diff --git a/examples/apps/django_multi_apps/django_multi_apps/asgi.py b/examples/apps/django_multi_apps/django_multi_apps/asgi.py index 14cb25937b..160d4b836f 100644 --- a/examples/apps/django_multi_apps/django_multi_apps/asgi.py +++ b/examples/apps/django_multi_apps/django_multi_apps/asgi.py @@ -17,4 +17,3 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_multi_apps.settings') django.setup() application = get_default_application() - diff --git a/examples/apps/django_multi_apps/django_multi_apps/themes.py b/examples/apps/django_multi_apps/django_multi_apps/themes.py index b2d83ed08f..1e0689b3ec 100644 --- a/examples/apps/django_multi_apps/django_multi_apps/themes.py +++ b/examples/apps/django_multi_apps/django_multi_apps/themes.py @@ -14,4 +14,3 @@ def plot_themes(): pn.widgets.DatetimeInput.format = '%d %B %Y' hv.plotting.bokeh.ElementPlot.bgcolor = "#fbfcfc" hv.plotting.bokeh.ElementPlot.gridstyle = {"grid_line_alpha": 0.6, "grid_line_dash": 'dashed'} - diff --git a/examples/apps/django_multi_apps/gbm/apps.py b/examples/apps/django_multi_apps/gbm/apps.py index 36bfe49545..923677d39b 100644 --- a/examples/apps/django_multi_apps/gbm/apps.py +++ b/examples/apps/django_multi_apps/gbm/apps.py @@ -3,5 +3,3 @@ class GbmConfig(AppConfig): name = 'gbm' - - diff --git a/examples/apps/django_multi_apps/gbm/urls.py b/examples/apps/django_multi_apps/gbm/urls.py index 393fb2d14c..1328c335cb 100644 --- a/examples/apps/django_multi_apps/gbm/urls.py +++ b/examples/apps/django_multi_apps/gbm/urls.py @@ -6,4 +6,3 @@ urlpatterns = [ path('', views.gbm, name='gbm'), ] - diff --git a/examples/apps/django_multi_apps/gbm/views.py b/examples/apps/django_multi_apps/gbm/views.py index 39ff9812d1..d717d67252 100644 --- a/examples/apps/django_multi_apps/gbm/views.py +++ b/examples/apps/django_multi_apps/gbm/views.py @@ -8,4 +8,3 @@ def gbm(request: HttpRequest) -> HttpResponse: script = server_document(request.build_absolute_uri()) return render(request, "gbm/gbm.html", dict(script=script)) - diff --git a/examples/apps/django_multi_apps/requirements.txt b/examples/apps/django_multi_apps/requirements.txt index 928ce61713..1a27cf859a 100644 --- a/examples/apps/django_multi_apps/requirements.txt +++ b/examples/apps/django_multi_apps/requirements.txt @@ -42,4 +42,4 @@ sqlparse==0.3.0 tornado==6.0.3 Twisted==22.4.0 txaio==20.4.1 -zope.interface==4.7.1 \ No newline at end of file +zope.interface==4.7.1 diff --git a/examples/apps/django_multi_apps/stockscreener/zTrials.py b/examples/apps/django_multi_apps/stockscreener/zTrials.py index 85b9ec5a6a..d17de323f4 100644 --- a/examples/apps/django_multi_apps/stockscreener/zTrials.py +++ b/examples/apps/django_multi_apps/stockscreener/zTrials.py @@ -13,4 +13,4 @@ class CustomExample(param.Parameterized): 'select_string': pn.widgets.RadioButtonGroup, 'select_number': pn.widgets.DiscretePlayer} ) -print(pn.Param) \ No newline at end of file +print(pn.Param) diff --git a/examples/apps/django_multi_apps/templates/gbm/gbm.html b/examples/apps/django_multi_apps/templates/gbm/gbm.html index 618ffd7641..897b28bee0 100644 --- a/examples/apps/django_multi_apps/templates/gbm/gbm.html +++ b/examples/apps/django_multi_apps/templates/gbm/gbm.html @@ -17,4 +17,4 @@

Geometric Metric Brownian Motion

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/examples/apps/fastApi/main.py b/examples/apps/fastApi/main.py index 3de7c5709d..d5bca920e8 100644 --- a/examples/apps/fastApi/main.py +++ b/examples/apps/fastApi/main.py @@ -16,4 +16,4 @@ async def bkapp_page(request: Request): pn.serve({'/app': createApp}, port=5000, allow_websocket_origin=["127.0.0.1:8000"], - address="127.0.0.1", show=False) \ No newline at end of file + address="127.0.0.1", show=False) diff --git a/examples/apps/fastApi/sliders/pn_app.py b/examples/apps/fastApi/sliders/pn_app.py index fbc742c881..18fbed6535 100644 --- a/examples/apps/fastApi/sliders/pn_app.py +++ b/examples/apps/fastApi/sliders/pn_app.py @@ -4,4 +4,4 @@ def createApp(): sw = SineWave() - return pn.Row(sw.param, sw.plot).servable() \ No newline at end of file + return pn.Row(sw.param, sw.plot).servable() diff --git a/examples/apps/fastApi/sliders/sinewave.py b/examples/apps/fastApi/sliders/sinewave.py index 984e5b7b97..7149bedc9e 100644 --- a/examples/apps/fastApi/sliders/sinewave.py +++ b/examples/apps/fastApi/sliders/sinewave.py @@ -32,4 +32,4 @@ def update_plot(self): def sine(self): x = np.linspace(0, 4 * np.pi, self.N) y = self.amplitude * np.sin(self.frequency * x + self.phase) + self.offset - return x, y \ No newline at end of file + return x, y diff --git a/examples/apps/fastApi/templates/base.html b/examples/apps/fastApi/templates/base.html index 618af12a67..53d89a6f61 100644 --- a/examples/apps/fastApi/templates/base.html +++ b/examples/apps/fastApi/templates/base.html @@ -6,4 +6,4 @@ {{ script|safe }} - \ No newline at end of file + diff --git a/examples/apps/fastApi_multi_apps/main.py b/examples/apps/fastApi_multi_apps/main.py index 37d26fface..f0ec4ed201 100644 --- a/examples/apps/fastApi_multi_apps/main.py +++ b/examples/apps/fastApi_multi_apps/main.py @@ -22,4 +22,4 @@ async def bkapp_page2(request: Request): pn.serve({'/app': createApp, '/app2': createApp2}, port=5000, allow_websocket_origin=["127.0.0.1:8000"], - address="127.0.0.1", show=False) \ No newline at end of file + address="127.0.0.1", show=False) diff --git a/examples/apps/fastApi_multi_apps/sliders/pn_app.py b/examples/apps/fastApi_multi_apps/sliders/pn_app.py index fbc742c881..18fbed6535 100644 --- a/examples/apps/fastApi_multi_apps/sliders/pn_app.py +++ b/examples/apps/fastApi_multi_apps/sliders/pn_app.py @@ -4,4 +4,4 @@ def createApp(): sw = SineWave() - return pn.Row(sw.param, sw.plot).servable() \ No newline at end of file + return pn.Row(sw.param, sw.plot).servable() diff --git a/examples/apps/fastApi_multi_apps/sliders/sinewave.py b/examples/apps/fastApi_multi_apps/sliders/sinewave.py index 984e5b7b97..7149bedc9e 100644 --- a/examples/apps/fastApi_multi_apps/sliders/sinewave.py +++ b/examples/apps/fastApi_multi_apps/sliders/sinewave.py @@ -32,4 +32,4 @@ def update_plot(self): def sine(self): x = np.linspace(0, 4 * np.pi, self.N) y = self.amplitude * np.sin(self.frequency * x + self.phase) + self.offset - return x, y \ No newline at end of file + return x, y diff --git a/examples/apps/fastApi_multi_apps/sliders2/pn_app.py b/examples/apps/fastApi_multi_apps/sliders2/pn_app.py index 6c9a9339db..ef066c4609 100644 --- a/examples/apps/fastApi_multi_apps/sliders2/pn_app.py +++ b/examples/apps/fastApi_multi_apps/sliders2/pn_app.py @@ -4,4 +4,4 @@ def createApp2(): sw = SineWave() - return pn.Row(sw.param, sw.plot).servable() \ No newline at end of file + return pn.Row(sw.param, sw.plot).servable() diff --git a/examples/apps/fastApi_multi_apps/sliders2/sinewave.py b/examples/apps/fastApi_multi_apps/sliders2/sinewave.py index 984e5b7b97..7149bedc9e 100644 --- a/examples/apps/fastApi_multi_apps/sliders2/sinewave.py +++ b/examples/apps/fastApi_multi_apps/sliders2/sinewave.py @@ -32,4 +32,4 @@ def update_plot(self): def sine(self): x = np.linspace(0, 4 * np.pi, self.N) y = self.amplitude * np.sin(self.frequency * x + self.phase) + self.offset - return x, y \ No newline at end of file + return x, y diff --git a/examples/apps/fastApi_multi_apps/templates/app2.html b/examples/apps/fastApi_multi_apps/templates/app2.html index f464353e5d..00d444d7dd 100644 --- a/examples/apps/fastApi_multi_apps/templates/app2.html +++ b/examples/apps/fastApi_multi_apps/templates/app2.html @@ -7,4 +7,4 @@

App2

{{ script|safe }} - \ No newline at end of file + diff --git a/examples/apps/fastApi_multi_apps/templates/base.html b/examples/apps/fastApi_multi_apps/templates/base.html index eb273c6bbd..1640fd8ae4 100644 --- a/examples/apps/fastApi_multi_apps/templates/base.html +++ b/examples/apps/fastApi_multi_apps/templates/base.html @@ -7,4 +7,4 @@

App1

{{ script|safe }} - \ No newline at end of file + diff --git a/examples/reference/templates/GoldenLayout.ipynb b/examples/reference/templates/GoldenLayout.ipynb index 764ece7eb4..f13ffef440 100644 --- a/examples/reference/templates/GoldenLayout.ipynb +++ b/examples/reference/templates/GoldenLayout.ipynb @@ -137,4 +137,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/examples/user_guide/sample_template.html b/examples/user_guide/sample_template.html index acda452a76..34130039b7 100644 --- a/examples/user_guide/sample_template.html +++ b/examples/user_guide/sample_template.html @@ -18,4 +18,4 @@

Custom Template App

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/panel/compiler.py b/panel/compiler.py index 2a0f2e154b..a87a759941 100644 --- a/panel/compiler.py +++ b/panel/compiler.py @@ -141,7 +141,7 @@ def write_bundled_tarball(name, tarball, bundle_dir, module=False): f.write(content) tar_obj.close() - + def bundle_resources(): from .config import panel_extension from .reactive import ReactiveHTML diff --git a/panel/config.py b/panel/config.py index fe23f86f0e..42d12e9a81 100644 --- a/panel/config.py +++ b/panel/config.py @@ -72,10 +72,10 @@ class _base_config(param.Parameterized): class _config(_base_config): """ Holds global configuration options for Panel. - + The options can be set directly on the global config instance, via keyword arguments in the extension or via environment variables. - + For example to set the embed option the following approaches can be used: pn.config.embed = True @@ -370,7 +370,7 @@ def log_level(self): @property def nthreads(self): nthreads = os.environ.get('PANEL_NUM_THREADS', self._nthreads) - return None if nthreads is None else int(nthreads) + return None if nthreads is None else int(nthreads) @property def oauth_provider(self): @@ -443,8 +443,8 @@ class panel_extension(_pyviz_extension): >>> import panel as pn >>> pn.extension("plotly", sizing_mode="stretch_width", template="fast") - - This will + + This will - Initialize the `pyviz` notebook extension. - Enable you to use the `Plotly` pane by loading `plotly.js`. diff --git a/panel/depends.py b/panel/depends.py index 03c82db1ec..0ae05c2a74 100644 --- a/panel/depends.py +++ b/panel/depends.py @@ -34,9 +34,9 @@ def depends(*args, **kwargs): Parameter values. This means that the "reactive" function can (or will if `watch=True`) be automatically invoked whenever the underlying parameter values change. - + See also `pn.bind`. - + Reference: https://panel.holoviz.org/user_guide/APIs.html#reactive-functions :Example: @@ -51,7 +51,7 @@ def depends(*args, **kwargs): decorator, but extended so that if widgets are provided as dependencies, the underlying `value` Parameter of the widget is extracted as the actual dependency. - + This extension is solely for syntactic convenience, allowing the widget to be passed in as a synonym for the underlying parameter. Apart from that extension, this decorator otherwise behaves the same as the underlying @@ -77,7 +77,7 @@ def bind(function, *args, watch=False, **kwargs): Parameter values. This means that the "reactive" function can (or will if `watch=True`) be automatically invoked whenever the underlying parameter values change. - + Reference: https://panel.holoviz.org/user_guide/APIs.html#reactive-functions :Example: diff --git a/panel/dist/css/alerts.css b/panel/dist/css/alerts.css index db1cfbbdde..97ffc1a72e 100644 --- a/panel/dist/css/alerts.css +++ b/panel/dist/css/alerts.css @@ -133,4 +133,4 @@ .bk.alert-dark a { color: #040505; -} \ No newline at end of file +} diff --git a/panel/dist/css/debugger.css b/panel/dist/css/debugger.css index 3d2f38f9df..e664cecb95 100644 --- a/panel/dist/css/debugger.css +++ b/panel/dist/css/debugger.css @@ -45,7 +45,7 @@ text-align: center; border-radius: 6px; padding: 5px 0; - + /* Position the tooltip */ position: relative; z-index: 1; @@ -62,4 +62,4 @@ .bk button.clear_btn:hover .shown { display: none;} -.bk button.clear_btn:hover:before { content: "☑"; } \ No newline at end of file +.bk button.clear_btn:hover:before { content: "☑"; } diff --git a/panel/io/datamodel.py b/panel/io/datamodel.py index 66f5c34bbc..f916ce65c9 100644 --- a/panel/io/datamodel.py +++ b/panel/io/datamodel.py @@ -210,4 +210,3 @@ def cb_param(*events): obj.param.watch(cb_param, list(set(properties) & set(obj.param))) return model - diff --git a/panel/io/django.py b/panel/io/django.py index 66979410a1..b07cd75caf 100644 --- a/panel/io/django.py +++ b/panel/io/django.py @@ -1,5 +1,5 @@ from contextlib import contextmanager -from urllib.parse import urlparse, urljoin +from urllib.parse import urlparse, urljoin from bokeh.server.django.consumers import DocConsumer, AutoloadJsConsumer @@ -7,7 +7,7 @@ from .resources import Resources from .state import state from .server import ( - autoload_js_script, server_html_page_for_session, + autoload_js_script, server_html_page_for_session, ) async def doc_handle(self, body): @@ -45,7 +45,7 @@ def _session_prefix(consumer): with edit_readonly(state): state.base_url = old_url state.rel_path = old_rel - + async def autoload_handle(self, body): with _session_prefix(self): diff --git a/panel/io/ipywidget.py b/panel/io/ipywidget.py index 4623b9a4db..e9834f31bf 100644 --- a/panel/io/ipywidget.py +++ b/panel/io/ipywidget.py @@ -20,7 +20,7 @@ class MessageSentEventPatched(MessageSentEvent): """ Patches MessageSentEvent with fix that ensures MessageSent event does not define msg_data (which is an assumption in BokehJS - Document.apply_json_patch.) + Document.apply_json_patch.) """ def generate(self, references, buffers): diff --git a/panel/io/loading.py b/panel/io/loading.py index f38e8dcaa7..aae6c15dbb 100644 --- a/panel/io/loading.py +++ b/panel/io/loading.py @@ -58,4 +58,3 @@ def stop_loading_spinner(*objects): for item in objects: if hasattr(item, "css_classes"): _remove_css_classes(item, css_classes) - diff --git a/panel/io/profile.py b/panel/io/profile.py index dfc2d62dfe..2c19a4c093 100644 --- a/panel/io/profile.py +++ b/panel/io/profile.py @@ -113,7 +113,7 @@ def profile_ctx(engine='pyinstrument'): Arguments --------- engine: str - The profiling engine, e.g. 'pyinstrument' or 'snakeviz' + The profiling engine, e.g. 'pyinstrument' or 'snakeviz' Returns ------- @@ -152,7 +152,7 @@ def profile(name, engine='pyinstrument'): name: str A unique name for the profiling session. engine: str - The profiling engine, e.g. 'pyinstrument' or 'snakeviz' + The profiling engine, e.g. 'pyinstrument' or 'snakeviz' """ if not isinstance(name, str): raise ValueError("Profiler must be given a name.") diff --git a/panel/io/resources.py b/panel/io/resources.py index 31d72cf600..8619e1d87a 100644 --- a/panel/io/resources.py +++ b/panel/io/resources.py @@ -317,8 +317,8 @@ def js_modules(self): from ..config import config modules = list(config.js_modules.values()) self.extra_resources(modules, '__javascript_modules__') - - + + return modules @property diff --git a/panel/io/save.py b/panel/io/save.py index 4d8f53311a..6b56bba3d2 100644 --- a/panel/io/save.py +++ b/panel/io/save.py @@ -225,7 +225,7 @@ def save( doc = panel else: doc = Document() - + if resources is None: resources = CDN mode = 'cdn' diff --git a/panel/layout/accordion.py b/panel/layout/accordion.py index b43a343193..7cd9c60b09 100644 --- a/panel/layout/accordion.py +++ b/panel/layout/accordion.py @@ -10,10 +10,10 @@ class Accordion(NamedListPanel): """ The `Accordion` layout is a type of `Card` layout that allows switching between multiple objects by clicking on the corresponding card header. - + The labels for each card will default to the `name` parameter of the card’s contents, but may also be defined explicitly as part of a tuple. - + Like `Column` and `Row`, `Accordion` has a list-like API that allows interactively updating and modifying the cards using the methods `append`, `extend`, `clear`, `insert`, `pop`, `remove` and `__setitem__`. @@ -24,7 +24,7 @@ class Accordion(NamedListPanel): >>> pn.Accordion(some_pane_with_a_name, ("Plot", some_plot)) """ - + active_header_background = param.String(default='#ccc', doc=""" Color for currently active headers.""") @@ -41,7 +41,7 @@ class Accordion(NamedListPanel): Whether to toggle between active cards or allow multiple cards""") _bokeh_model = BkColumn - + _rename = {'active': None, 'active_header_background': None, 'header_background': None, 'objects': 'children', 'dynamic': None, 'toggle': None, 'header_color': None} @@ -150,7 +150,7 @@ def _set_active(self, *events): continue elif not self._panels[id(pane)].collapsed: active.append(i) - + if not self.toggle or active: self.active = active finally: diff --git a/panel/layout/base.py b/panel/layout/base.py index ad534ba812..d9db674065 100644 --- a/panel/layout/base.py +++ b/panel/layout/base.py @@ -139,7 +139,7 @@ def _get_model( parent: Optional['Model'] = None, comm: Optional[Comm] = None ) -> 'Model': if self._bokeh_model is None: - raise ValueError(f'{type(self).__name__} did not define a _bokeh_model.') + raise ValueError(f'{type(self).__name__} did not define a _bokeh_model.') model = self._bokeh_model() if root is None: root = model @@ -688,11 +688,11 @@ class Row(ListPanel): """ The `Row` layout allows arranging multiple panel objects in a horizontal container. - + It has a list-like API with methods to `append`, `extend`, `clear`, `insert`, `pop`, `remove` and `__setitem__`, which makes it possible to interactively update and modify the layout. - + Reference: https://panel.holoviz.org/reference/layouts/Row.html :Example: @@ -711,11 +711,11 @@ class Column(ListPanel): """ The `Column` layout allows arranging multiple panel objects in a vertical container. - + It has a list-like API with methods to `append`, `extend`, `clear`, `insert`, `pop`, `remove` and `__setitem__`, which makes it possible to interactively update and modify the layout. - + Reference: https://panel.holoviz.org/reference/layouts/Column.html :Example: @@ -737,11 +737,11 @@ class WidgetBox(ListPanel): It is largely identical to the `Column` layout, but has some default styling that makes widgets be clearly grouped together visually. - + It has a list-like API with methods to `append`, `extend`, `clear`, `insert`, `pop`, `remove` and `__setitem__`, which make it possible to interactively update and modify the layout. - + Reference: https://panel.holoviz.org/reference/layouts/WidgetBox.html :Example: diff --git a/panel/layout/card.py b/panel/layout/card.py index 4a65c12cd9..624e524a2b 100644 --- a/panel/layout/card.py +++ b/panel/layout/card.py @@ -8,7 +8,7 @@ class Card(Column): """ A `Card` layout allows arranging multiple panel objects in a collapsible, vertical container with a header bar. - + Reference: https://panel.holoviz.org/reference/layouts/Card.html :Example: @@ -60,7 +60,7 @@ class Card(Column): by the header if defined.""") _bokeh_model = BkCard - + _linked_props = ['collapsed'] _rename = dict(Column._rename, title=None, header=None, title_css_classes=None) diff --git a/panel/layout/flex.py b/panel/layout/flex.py index 75755385f7..8cbd9f69f9 100644 --- a/panel/layout/flex.py +++ b/panel/layout/flex.py @@ -9,19 +9,19 @@ class FlexBox(ListLike, ReactiveHTML): """ The `FlexBox` is a list-like layout (unlike `GridSpec`) that wraps objects - into a CSS flex container. - + into a CSS flex container. + It has a list-like API with methods to `append`, `extend`, `clear`, `insert`, `pop`, `remove` and `__setitem__`, which makes it possible to interactively update and modify the layout. It exposes all the CSS options for controlling the behavior and layout of the flex box. - + Reference: https://panel.holoviz.org/reference/layouts/FlexBox.html :Example: >>> pn.FlexBox( - ... some_python_object, another_python_object, ..., + ... some_python_object, another_python_object, ..., ... the_last_python_object ... ) """ diff --git a/panel/layout/grid.py b/panel/layout/grid.py index deb456bdce..f18d0412f4 100644 --- a/panel/layout/grid.py +++ b/panel/layout/grid.py @@ -20,17 +20,17 @@ class GridBox(ListPanel): """ The `GridBox` is a list-like layout (unlike `GridSpec`) that wraps objects into a grid according to the specified `nrows` and `ncols` parameters. - + It has a list-like API with methods to `append`, `extend`, `clear`, `insert`, `pop`, `remove` and `__setitem__`, which makes it possible to - interactively update and modify the layout. - + interactively update and modify the layout. + Reference: https://panel.holoviz.org/reference/layouts/GridBox.html :Example: - + >>> pn.GridBox( - ... python_object_1, python_object_2, ..., + ... python_object_1, python_object_2, ..., ... python_object_24, ncols=6 ... ) """ diff --git a/panel/layout/gridstack.py b/panel/layout/gridstack.py index c2c9daaef9..cec350a08e 100644 --- a/panel/layout/gridstack.py +++ b/panel/layout/gridstack.py @@ -13,15 +13,15 @@ class GridStack(ReactiveHTML, GridSpec): The `GridStack` layout allows arranging multiple Panel objects in a grid using a simple API to assign objects to individual grid cells or to a grid span. - + Other layout containers function like lists, but a `GridSpec` has an API similar to a 2D array, making it possible to use 2D assignment to populate, index, and slice the grid. - + Reference: https://panel.holoviz.org/reference/layouts/GridStack.html :Example: - + >>> pn.extension('gridstack') >>> gstack = GridStack(sizing_mode='stretch_both') >>> gstack[ : , 0: 3] = pn.Spacer(background='red', margin=0) diff --git a/panel/layout/spacer.py b/panel/layout/spacer.py index 172aff9358..bc24a0ca76 100644 --- a/panel/layout/spacer.py +++ b/panel/layout/spacer.py @@ -1,5 +1,5 @@ """ -Spacer components to add horizontal or vertical space to a layout. +Spacer components to add horizontal or vertical space to a layout. """ import param @@ -12,15 +12,15 @@ class Spacer(Reactive): """ The `Spacer` layout is a very versatile component which makes it easy to - put fixed or responsive spacing between objects. - + put fixed or responsive spacing between objects. + Like all other components spacers support both absolute and responsive sizing modes. - + Reference: https://panel.holoviz.org/user_guide/Customization.html#spacers :Example: - + >>> pn.Row( ... 1, pn.Spacer(width=200), ... 2, pn.Spacer(width=100), @@ -41,15 +41,15 @@ def _get_model(self, doc, root=None, parent=None, comm=None): class VSpacer(Spacer): """ - The `VSpacer` layout provides responsive vertical spacing. - + The `VSpacer` layout provides responsive vertical spacing. + Using this component we can space objects equidistantly in a layout and allow the empty space to shrink when the browser is resized. - + Reference: https://panel.holoviz.org/user_guide/Customization.html#spacers :Example: - + >>> pn.Column( ... pn.layout.VSpacer(), 'Item 1', ... pn.layout.VSpacer(), 'Item 2', @@ -62,15 +62,15 @@ class VSpacer(Spacer): class HSpacer(Spacer): """ - The `HSpacer` layout provides responsive vertical spacing. - + The `HSpacer` layout provides responsive vertical spacing. + Using this component we can space objects equidistantly in a layout and allow the empty space to shrink when the browser is resized. - + Reference: https://panel.holoviz.org/user_guide/Customization.html#spacers :Example: - + >>> pn.Row( ... pn.layout.HSpacer(), 'Item 1', ... pn.layout.HSpacer(), 'Item 2', @@ -86,11 +86,11 @@ class Divider(Reactive): A `Divider` draws a horizontal rule (a `
` tag in HTML) to separate multiple components in a layout. It automatically spans the full width of the container. - + Reference: https://panel.holoviz.org/reference/layouts/Divider.html :Example: - + >>> pn.Column( ... '# Lorem Ipsum', ... pn.layout.Divider(), diff --git a/panel/layout/tabs.py b/panel/layout/tabs.py index c40105678c..1fc79c41ba 100644 --- a/panel/layout/tabs.py +++ b/panel/layout/tabs.py @@ -18,18 +18,18 @@ class Tabs(NamedListPanel): """ The `Tabs` layout allows switching between multiple objects by clicking on the corresponding tab header. - + Tab labels may be defined explicitly as part of a tuple or will be inferred from the `name` parameter of the tab’s contents. - + Like `Column` and `Row`, `Tabs` has a list-like API with methods to `append`, `extend`, `clear`, `insert`, `pop`, `remove` and `__setitem__`, which make it possible to interactively update and modify the tabs. - + Reference: https://panel.holoviz.org/reference/layouts/Tabs.html :Example: - + >>> pn.Tabs(('Scatter', plot1), some_pane_with_a_name) """ diff --git a/panel/models/ace.ts b/panel/models/ace.ts index 1253d5b749..34063bfefb 100644 --- a/panel/models/ace.ts +++ b/panel/models/ace.ts @@ -115,7 +115,7 @@ export namespace AcePlot { filename: p.Property theme: p.Property annotations: p.Property - print_margin: p.Property + print_margin: p.Property readonly: p.Property } } diff --git a/panel/models/deckgl.ts b/panel/models/deckgl.ts index cc20a63ec6..e06c27336f 100644 --- a/panel/models/deckgl.ts +++ b/panel/models/deckgl.ts @@ -239,7 +239,7 @@ export class DeckGLPlot extends HTMLBox { static __module__ = "panel.models.deckgl" static init_DeckGLPlot(): void { - this.prototype.default_view = DeckGLPlotView; + this.prototype.default_view = DeckGLPlotView; this.define(({Any, Array, String, Ref}) => ({ data: [ Any ], diff --git a/panel/models/event-to-object.ts b/panel/models/event-to-object.ts index 8fceb42eaf..58267c62ae 100644 --- a/panel/models/event-to-object.ts +++ b/panel/models/event-to-object.ts @@ -1,4 +1,4 @@ -/* +/* The MIT License (MIT) Copyright (c) 2019 Ryan S. Morshead diff --git a/panel/models/file_download.ts b/panel/models/file_download.ts index 885fae8dd6..ab0abb0d5d 100644 --- a/panel/models/file_download.ts +++ b/panel/models/file_download.ts @@ -31,7 +31,7 @@ export class FileDownloadView extends InputWidgetView { anchor_el: HTMLAnchorElement _downloadable: boolean = false _click_listener: any - _embed: boolean = false + _embed: boolean = false _prev_href: string | null = "" _prev_download: string | null = "" @@ -128,7 +128,7 @@ export class FileDownloadView extends InputWidgetView { } this._make_link_downloadable() - + if ( !this._embed && this.model.auto ) { // Temporarily removing the event listener to emulate a click // event on the anchor link which will trigger a download. @@ -197,7 +197,7 @@ export namespace FileDownload { export type Attrs = p.AttrsOf export type Props = InputWidget.Props & { - auto: p.Property + auto: p.Property button_type: p.Property clicks: p.Property data: p.Property diff --git a/panel/models/json.ts b/panel/models/json.ts index 4499c45904..3f8380c73b 100644 --- a/panel/models/json.ts +++ b/panel/models/json.ts @@ -42,7 +42,7 @@ export namespace JSON { export type Attrs = p.AttrsOf export type Props = Markup.Props & { depth: p.Property - hover_preview: p.Property + hover_preview: p.Property theme: p.Property } } diff --git a/panel/models/json_editor.ts b/panel/models/json_editor.ts index 3001b7493d..50cebb9100 100644 --- a/panel/models/json_editor.ts +++ b/panel/models/json_editor.ts @@ -47,7 +47,7 @@ export class JSONEditorView extends PanelHTMLBoxView { super.remove() this.editor.destroy() } - + render(): void { super.render(); const mode = this.model.disabled ? 'view': this.model.mode; @@ -76,7 +76,7 @@ export namespace JSONEditor { mode: p.Property search: p.Property selection: p.Property - schema: p.Property + schema: p.Property templates: p.Property } } diff --git a/panel/models/location.ts b/panel/models/location.ts index 0f4ee71a81..40b9f2ba81 100644 --- a/panel/models/location.ts +++ b/panel/models/location.ts @@ -37,7 +37,7 @@ export class LocationView extends View { remove(): void { super.remove() window.removeEventListener('hashchange', this._hash_listener) - } + } update(change: string): void { if (!this.model.reload || (change === 'reload')) { diff --git a/panel/models/perspective.ts b/panel/models/perspective.ts index 4ba90ae2ea..f2d9809aa3 100644 --- a/panel/models/perspective.ts +++ b/panel/models/perspective.ts @@ -1,7 +1,7 @@ import {HTMLBox} from "@bokehjs/models/layouts/html_box" import {div} from "@bokehjs/core/dom" import * as p from "@bokehjs/core/properties" -import {DocumentEvent} from "@bokehjs/document/events" +import {DocumentEvent} from "@bokehjs/document/events" import {ColumnDataSource} from "@bokehjs/models/sources/column_data_source" import {PanelHTMLBoxView, set_size} from "./layout" diff --git a/panel/models/plotly.py b/panel/models/plotly.py index f6c17c2ae1..8a964befbf 100644 --- a/panel/models/plotly.py +++ b/panel/models/plotly.py @@ -39,7 +39,7 @@ def __js_skip__(cls): data = List(Any) layout = Dict(String, Any) - + frames = List(Any) config = Dict(String, Any) diff --git a/panel/models/plotly.ts b/panel/models/plotly.ts index f5b678d12c..6ddb315aa9 100644 --- a/panel/models/plotly.ts +++ b/panel/models/plotly.ts @@ -404,7 +404,7 @@ export namespace PlotlyPlot { viewport: p.Property viewport_update_policy: p.Property viewport_update_throttle: p.Property - visibility: p.Property + visibility: p.Property _render_count: p.Property } } diff --git a/panel/models/progress.ts b/panel/models/progress.ts index 1c32a8e3ca..d193b90de8 100644 --- a/panel/models/progress.ts +++ b/panel/models/progress.ts @@ -62,7 +62,7 @@ export class ProgressView extends HTMLBoxView { if (this.model.max != null) this.progressEl.max = this.model.max } - + _update_layout(): void { let changed = ((this._prev_sizing_mode !== undefined) && (this._prev_sizing_mode !== this.model.sizing_mode)) diff --git a/panel/models/quill.py b/panel/models/quill.py index be27e93213..df29ad479b 100644 --- a/panel/models/quill.py +++ b/panel/models/quill.py @@ -14,7 +14,7 @@ class QuillInput(HTMLBox): 'https://cdn.quilljs.com/1.3.6/quill.bubble.css', 'https://cdn.quilljs.com/1.3.6/quill.snow.css' ] - + __javascript_raw__ = [ 'https://cdn.quilljs.com/1.3.6/quill.js', ] diff --git a/panel/models/quill.ts b/panel/models/quill.ts index ec8dbead53..f14721b8e7 100644 --- a/panel/models/quill.ts +++ b/panel/models/quill.ts @@ -104,7 +104,7 @@ export class QuillInput extends HTMLBox { } static __module__ = "panel.models.quill" - + static init_QuillInput(): void { this.prototype.default_view = QuillInputView diff --git a/panel/models/reactive_html.py b/panel/models/reactive_html.py index a2641ac3a8..72acc7eea6 100644 --- a/panel/models/reactive_html.py +++ b/panel/models/reactive_html.py @@ -11,10 +11,10 @@ from bokeh.events import ModelEvent -endfor = '{% endfor %}' -list_iter_re = r'{% for (\s*[A-Za-z_]\w*\s*) in (\s*[A-Za-z_]\w*\s*) %}' -items_iter_re = r'{% for \s*[A-Za-z_]\w*\s*, (\s*[A-Za-z_]\w*\s*) in (\s*[A-Za-z_]\w*\s*)\.items\(\) %}' -values_iter_re = r'{% for (\s*[A-Za-z_]\w*\s*) in (\s*[A-Za-z_]\w*\s*)\.values\(\) %}' +endfor = '{%-? endfor -?%}' +list_iter_re = r'{%-? for (\s*[A-Za-z_]\w*\s*) in (\s*[A-Za-z_]\w*\s*) -?%}' +items_iter_re = r'{%-? for \s*[A-Za-z_]\w*\s*, (\s*[A-Za-z_]\w*\s*) in (\s*[A-Za-z_]\w*\s*)\.items\(\) -?%}' +values_iter_re = r'{%-? for (\s*[A-Za-z_]\w*\s*) in (\s*[A-Za-z_]\w*\s*)\.values\(\) -?%}' class ReactiveHTMLParser(HTMLParser): @@ -106,6 +106,7 @@ def handle_data(self, data): values_loop = re.findall(values_iter_re, data) items_loop = re.findall(items_iter_re, data) nloops = len(list_loop) + len(values_loop) + len(items_loop) + print(list_loop) if nloops > 1 and nloops and self._open_for: raise ValueError('Nested for loops currently not supported in templates.') elif nloops: @@ -117,9 +118,11 @@ def handle_data(self, data): f'template section:\n\n{data}') self.loop_map[var] = obj - if '{% for ' in data: + open_for = re.search(r'{%-? for', data) + end_for = re.search(endfor, data) + if open_for: self._open_for = True - if endfor in data and (not nloops or data.index(endfor) > data.index('{% for ')): + if end_for and (not nloops or end_for.start() > open_for.start()): self._open_for = False if not (self._current_node and matches): diff --git a/panel/models/tabulator.py b/panel/models/tabulator.py index beaa439a19..fa276a5d91 100644 --- a/panel/models/tabulator.py +++ b/panel/models/tabulator.py @@ -178,4 +178,3 @@ def __js_skip__(cls): 'moment': 'moment' } } - diff --git a/panel/models/tabulator.ts b/panel/models/tabulator.ts index 701771394a..1b1447d7db 100644 --- a/panel/models/tabulator.ts +++ b/panel/models/tabulator.ts @@ -277,7 +277,7 @@ export class DataTabulatorView extends PanelHTMLBoxView { const inds = this.model.source.selected.indices this.updateOrAddData(); this.tabulator.rowManager.element.scrollTop = this._lastVerticalScrollbarTopPosition; - // Restore indices since updating data may have reset checkbox column + // Restore indices since updating data may have reset checkbox column this.model.source.selected.indices = inds; }) this.connect(this.model.source.selected.change, () => this.setSelection()) diff --git a/panel/models/terminal.ts b/panel/models/terminal.ts index dff96fceb8..5a2ba555f8 100644 --- a/panel/models/terminal.ts +++ b/panel/models/terminal.ts @@ -123,8 +123,8 @@ export namespace Terminal { export type Props = HTMLBox.Props & { options: p.Property output: p.Property - ncols: p.Property - nrows: p.Property + ncols: p.Property + nrows: p.Property _clears: p.Property } } diff --git a/panel/models/text_to_speech.ts b/panel/models/text_to_speech.ts index 9f979235a6..971e10b75d 100644 --- a/panel/models/text_to_speech.ts +++ b/panel/models/text_to_speech.ts @@ -53,7 +53,7 @@ export class TextToSpeechView extends HTMLBoxView { speechSynthesis.onvoiceschanged = populateVoiceList } - + remove(): void { if (this._callback != null) clearInterval(this._callback) diff --git a/panel/models/trend.ts b/panel/models/trend.ts index e3c0235212..48899bc671 100644 --- a/panel/models/trend.ts +++ b/panel/models/trend.ts @@ -45,7 +45,7 @@ export class TrendIndicatorView extends HTMLBoxView { } connect_signals(): void { - super.connect_signals() + super.connect_signals() const {pos_color, neg_color} = this.model.properties this.on_change([pos_color, neg_color], () => this.updateValueChange()) @@ -238,7 +238,7 @@ export class TrendIndicator extends HTMLBox { properties: TrendIndicator.Props constructor(attrs?: Partial) { - super(attrs) + super(attrs) } static __module__ = "panel.models.trend" diff --git a/panel/models/vtk/index.ts b/panel/models/vtk/index.ts index 8f1f645751..7164c9c403 100644 --- a/panel/models/vtk/index.ts +++ b/panel/models/vtk/index.ts @@ -1,4 +1,4 @@ export {VTKJSPlot} from "./vtkjs" export {VTKVolumePlot} from "./vtkvolume" export {VTKAxes} from "./vtkaxes" -export {VTKSynchronizedPlot} from "./vtksynchronized" \ No newline at end of file +export {VTKSynchronizedPlot} from "./vtksynchronized" diff --git a/panel/pane/base.py b/panel/pane/base.py index 9eb8e35209..6d30ebb232 100644 --- a/panel/pane/base.py +++ b/panel/pane/base.py @@ -92,10 +92,10 @@ class PaneBase(Reactive): """ PaneBase is the abstract baseclass for all atomic displayable units in the panel library. We call any child class of `PaneBase` a `Pane`. - + Panes defines an extensible interface for wrapping arbitrary objects and transforming them into Bokeh models. - + Panes are reactive in the sense that when the object they are wrapping is changed any dashboard containing the pane will update in response. @@ -253,7 +253,7 @@ def applies(cls, obj: Any) -> float | bool | None: """ Returns boolean or float indicating whether the Pane can render the object. - + If the priority of the pane is set to `None`, this method may also be used to define a float priority depending on the object being rendered. diff --git a/panel/pane/equation.py b/panel/pane/equation.py index bee12a5e02..b39b3ec5d4 100644 --- a/panel/pane/equation.py +++ b/panel/pane/equation.py @@ -24,8 +24,8 @@ def is_sympy_expr(obj): class LaTeX(DivPaneBase): """ The `LaTeX` pane allows rendering LaTeX equations. It uses either - `MathJax` or `KaTeX` depending on the defined renderer. - + `MathJax` or `KaTeX` depending on the defined renderer. + By default it will use the renderer loaded in the extension (e.g. `pn.extension('katex')`), defaulting to `KaTeX`. @@ -35,7 +35,7 @@ class LaTeX(DivPaneBase): >>> pn.extension('katex') >>> LaTeX( - ... 'The LaTeX pane supports two delimiters: $LaTeX$ and \(LaTeX\)', + ... 'The LaTeX pane supports two delimiters: $LaTeX$ and \(LaTeX\)', ... style={'font-size': '18pt'}, width=800 ... ) """ diff --git a/panel/pane/holoviews.py b/panel/pane/holoviews.py index 4be56e275d..ce5c60b470 100644 --- a/panel/pane/holoviews.py +++ b/panel/pane/holoviews.py @@ -29,7 +29,7 @@ class HoloViews(PaneBase): To be able to use the `plotly` backend you must add `plotly` to `pn.extension`. - + Reference: https://panel.holoviz.org/reference/panes/HoloViews.html :Example: @@ -394,7 +394,7 @@ def widgets_from_dimensions(cls, object, widget_types=None, widgets_type='indivi return [], {} nframes = 1 - values = dict() if dynamic else dict(zip(dims, zip(*keys))) + values = {} if dynamic else dict(zip(dims, zip(*keys))) dim_values = OrderedDict() widgets = [] dims = [d for d in dims if values.get(d) is not None or @@ -697,7 +697,7 @@ def link_axes(root_view, root_model): if 'y_range' in changed: sp.handles['y_range'] = p.handles['y_range'] callback.reset() - callback.initialize(plot_id=p.id) + callback.initialize(plot_id=p.id) Viewable._preprocessing_hooks.append(link_axes) diff --git a/panel/pane/idom.py b/panel/pane/idom.py index 227b7127ed..0d131e35c2 100644 --- a/panel/pane/idom.py +++ b/panel/pane/idom.py @@ -37,13 +37,13 @@ class IDOM(PaneBase): """ The `IDOM` pane renders any IDOM component both in the notebook and in a deployed server. - + IDOM defines an API for defining and controlling interactive HTML components directly from Python. - + Note that in the notebook the IDOM support for loading external modules relies on Panel’s Jupyter serverextension. - + Reference: https://panel.holoviz.org/reference/panes/IDOM.html :Example: diff --git a/panel/pane/image.py b/panel/pane/image.py index 85cc97ee62..4cd6634003 100644 --- a/panel/pane/image.py +++ b/panel/pane/image.py @@ -169,7 +169,7 @@ class PNG(ImageBase): """ The `PNG` pane embeds a .png image file in a panel if provided a local path, or will link to a remote image if provided a URL. - + Reference: https://panel.holoviz.org/reference/panes/PNG.html :Example: @@ -195,7 +195,7 @@ class GIF(ImageBase): """ The `GIF` pane embeds a .gif image file in a panel if provided a local path, or will link to a remote image if provided a URL. - + Reference: https://panel.holoviz.org/reference/panes/GIF.html :Example: @@ -221,7 +221,7 @@ class ICO(ImageBase): """ The `ICO` pane embeds an .ico image file in a panel if provided a local path, or will link to a remote image if provided a URL. - + Reference: https://panel.holoviz.org/reference/panes/ICO.html :Example: @@ -247,7 +247,7 @@ class JPG(ImageBase): """ The `JPG` pane embeds a .jpg or .jpeg image file in a panel if provided a local path, or will link to a remote image if provided a URL. - + Reference: https://panel.holoviz.org/reference/panes/JPG.html :Example: @@ -285,7 +285,7 @@ class SVG(ImageBase): """ The `SVG` pane embeds a .svg image file in a panel if provided a local path, or will link to a remote image if provided a URL. - + Reference: https://panel.holoviz.org/reference/panes/SVG.html :Example: @@ -357,7 +357,7 @@ class PDF(FileBase): """ The `PDF` pane embeds a .pdf image file in a panel if provided a local path, or will link to a remote image if provided a URL. - + Reference: https://panel.holoviz.org/reference/panes/PDF.html :Example: diff --git a/panel/pane/ipywidget.py b/panel/pane/ipywidget.py index 278a8f0560..169350018f 100644 --- a/panel/pane/ipywidget.py +++ b/panel/pane/ipywidget.py @@ -13,11 +13,11 @@ class IPyWidget(PaneBase): """ The IPyWidget pane renders any ipywidgets model both in the notebook and in a deployed server. - + When rendering ipywidgets on the server you must add `ipywidgets` to `pn.extension`. You must not do this in Jupyterlab as this may render Jupyterlab unusable. - + Reference: https://panel.holoviz.org/reference/panes/IPyWidget.html :Example: @@ -43,7 +43,7 @@ def _get_ipywidget(self, obj, doc, root, comm, **kwargs): IPyWidget.__css__ = [ "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.css" ] - + if not isinstance(ipykernel.kernelbase.Kernel._instance, PanelKernel): kernel = PanelKernel(document=doc, key=str(id(doc)).encode('utf-8')) for w in obj.widgets.values(): diff --git a/panel/pane/markup.py b/panel/pane/markup.py index 157d320416..c3ab3e91af 100644 --- a/panel/pane/markup.py +++ b/panel/pane/markup.py @@ -49,10 +49,10 @@ def _update(self, ref=None, model=None): class HTML(DivPaneBase): """ `HTML` panes renders HTML strings and objects with a `_repr_html_` method. - + The `height` and `width` can optionally be specified, to allow room for whatever is being wrapped. - + Reference: https://panel.holoviz.org/reference/panes/HTML.html :Example: @@ -92,11 +92,11 @@ def _get_properties(self): class DataFrame(HTML): """ The `DataFrame` pane renders pandas, dask and streamz DataFrame types using - their custom HTML repr. - + their custom HTML repr. + In the case of a streamz DataFrame the rendered data will update periodically. - + Reference: https://panel.holoviz.org/reference/panes/DataFrame.html :Example: @@ -246,10 +246,10 @@ def _get_properties(self): class Str(DivPaneBase): """ The `Str` pane allows rendering arbitrary text and objects in a panel. - + Unlike Markdown and HTML, a `Str` is interpreted as a raw string without applying any markup and is displayed in a fixed-width font by default. - + The pane will render any text, and if given an object will display the object’s Python `repr`. @@ -285,10 +285,10 @@ def _get_properties(self): class Markdown(DivPaneBase): """ The `Markdown` pane allows rendering arbitrary markdown strings in a panel. - + It renders strings containing valid Markdown as well as objects with a `_repr_markdown_` method, and may define custom CSS styles. - + Reference: https://panel.holoviz.org/reference/panes/Markdown.html :Example: @@ -345,7 +345,7 @@ class JSON(DivPaneBase): """ The `JSON` pane allows rendering arbitrary JSON strings, dicts and other json serializable objects in a panel. - + Reference: https://panel.holoviz.org/reference/panes/JSON.html :Example: diff --git a/panel/pane/media.py b/panel/pane/media.py index 1fd3ea27c3..c8aefcfdfc 100644 --- a/panel/pane/media.py +++ b/panel/pane/media.py @@ -35,7 +35,7 @@ class _MediaBase(PaneBase): The volume of the media player.""") autoplay = param.Boolean(default=False, doc=""" - When True, it specifies that the output will play automatically. + When True, it specifies that the output will play automatically. In Chromium browsers this requires the user to click play once.""") muted = param.Boolean(default=False, doc=""" @@ -115,13 +115,13 @@ class Audio(_MediaBase): """ The `Audio` pane displays an audio player given a local or remote audio file or numpy array. - + The pane also allows access and control over the player state including toggling of playing/paused and loop state, the current time, and the volume. - + The audio player supports ogg, mp3, and wav files as well as numpy arrays. - + Reference: https://panel.holoviz.org/reference/panes/Audio.html :Example: @@ -146,7 +146,7 @@ class Audio(_MediaBase): @classmethod def applies(cls, obj): - return (super().applies(obj) or + return (super().applies(obj) or (isinstance(obj, np.ndarray) and obj.ndim==1 and obj.dtype in [np.int16, np.uint16])) @@ -154,14 +154,14 @@ class Video(_MediaBase): """ The `Video` Pane displays a video player given a local or remote video file. - + The widget also allows access and control over the player state including toggling of playing/paused and loop state, the current time, and the volume. - + Depending on the browser the video player supports mp4, webm, and ogg containers and a variety of codecs. - + Reference: https://panel.holoviz.org/reference/panes/Video.html :Example: @@ -179,4 +179,3 @@ class Video(_MediaBase): _formats = ['mp4', 'webm', 'ogg'] _media_type = 'video' - diff --git a/panel/pane/perspective.py b/panel/pane/perspective.py index f244535223..f093de55c1 100644 --- a/panel/pane/perspective.py +++ b/panel/pane/perspective.py @@ -257,7 +257,7 @@ class Perspective(PaneBase, ReactiveData): """ The `Perspective` pane provides an interactive visualization component for large, real-time datasets built on the Perspective project. - + Reference: https://panel.holoviz.org/reference/panes/Perspective.html :Example: diff --git a/panel/pane/plot.py b/panel/pane/plot.py index 06ca600ca8..c728a7cf86 100644 --- a/panel/pane/plot.py +++ b/panel/pane/plot.py @@ -49,7 +49,7 @@ class Bokeh(PaneBase): """ The Bokeh pane allows displaying any displayable Bokeh model inside a Panel app. - + Reference: https://panel.holoviz.org/reference/panes/Bokeh.html :Example: @@ -136,13 +136,13 @@ class Matplotlib(PNG, IPyWidget): """ The `Matplotlib` pane allows displaying any displayable Matplotlib figure inside a Panel app. - + - It will render the plot to PNG at the declared DPI and then embed it. - If you find the figure to be clipped on the edges, you can set `tight=True` to automatically resize objects to fit within the pane. - If you have installed `ipympl` you will also be able to use the interactive backend. - + Reference: https://panel.holoviz.org/reference/panes/Matplotlib.html :Example: diff --git a/panel/pane/plotly.py b/panel/pane/plotly.py index ff80cfca12..2a1ed1a4e9 100644 --- a/panel/pane/plotly.py +++ b/panel/pane/plotly.py @@ -16,15 +16,15 @@ class Plotly(PaneBase): """ The `Plotly` pane renders Plotly plots inside a panel. - + Note that - + - the Panel `extension` has to be loaded with `plotly` as an argument to ensure that Plotly.js is initialized. - it supports click, hover and selection events. - it optimizes the plot rendering by using binary serialization for any array data found on the Plotly object. - + Reference: https://panel.holoviz.org/reference/panes/Plotly.html :Example: diff --git a/panel/pane/streamz.py b/panel/pane/streamz.py index 398495b8e4..0a554314b0 100644 --- a/panel/pane/streamz.py +++ b/panel/pane/streamz.py @@ -13,7 +13,7 @@ class Streamz(ReplacementPane): The `Streamz` pane renders streamz `Stream` objects emitting arbitrary objects, unlike the DataFrame pane which specifically handles streamz DataFrame and Series objects and exposes various formatting objects. - + Reference: https://panel.holoviz.org/reference/panes/Streamz.html :Example: diff --git a/panel/pane/vega.py b/panel/pane/vega.py index b9fa83d888..50f7f9e03d 100644 --- a/panel/pane/vega.py +++ b/panel/pane/vega.py @@ -65,16 +65,16 @@ class Vega(PaneBase): """ The Vega pane renders Vega-lite based plots (including those from Altair) inside a panel. - + Note - + - to use the `Vega` pane, the Panel `extension` has to be loaded with 'vega' as an argument to ensure that vega.js is initialized. - it supports selection events - it optimizes the plot rendering by using binary serialization for any array data found on the Vega/Altair object, providing huge speedups over the standard JSON serialization employed by Vega natively. - + Reference: https://panel.holoviz.org/reference/panes/Vega.html :Example: @@ -127,7 +127,7 @@ def _throttle(self): for sel in self._selections } else: - throttle = {sel: self.debounce or default for sel in self._selections} + throttle = {sel: self.debounce or default for sel in self._selections} return throttle def _update_selections(self, *args): diff --git a/panel/pane/vtk/enums.py b/panel/pane/vtk/enums.py index 09339c3186..b4d91c4302 100644 --- a/panel/pane/vtk/enums.py +++ b/panel/pane/vtk/enums.py @@ -2,14 +2,14 @@ from collections import namedtuple class TextPosition(Enum): - LowerLeft = 0 - LowerRight = 1 - UpperLeft = 2 - UpperRight = 3 - LowerEdge = 4 - RightEdge = 5 - LeftEdge = 6 - UpperEdge = 7 + LowerLeft = 0 + LowerRight = 1 + UpperLeft = 2 + UpperRight = 3 + LowerEdge = 4 + RightEdge = 5 + LeftEdge = 6 + UpperEdge = 7 SCALAR_MODE = namedtuple("SCALAR_MODE", "Default UsePointData UseCellData UsePointFieldData UseCellFieldData UseFieldData" diff --git a/panel/pane/vtk/synchronizable_deserializer.py b/panel/pane/vtk/synchronizable_deserializer.py index 1cc4c443c7..6f68fa5bf2 100644 --- a/panel/pane/vtk/synchronizable_deserializer.py +++ b/panel/pane/vtk/synchronizable_deserializer.py @@ -76,7 +76,7 @@ def poly_data_builder(state, zf, register): fill_array(cell_data_arr, state['properties'][cell_type], zf) cell_arr.ImportLegacyFormat(cell_data_arr) getattr(instance, 'Set' + capitalize(cell_type))(cell_arr) - + # datasets fields = state['properties']['fields'] for dataset in fields: @@ -131,7 +131,7 @@ def generic_builder(state, zf, register=None): for array_meta in arrays: vtk_array = ARRAY_TYPES[array_meta['dataType']]() fill_array(vtk_array, array_meta, zf) - location = (instance + location = (instance if 'location' not in array_meta else getattr(instance, 'Get'+capitalize(array_meta['location']))()) getattr(location, capitalize(array_meta['registration']))(vtk_array) diff --git a/panel/pane/vtk/synchronizable_serializer.py b/panel/pane/vtk/synchronizable_serializer.py index ec0c6340f9..69e451e3ed 100644 --- a/panel/pane/vtk/synchronizable_serializer.py +++ b/panel/pane/vtk/synchronizable_serializer.py @@ -525,7 +525,7 @@ def extractRequiredFields(extractedFields, parent, dataset, context, requestedFi arrayMeta['location'] = 'pointData' arrayMeta['registration'] = 'setScalars' extractedFields.append(arrayMeta) - + if parent.IsA("vtkGlyph3DMapper") and not context.serializeAllDataArrays: scaleArrayName = parent.GetInputArrayInformation(parent.SCALE).Get(vtkDataObject.FIELD_NAME()) if scaleArrayName is not None and scaleArrayName not in [field['name'] for field in extractedFields]: @@ -573,7 +573,7 @@ def annotationSerializer(parent, prop, propId, context, depth): context.addAnnotation(parent, prop, propId) - return None + return None def genericPropSerializer(parent, prop, popId, context, depth): # This kind of actor has two "children" of interest, a property and a diff --git a/panel/pane/vtk/vtk.py b/panel/pane/vtk/vtk.py index f8388af069..f2ad20c4e6 100644 --- a/panel/pane/vtk/vtk.py +++ b/panel/pane/vtk/vtk.py @@ -146,18 +146,18 @@ class VTK: """ The VTK pane renders a VTK scene inside a panel, making it possible to interact with complex geometries in 3D. - + Reference: https://panel.holoviz.org/reference/panes/VTK.html :Example: >>> pn.extension('vtk') >>> VTK(some_vtk_object, width=500, height=500) - + This is a Class factory and allows to switch between VTKJS, VTKRenderWindow, and VTKRenderWindowSynchronized pane as a function of the object type and when the serialisation of the vtkRenderWindow occurs. - + Once a pane is returned by this class (inst = VTK(object)), one can use pn.help(inst) to see parameters available for the current pane """ @@ -516,7 +516,7 @@ class VTKVolume(AbstractVTK): """ The `VTKVolume` pane renders 3d volumetric data defined on regular grids. It may be constructed from a 3D NumPy array or a vtkVolume. - + The pane provides a number of interactive control which can be set either through callbacks from Python or Javascript callbacks. @@ -775,7 +775,7 @@ def _subsample_array(self, array): class VTKJS(AbstractVTK): """ The VTKJS pane allow rendering a vtk scene stored in a vtkjs. - + Reference: https://panel.holoviz.org/reference/panes/VTKJS.html :Example: diff --git a/panel/reactive.py b/panel/reactive.py index da1aa6a8ec..268873b98c 100644 --- a/panel/reactive.py +++ b/panel/reactive.py @@ -451,7 +451,7 @@ def link( """ Links the parameters on this `Reactive` object to attributes on the target `Parameterized` object. - + Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source @@ -613,7 +613,7 @@ def jslink( """ Links properties on the this Reactive object to those on the target Reactive object in JS code. - + Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which @@ -622,7 +622,7 @@ def jslink( Arguments ---------- - target: panel.viewable.Viewable | bokeh.model.Model | holoviews.core.dimension.Dimensioned + target: panel.viewable.Viewable | bokeh.model.Model | holoviews.core.dimension.Dimensioned The target to link the value to. code: dict Custom code which will be executed when the widget value @@ -1024,7 +1024,7 @@ class ReactiveData(SyncableData): def __init__(self, **params): super().__init__(**params) self._old = None - + def _update_selection(self, indices: List[int]) -> None: self.selection = indices diff --git a/panel/template/fast/css/fast_root.css b/panel/template/fast/css/fast_root.css index 6315cabf03..2a4d530722 100644 --- a/panel/template/fast/css/fast_root.css +++ b/panel/template/fast/css/fast_root.css @@ -38,4 +38,4 @@ h1, h2, h3, h4, h5, h6 { #menu .menu-item-active a { background: var(--accent-fill-active); color: var(--accent-foreground-cut-rest); -} \ No newline at end of file +} diff --git a/panel/template/fast/css/fast_root_default.css b/panel/template/fast/css/fast_root_default.css index 94878ea585..a26772dc52 100644 --- a/panel/template/fast/css/fast_root_default.css +++ b/panel/template/fast/css/fast_root_default.css @@ -1,4 +1,4 @@ /* fast_root_default.css */ :root { --container-background: #D1D1D1; -} \ No newline at end of file +} diff --git a/panel/template/fast/grid/dark.css b/panel/template/fast/grid/dark.css index 735a093c76..d69691d20d 100644 --- a/panel/template/fast/grid/dark.css +++ b/panel/template/fast/grid/dark.css @@ -23,4 +23,4 @@ .drag-handle { background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBmaWxsPSJub25lIiBkPSJNMCAwaDI0djI0SDB6Ii8+PHBhdGggZmlsbD0id2hpdGUiIGQ9Ik0xNiAxM2w2Ljk2NCA0LjA2Mi0yLjk3My44NSAyLjEyNSAzLjY4MS0xLjczMiAxLTIuMTI1LTMuNjgtMi4yMjMgMi4xNUwxNiAxM3ptLTItN2gydjJoNWExIDEgMCAwIDEgMSAxdjRoLTJ2LTNIMTB2MTBoNHYySDlhMSAxIDAgMCAxLTEtMXYtNUg2di0yaDJWOWExIDEgMCAwIDEgMS0xaDVWNnpNNCAxNHYySDJ2LTJoMnptMC00djJIMnYtMmgyem0wLTR2MkgyVjZoMnptMC00djJIMlYyaDJ6bTQgMHYySDZWMmgyem00IDB2MmgtMlYyaDJ6bTQgMHYyaC0yVjJoMnoiLz48L3N2Zz4='); -} \ No newline at end of file +} diff --git a/panel/template/fast/grid/fast_grid_template.css b/panel/template/fast/grid/fast_grid_template.css index aafe9c48ca..23c271f8c5 100644 --- a/panel/template/fast/grid/fast_grid_template.css +++ b/panel/template/fast/grid/fast_grid_template.css @@ -395,4 +395,4 @@ html { div.pn-wrapper { position: relative; background: var(--background-color) -} \ No newline at end of file +} diff --git a/panel/template/fast/js/fast_template.js b/panel/template/fast/js/fast_template.js index 6c6b406853..50f443fabe 100644 --- a/panel/template/fast/js/fast_template.js +++ b/panel/template/fast/js/fast_template.js @@ -110,4 +110,4 @@ document.addEventListener("fullscreenchange", function(e) { } else { button.innerHTML = '' } -}); \ No newline at end of file +}); diff --git a/panel/template/fast/list/default.css b/panel/template/fast/list/default.css index b4fa6eae04..80dd9052fc 100644 --- a/panel/template/fast/list/default.css +++ b/panel/template/fast/list/default.css @@ -1 +1 @@ -/* fast default.css */ \ No newline at end of file +/* fast default.css */ diff --git a/panel/template/golden/dark.css b/panel/template/golden/dark.css index d4dc5813c1..9dbfe987a6 100644 --- a/panel/template/golden/dark.css +++ b/panel/template/golden/dark.css @@ -24,4 +24,3 @@ .lm_header .lm_tab.lm_active { padding-bottom: 6px; } - diff --git a/panel/template/material/default.css b/panel/template/material/default.css index d5806e83b4..821258c24a 100644 --- a/panel/template/material/default.css +++ b/panel/template/material/default.css @@ -16,4 +16,4 @@ --mdc-shape-medium: 4px; --mdc-shape-large: 0px; --mdc-typography--font-family: "Roboto"; -} \ No newline at end of file +} diff --git a/panel/template/vanilla/__init__.py b/panel/template/vanilla/__init__.py index e59d8b5edf..c0b8a2baa8 100644 --- a/panel/template/vanilla/__init__.py +++ b/panel/template/vanilla/__init__.py @@ -1,5 +1,5 @@ """ -Vanilla template +Vanilla template """ import pathlib diff --git a/panel/tests/command/test_serve.py b/panel/tests/command/test_serve.py index b231bafb34..ad9af59b26 100644 --- a/panel/tests/command/test_serve.py +++ b/panel/tests/command/test_serve.py @@ -112,4 +112,3 @@ def test_autoreload_app(py_file): r2 = requests.get(f"http://localhost:{port}/{app_name}") assert r2.status_code == 200 assert "B" in r2.content.decode('utf-8') - diff --git a/panel/tests/conftest.py b/panel/tests/conftest.py index 6f292fd86a..22014d670e 100644 --- a/panel/tests/conftest.py +++ b/panel/tests/conftest.py @@ -156,7 +156,7 @@ def with_curdoc(): yield finally: state.curdoc = old_curdoc - + @contextmanager def set_env_var(env_var, value): diff --git a/panel/tests/io/bk_app.py b/panel/tests/io/bk_app.py index c24edb81dc..56db1c3859 100644 --- a/panel/tests/io/bk_app.py +++ b/panel/tests/io/bk_app.py @@ -4,4 +4,4 @@ app = curdoc() model = Div(text="

Hello Bokeh World from .py Code File

", sizing_mode="stretch_width") -app.add_root(model) \ No newline at end of file +app.add_root(model) diff --git a/panel/tests/io/panel_app.py b/panel/tests/io/panel_app.py index 1e39a4667b..5f14099fee 100644 --- a/panel/tests/io/panel_app.py +++ b/panel/tests/io/panel_app.py @@ -1,4 +1,4 @@ """Minimal Panel Hello World Example""" from panel.pane import HTML -HTML("

Hello Panel World from .py Code File

").servable() \ No newline at end of file +HTML("

Hello Panel World from .py Code File

").servable() diff --git a/panel/tests/io/test_reload.py b/panel/tests/io/test_reload.py index 76803063d4..48340e6128 100644 --- a/panel/tests/io/test_reload.py +++ b/panel/tests/io/test_reload.py @@ -7,7 +7,7 @@ ) from panel.io.state import state - + def test_record_modules_not_stdlib(): with record_modules(): import audioop # noqa diff --git a/panel/tests/layout/test_base.py b/panel/tests/layout/test_base.py index 59da8125e5..70f36b7d22 100644 --- a/panel/tests/layout/test_base.py +++ b/panel/tests/layout/test_base.py @@ -430,7 +430,7 @@ def test_layout_clone_objects_in_kwargs(panel): div2 = Div() layout = panel(div1, div2) clone = layout.clone( - objects=(div2, div1), + objects=(div2, div1), width=400, sizing_mode='stretch_height' ) diff --git a/panel/tests/layout/test_card.py b/panel/tests/layout/test_card.py index a5b3471a36..2f536c3ba7 100644 --- a/panel/tests/layout/test_card.py +++ b/panel/tests/layout/test_card.py @@ -11,7 +11,7 @@ def test_card_model_cache_cleanup(document, comm): model = l.get_root(document, comm) ref = model.ref['id'] - + assert ref in l._models assert l._models[ref] == (model, None) assert ref in html._models diff --git a/panel/tests/layout/test_grid.py b/panel/tests/layout/test_grid.py index 748f0b2f2d..075a5176bd 100644 --- a/panel/tests/layout/test_grid.py +++ b/panel/tests/layout/test_grid.py @@ -243,7 +243,7 @@ def div(value): assert row.children[0] is not div2 assert row.children[0].sizing_mode == 'stretch_width' assert row.children[0].height == 300 - + def test_gridbox_ncols(document, comm): diff --git a/panel/tests/layout/test_tabs.py b/panel/tests/layout/test_tabs.py index 5f2621905a..c8c94c266c 100644 --- a/panel/tests/layout/test_tabs.py +++ b/panel/tests/layout/test_tabs.py @@ -375,7 +375,7 @@ def test_tabs_iadd(document, comm, tabs): assert tab3.child is div4 assert tab4.child is div3 - + def test_tabs_extend_uses_object_name(document, comm, tabs): model = tabs.get_root(document, comm=comm) tab1_before, tab2_before = model.tabs diff --git a/panel/tests/pane/test_image.py b/panel/tests/pane/test_image.py index 20d446d1d5..b479a25c4f 100644 --- a/panel/tests/pane/test_image.py +++ b/panel/tests/pane/test_image.py @@ -137,7 +137,7 @@ def test_pdf_embed(document, comm): model = pdf_pane.get_root(document, comm) assert model.text.startswith("<embed src="data:application/pdf;base64,") - + def test_pdf_no_embed(document, comm): url = 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf' diff --git a/panel/tests/pane/test_perspective.py b/panel/tests/pane/test_perspective.py index f9514c28fc..3d3e31cdeb 100644 --- a/panel/tests/pane/test_perspective.py +++ b/panel/tests/pane/test_perspective.py @@ -74,4 +74,3 @@ def test_perspective_can_sort_desc(): actual = Perspective()._process_property_change(msg) # Then assert actual == msg - diff --git a/panel/tests/pane/test_plot.py b/panel/tests/pane/test_plot.py index 168009deb3..32199f7da7 100644 --- a/panel/tests/pane/test_plot.py +++ b/panel/tests/pane/test_plot.py @@ -57,5 +57,3 @@ def test_matplotlib_pane(document, comm): # Cleanup pane._cleanup(model) assert pane._models == {} - - diff --git a/panel/tests/pane/test_vega.py b/panel/tests/pane/test_vega.py index 461b267883..9b3224c2e2 100644 --- a/panel/tests/pane/test_vega.py +++ b/panel/tests/pane/test_vega.py @@ -147,7 +147,7 @@ def test_vega_pane(document, comm): assert dict(model.data, **blank_schema) == dict(expected, **blank_schema) cds_data = model.data_sources['data'].data - assert np.array_equal(cds_data['x'], np.array(['A', 'B', 'C', 'D', 'E'])) + assert np.array_equal(cds_data['x'], np.array(['A', 'B', 'C', 'D', 'E'])) assert np.array_equal(cds_data['y'], np.array([5, 3, 6, 7, 2])) point_example = dict(vega_example, mark='point') @@ -156,7 +156,7 @@ def test_vega_pane(document, comm): point_example['data'].pop('values') assert model.data == point_example cds_data = model.data_sources['data'].data - assert np.array_equal(cds_data['x'], np.array(['C', 'B', 'C', 'D', 'E'])) + assert np.array_equal(cds_data['x'], np.array(['C', 'B', 'C', 'D', 'E'])) assert np.array_equal(cds_data['y'], np.array([5, 3, 6, 7, 2])) pane._cleanup(model) @@ -186,7 +186,7 @@ def test_vega_pane_inline(document, comm): pane._cleanup(model) assert pane._models == {} - + def altair_example(): import altair as alt @@ -221,7 +221,7 @@ def test_altair_pane(document, comm): assert dict(model.data, **blank_schema) == dict(expected, **blank_schema) cds_data = model.data_sources['data'].data - assert np.array_equal(cds_data['x'], np.array(['A', 'B', 'C', 'D', 'E'])) + assert np.array_equal(cds_data['x'], np.array(['A', 'B', 'C', 'D', 'E'])) assert np.array_equal(cds_data['y'], np.array([5, 3, 6, 7, 2])) chart = altair_example() @@ -233,7 +233,7 @@ def test_altair_pane(document, comm): point_example['config'] = vega4_config assert dict(model.data, **blank_schema) == dict(point_example, **blank_schema) cds_data = model.data_sources['data'].data - assert np.array_equal(cds_data['x'], np.array(['C', 'B', 'C', 'D', 'E'])) + assert np.array_equal(cds_data['x'], np.array(['C', 'B', 'C', 'D', 'E'])) assert np.array_equal(cds_data['y'], np.array([5, 3, 6, 7, 2])) pane._cleanup(model) diff --git a/panel/tests/test_depends.py b/panel/tests/test_depends.py index e5e290dd5d..be58ad4107 100644 --- a/panel/tests/test_depends.py +++ b/panel/tests/test_depends.py @@ -124,16 +124,16 @@ def add1(value): def divide(value): return value / 2 - + bound_function = bind(divide, bind(add1, widget.param.value)) assert bound_function() == 1 widget.value = 3 - + assert bound_function() == 2 - + def test_bind_bound_function_to_kwarg(): widget = IntSlider(value=1) @@ -142,11 +142,11 @@ def add1(value): def divide(divisor=2, value=0): return value / divisor - + bound_function = bind(divide, value=bind(add1, widget.param.value)) assert bound_function() == 1 widget.value = 3 - + assert bound_function() == 2 diff --git a/panel/tests/test_links.py b/panel/tests/test_links.py index 4419b98d39..e333f4596e 100644 --- a/panel/tests/test_links.py +++ b/panel/tests/test_links.py @@ -84,7 +84,7 @@ def test_widget_link_no_target_transform_error(): t2.jslink(t1, value='value') assert ("Cannot jslink 'value' parameter on TextInput object to 'value' parameter on DatetimeInput") in str(excinfo) - + @hv_available def test_pnwidget_hvplot_links(document, comm): size_widget = FloatSlider(value=5, start=1, end=10) @@ -217,7 +217,7 @@ def test_widget_bkplot_link(document, comm): assert link_customjs.args['source'] is model.children[1] assert link_customjs.args['target'] is scatter.glyph assert scatter.glyph.fill_color == '#ff00ff' - + code = """ var value = source['color']; value = value; @@ -243,10 +243,10 @@ def test_bokeh_figure_jslink(document, comm): pane = Bokeh(fig) t1 = TextInput() - + pane.jslink(t1, **{'x_range.start': 'value'}) row = Row(pane, t1) - + model = row.get_root(document, comm) link_customjs = fig.x_range.js_property_callbacks['change:start'][-1] diff --git a/panel/tests/test_pipeline.py b/panel/tests/test_pipeline.py index 2499be2b79..3d9a7ef7ba 100644 --- a/panel/tests/test_pipeline.py +++ b/panel/tests/test_pipeline.py @@ -81,7 +81,7 @@ def test_find_route(): assert find_route(graph, 'A', 'I') == ['C', 'D', 'G', 'I'] assert find_route(graph, 'B', 'I') is None assert find_route(graph, 'D', 'H') == ['F', 'H'] - + def test_pipeline_from_classes(): pipeline = Pipeline([('Stage 1', Stage1), ('Stage 2', Stage2)]) @@ -302,7 +302,7 @@ def test_pipeline_error_condition(): pipeline._next() assert isinstance(pipeline.error[0], Button) - + stage2b.root = 2 pipeline._next() @@ -329,11 +329,11 @@ def test_pipeline_previous_follows_initial_path(): pipeline._next() assert pipeline._route == ['Stage 1', 'Stage 2b'] - + pipeline._next() assert pipeline._route == ['Stage 1', 'Stage 2b', 'Stage 3'] - + pipeline._previous() assert pipeline._stage == 'Stage 2b' diff --git a/panel/tests/test_reactive.py b/panel/tests/test_reactive.py index bf5b7f5353..062ebdf989 100644 --- a/panel/tests/test_reactive.py +++ b/panel/tests/test_reactive.py @@ -324,7 +324,7 @@ class TestChildren(ReactiveHTML): test._cleanup(root) assert len(test._models) == 0 assert len(widget_new._models) == 0 - + def test_reactive_html_templated_children(): @@ -406,9 +406,9 @@ class TestTemplatedChildren(ReactiveHTML): _template = """ """ @@ -420,13 +420,9 @@ class TestTemplatedChildren(ReactiveHTML): assert test._get_template()[0] == """ """ @@ -443,9 +439,9 @@ class TestTemplatedChildren(ReactiveHTML): _template = """ """ @@ -457,13 +453,9 @@ class TestTemplatedChildren(ReactiveHTML): assert test._get_template()[0] == """ """ model = test.get_root() diff --git a/panel/tests/test_template.py b/panel/tests/test_template.py index 59fc2220f6..f2f18c4238 100644 --- a/panel/tests/test_template.py +++ b/panel/tests/test_template.py @@ -151,7 +151,7 @@ def test_template_server_title(): doc = tmpl.server_doc(title='Ignored title') assert doc.title == 'Main title' - + def test_react_template(document, comm): tmplt = ReactTemplate(title='BasicTemplate', header_background='blue', header_color='red') diff --git a/panel/tests/widgets/test_base.py b/panel/tests/widgets/test_base.py index ec4613189a..64fdc65adf 100644 --- a/panel/tests/widgets/test_base.py +++ b/panel/tests/widgets/test_base.py @@ -13,7 +13,7 @@ excluded = ( BaseTable, CompositeWidget, Dial, FileDownload, LinearGauge, - ToggleGroup, Terminal, Tqdm + ToggleGroup, Terminal, Tqdm ) all_widgets = [ @@ -183,4 +183,3 @@ class Test(param.Parameterized): widget.value = 4.3 assert test.a == 4.3 - diff --git a/panel/tests/widgets/test_debugger.py b/panel/tests/widgets/test_debugger.py index a21fa2d208..304352514b 100644 --- a/panel/tests/widgets/test_debugger.py +++ b/panel/tests/widgets/test_debugger.py @@ -9,11 +9,11 @@ def test_debugger_constructor(): debugger = pn.widgets.Debugger() assert repr(debugger).startswith("Debugger(") - - + + debugger = pn.widgets.Debugger(only_last=False) assert repr(debugger).startswith("Debugger(") - + debugger = pn.widgets.Debugger(level=20) assert repr(debugger).startswith("Debugger(") @@ -21,33 +21,33 @@ def test_debugger_constructor(): def test_debugger_logging(): logger = logging.getLogger('panel.callbacks') debugger = pn.widgets.Debugger() - + logger.info('test') - + assert debugger.terminal.output == '' assert debugger.title == '' - + logger.error('error test') - + assert 'error test' in debugger.terminal.output assert 'errors: 1' in debugger.title - - debugger.terminal._clears+=1 + + debugger.terminal._clears+=1 assert debugger.title == '' #TODO: test if debugger.terminal.output is cleared by JS callback. - - + + def test_debugger_logging_info(): logger = logging.getLogger('panel.callbacks') debugger = pn.widgets.Debugger(level=logging.DEBUG) msg = 'debugger test message' logger.info(msg) - + assert msg in debugger.terminal.output assert debugger.title == 'i: 1' - + msg = 'debugger test warning' logger.warning(msg) - + assert msg in debugger.terminal.output - assert 'w: 1' in debugger.title \ No newline at end of file + assert 'w: 1' in debugger.title diff --git a/panel/tests/widgets/test_indicators.py b/panel/tests/widgets/test_indicators.py index e91ba57c85..eb8ef488fe 100644 --- a/panel/tests/widgets/test_indicators.py +++ b/panel/tests/widgets/test_indicators.py @@ -57,7 +57,7 @@ def test_dial_none(document, comm): assert list(cds.data['starts']) == [9.861110273767961, 9.861110273767961] assert list(cds.data['ends']) == [9.861110273767961, 5.846852994181004] - + text_cds = model.select(name='label_source') assert text_cds.data['text'] == ['Value', '-%', '0%', '100%'] @@ -66,7 +66,7 @@ def test_dial_none(document, comm): assert text_cds.data['text'] == ['Value', 'nan%', '0%', '100%'] - + def test_dial_thresholds_with_bounds(document, comm): dial = Dial(value=25, colors=[(0.33, 'green'), (0.66, 'yellow'), (1, 'red')], bounds=(25, 75)) diff --git a/panel/tests/widgets/test_misc.py b/panel/tests/widgets/test_misc.py index 1f7e163237..4edd55fd23 100644 --- a/panel/tests/widgets/test_misc.py +++ b/panel/tests/widgets/test_misc.py @@ -65,13 +65,13 @@ def test_file_download_file(): with pytest.raises(ValueError): FileDownload(embed=True) - + with pytest.raises(FileNotFoundError): FileDownload("nofile", embed=True) with pytest.raises(ValueError): FileDownload(666, embed=True) - + file_download = FileDownload("nofile") with pytest.raises(FileNotFoundError): file_download._clicks += 1 @@ -82,9 +82,9 @@ def test_file_download_callback(): with pytest.raises(ValueError): file_download._clicks += 1 - + file_download = FileDownload(callback=lambda: StringIO("data"), filename="abc.py") - + assert file_download.data is None file_download._clicks += 1 diff --git a/panel/tests/widgets/test_tables.py b/panel/tests/widgets/test_tables.py index 31e717bd6d..d18bcefe6c 100644 --- a/panel/tests/widgets/test_tables.py +++ b/panel/tests/widgets/test_tables.py @@ -1076,7 +1076,7 @@ def test_tabulator_patch_with_sorters_and_pagination(document, comm): np.testing.assert_array_equal( table.value[col].values, expected_df[col] ) - + def test_tabulator_patch_ranges(document, comm): df = makeMixedDataFrame() table = Tabulator(df) diff --git a/panel/tests/widgets/test_tqdm.py b/panel/tests/widgets/test_tqdm.py index d6f2bab381..8ae2e61db2 100644 --- a/panel/tests/widgets/test_tqdm.py +++ b/panel/tests/widgets/test_tqdm.py @@ -13,7 +13,7 @@ def test_tqdm(): assert tqdm.value == 3 assert tqdm.max == 3 assert tqdm.text.startswith('100% 3/3') - + assert isinstance(tqdm.progress, pn.widgets.indicators.Progress) assert isinstance(tqdm.text_pane, pn.pane.Str) assert isinstance(tqdm.layout, pn.Row) diff --git a/panel/widgets/__init__.py b/panel/widgets/__init__.py index abcfeb5e7d..652c0f2b3d 100644 --- a/panel/widgets/__init__.py +++ b/panel/widgets/__init__.py @@ -2,7 +2,7 @@ Panel widgets makes your data exploration and apps interactive ============================================================== -Panel provides a long range of basic and specialized widgets. +Panel provides a long range of basic and specialized widgets. Check out the widget gallery https://panel.holoviz.org/reference/index.html#widgets for inspiration. diff --git a/panel/widgets/base.py b/panel/widgets/base.py index 4d2dba2795..ba05bbe2d9 100644 --- a/panel/widgets/base.py +++ b/panel/widgets/base.py @@ -71,14 +71,14 @@ def from_param(cls, parameter: param.Parameter, **params) -> Viewable: """ Construct a widget from a Parameter and link the two bi-directionally. - + Parameters ---------- parameter: param.Parameter A parameter to create the widget from. params: dict Keyword arguments to be passed to the widget constructor - + Returns ------- Widget instance linked to the supplied parameter diff --git a/panel/widgets/button.py b/panel/widgets/button.py index d33a1bc138..5e70bd1997 100644 --- a/panel/widgets/button.py +++ b/panel/widgets/button.py @@ -141,7 +141,7 @@ def jslink( """ Links properties on the this Button to those on the `target` object in Javascript (JS) code. - + Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which @@ -150,7 +150,7 @@ def jslink( Arguments ---------- - target: panel.viewable.Viewable | bokeh.model.Model | holoviews.core.dimension.Dimensioned + target: panel.viewable.Viewable | bokeh.model.Model | holoviews.core.dimension.Dimensioned The target to link the value(s) to. code: dict Custom code which will be executed when the widget value diff --git a/panel/widgets/debugger.py b/panel/widgets/debugger.py index 1978da4c22..567f62a5f5 100644 --- a/panel/widgets/debugger.py +++ b/panel/widgets/debugger.py @@ -99,7 +99,7 @@ def filter(self,record): widget_session_ids = set(m.document.session_context.id for m in sum(self.debugger._models.values(), tuple()) if m.document.session_context) - + print('>>>', session_id, widget_session_ids) if session_id not in widget_session_ids: return False @@ -189,7 +189,7 @@ class Debugger(Card): default={'fmt':"%(asctime)s [%(name)s - %(levelname)s]: %(message)s"}, precedence=-1, doc=""" - Arguments to pass to the logging formatter. See + Arguments to pass to the logging formatter. See the standard python logging libraries.""" ) diff --git a/panel/widgets/file_selector.py b/panel/widgets/file_selector.py index caa3f99872..0ee4be1e54 100644 --- a/panel/widgets/file_selector.py +++ b/panel/widgets/file_selector.py @@ -58,7 +58,7 @@ class FileSelector(CompositeWidget): """ The `FileSelector` widget allows browsing the filesystem on the server and selecting one or more files in a directory. - + Reference: https://panel.holoviz.org/reference/widgets/FileSelector.html :Example: diff --git a/panel/widgets/indicators.py b/panel/widgets/indicators.py index 1cbb3bbcee..f28646a0fc 100644 --- a/panel/widgets/indicators.py +++ b/panel/widgets/indicators.py @@ -69,7 +69,7 @@ class BooleanStatus(BooleanIndicator): """ The `BooleanStatus` is a boolean indicator providing a visual representation of a boolean status as filled or non-filled circle. - + If the value is set to `True` the indicator will be filled while setting it to `False` will cause it to be non-filled. @@ -114,7 +114,7 @@ class LoadingSpinner(BooleanIndicator): """ The `LoadingSpinner` is a boolean indicator providing a visual representation of the loading status. - + If the value is set to `True` the spinner will rotate while setting it to `False` will disable the rotating segment. @@ -173,7 +173,7 @@ class Progress(ValueIndicator): """ The `Progress` widget displays the progress towards some target based on the current `value` and the `max` value. - + If no `value` is set, the `Progress` widget is in indeterminate mode and will animate depending on whether it is `active` or not. A more beautiful indicator for this use case is the @@ -1072,7 +1072,7 @@ def _process_param_change(self, msg): class ptqdm(_tqdm): - + def __init__(self, *args, **kwargs): self._indicator = kwargs.pop('indicator') super().__init__(*args, **kwargs) diff --git a/panel/widgets/input.py b/panel/widgets/input.py index 7072e4a91e..7f5be6bc8a 100644 --- a/panel/widgets/input.py +++ b/panel/widgets/input.py @@ -74,7 +74,7 @@ class TextAreaInput(TextInput): """ The `TextAreaInput` allows entering any multiline string using a text input box. - + Lines are joined with the newline character `\n`. Reference: https://panel.holoviz.org/reference/widgets/TextAreaInput.html @@ -92,14 +92,14 @@ class TextAreaInput(TextInput): class FileInput(Widget): """ The `FileInput` allows the user to upload one or more files to the server. - + It makes the filename, MIME type and (bytes) content available in Python. - - Please note - + + Please note + - you can in fact *drag and drop* files onto the `FileInput`. - you easily save the files using the `save` method. - + Reference: https://panel.holoviz.org/reference/widgets/FileInput.html :Example: @@ -185,7 +185,7 @@ class StaticText(Widget): """ The `StaticText` widget displays a text value, but does not allow editing it. - + Reference: https://panel.holoviz.org/reference/widgets/StaticText.html :Example: @@ -224,7 +224,7 @@ class DatePicker(Widget): """ The `DatePicker` allows selecting selecting a `date` value using a text box and a date-picking utility. - + Reference: https://panel.holoviz.org/reference/widgets/DatePicker.html :Example: @@ -332,7 +332,7 @@ class DatetimePicker(_DatetimePickerBase): """ The `DatetimePicker` allows selecting selecting a `datetime` value using a textbox and a datetime-picking utility. - + Reference: https://panel.holoviz.org/reference/widgets/DatetimePicker.html :Example: @@ -372,7 +372,7 @@ class DatetimeRangePicker(_DatetimePickerBase): """ The `DatetimeRangePicker` allows selecting selecting a `datetime` range using a text box and a datetime-range-picking utility. - + Reference: https://panel.holoviz.org/reference/widgets/DatetimeRangePicker.html :Example: @@ -421,7 +421,7 @@ class ColorPicker(Widget): """ The `ColorPicker` widget allows selecting a hexidecimal RGB color value using the browser’s color-picking widget. - + Reference: https://panel.holoviz.org/reference/widgets/ColorPicker.html :Example: @@ -547,11 +547,11 @@ def _process_property_change(self, msg): class IntInput(_SpinnerBase, _IntInputBase): """ The `IntInput` allows selecting an integer value using a spinbox. - + It behaves like a slider except that lower and upper bounds are optional and a specific value can be entered. The value can be changed using the keyboard (up, down, page up, page down), mouse wheel and arrow buttons. - + Reference: https://panel.holoviz.org/reference/widgets/IntInput.html :Example: @@ -569,12 +569,12 @@ class IntInput(_SpinnerBase, _IntInputBase): class FloatInput(_SpinnerBase, _FloatInputBase): """ The `FloatInput` allows selecting a floating point value using a spinbox. - + It behaves like a slider except that the lower and upper bounds are optional and a specific value can be entered. The value can be changed using the keyboard (up, down, page up, page down), mouse wheel and arrow buttons. - + Reference: https://panel.holoviz.org/reference/widgets/FloatInput.html :Example: @@ -606,12 +606,12 @@ def __new__(self, **params): class LiteralInput(Widget): """ The `LiteralInput` allows declaring Python literals using a text - input widget. - + input widget. + A *literal* is some specific primitive value of type `str` , `int`, `float`, `bool` etc or a `dict`, `list`, `tuple`, `set` etc of primitive values. - + Optionally the literal `type` may be declared. Reference: https://panel.holoviz.org/reference/widgets/LiteralInput.html @@ -710,7 +710,7 @@ class ArrayInput(LiteralInput): """ The `ArrayInput` allows rendering and editing NumPy arrays in a text input widget. - + Arrays larger than the `max_array_size` will be summarized and editing will be disabled. @@ -777,9 +777,9 @@ class DatetimeInput(LiteralInput): """ The `DatetimeInput` allows specifying Python `datetime` like values using a text input widget. - + An optional `type` may be declared. - + Reference: https://panel.holoviz.org/reference/widgets/DatetimeInput.html :Example: @@ -861,7 +861,7 @@ class DatetimeRangeInput(CompositeWidget): """ The `DatetimeRangeInput` widget allows selecting a `datetime` range using two `DatetimeInput` widgets, which return a `tuple` range. - + Reference: https://panel.holoviz.org/reference/widgets/DatetimeRangeInput.html :Example: @@ -945,9 +945,9 @@ class Checkbox(Widget): """ The `Checkbox` allows toggling a single condition between `True`/`False` states by ticking a checkbox. - + This widget is interchangeable with the `Toggle` widget. - + Reference: https://panel.holoviz.org/reference/widgets/Checkbox.html :Example: diff --git a/panel/widgets/select.py b/panel/widgets/select.py index 5cfef44b03..8737a69446 100644 --- a/panel/widgets/select.py +++ b/panel/widgets/select.py @@ -127,8 +127,8 @@ def _get_embed_state(self, root, values=None, max_opts=3): class Select(SingleSelectBase): """ The `Select` widget allows selecting a value from a list or dictionary of - `options` by selecting it from a dropdown menu or selection area. - + `options` by selecting it from a dropdown menu or selection area. + It falls into the broad category of single-value, option-selection widgets that provide a compatible API and include the `RadioBoxGroup`, `AutocompleteInput` and `DiscreteSlider` widgets. @@ -320,7 +320,7 @@ class MultiSelect(_MultiSelectBase): """ The `MultiSelect` widget allows selecting multiple values from a list of `options`. - + It falls into the broad category of multi-value, option-selection widgets that provide a compatible API and include the`CrossSelector`, `CheckBoxGroup` and `CheckButtonGroup` widgets. @@ -345,12 +345,12 @@ class MultiSelect(_MultiSelectBase): class MultiChoice(_MultiSelectBase): """ The `MultiChoice` widget allows selecting multiple values from a list of - `options`. - + `options`. + It falls into the broad category of multi-value, option-selection widgets that provide a compatible API and include the `MultiSelect`, `CrossSelector`, `CheckBoxGroup` and `CheckButtonGroup` widgets. - + The `MultiChoice` widget provides a much more compact UI than `MultiSelect`. @@ -373,10 +373,10 @@ class MultiChoice(_MultiSelectBase): option_limit = param.Integer(default=None, bounds=(1, None), doc=""" Maximum number of options to display at once.""") - + search_option_limit = param.Integer(default=None, bounds=(1, None), doc=""" Maximum number of options to display at once if search string is entered.""") - + placeholder = param.String(default='', doc=""" String displayed when no selection has been made.""") @@ -392,12 +392,12 @@ class MultiChoice(_MultiSelectBase): class AutocompleteInput(Widget): """ The `MultiChoice` widget allows selecting multiple values from a list of - `options`. - + `options`. + It falls into the broad category of multi-value, option-selection widgets that provide a compatible API and include the `MultiSelect`, `CrossSelector`, `CheckBoxGroup` and `CheckButtonGroup` widgets. - + The `MultiChoice` widget provides a much more compact UI than `MultiSelect`. @@ -503,12 +503,12 @@ def _get_embed_state(self, root, values=None, max_opts=3): class RadioButtonGroup(_RadioGroupBase, _ButtonBase): """ The `RadioButtonGroup` widget allows selecting from a list or dictionary - of values using a set of toggle buttons. - + of values using a set of toggle buttons. + It falls into the broad category of single-value, option-selection widgets that provide a compatible API and include the `RadioBoxGroup`, `Select`, and `DiscreteSlider` widgets. - + Reference: https://panel.holoviz.org/reference/widgets/RadioButtonGroup.html :Example: @@ -533,11 +533,11 @@ class RadioBoxGroup(_RadioGroupBase): """ The `RadioBoxGroup` widget allows selecting from a list or dictionary of values using a set of checkboxes. - + It falls into the broad category of single-value, option-selection widgets that provide a compatible API and include the `RadioButtonGroup`, `Select` and `DiscreteSlider` widgets. - + Reference: https://panel.holoviz.org/reference/widgets/RadioBoxGroup.html :Example: @@ -599,11 +599,11 @@ class CheckButtonGroup(_CheckGroupBase, _ButtonBase): """ The `CheckButtonGroup` widget allows selecting between a list of options by toggling the corresponding buttons. - + It falls into the broad category of multi-option selection widgets that provide a compatible API and include the `MultiSelect`, `CrossSelector` and `CheckBoxGroup` widgets. - + Reference: https://panel.holoviz.org/reference/widgets/CheckButtonGroup.html :Example: @@ -625,11 +625,11 @@ class CheckBoxGroup(_CheckGroupBase): """ The `CheckBoxGroup` widget allows selecting between a list of options by ticking the corresponding checkboxes. - + It falls into the broad category of multi-option selection widgets that provide a compatible API and include the `MultiSelect`, `CrossSelector` and `CheckButtonGroup` widgets. - + Reference: https://panel.holoviz.org/reference/widgets/CheckBoxGroup.html :Example: @@ -705,7 +705,7 @@ class CrossSelector(CompositeWidget, MultiSelect): :Example: >>> CrossSelector( - ... name='Fruits', value=['Apple', 'Pear'], + ... name='Fruits', value=['Apple', 'Pear'], ... options=['Apple', 'Banana', 'Pear', 'Strawberry'] ... ) """ diff --git a/panel/widgets/slider.py b/panel/widgets/slider.py index 3a2ac21e0f..9c38ab5b3d 100644 --- a/panel/widgets/slider.py +++ b/panel/widgets/slider.py @@ -605,7 +605,7 @@ class DateRangeSlider(_RangeSliderBase): The upper value of the selected range.""") value_throttled = param.Tuple(default=None, length=2, constant=True, doc=""" - The selected range as a tuple of values. Updated one of the handles is released. Supports + The selected range as a tuple of values. Updated one of the handles is released. Supports datetime.datetime, datetime.date and np.datetime64 ranges""") start = param.Date(default=None, doc=""" diff --git a/panel/widgets/speech_to_text.py b/panel/widgets/speech_to_text.py index f8dd01e589..aaaa8f0d11 100644 --- a/panel/widgets/speech_to_text.py +++ b/panel/widgets/speech_to_text.py @@ -282,7 +282,7 @@ class SpeechToText(Widget): :Example: >>> SpeechToText(button_type="light") - + This functionality is **experimental** and only supported by Chrome and a few other browsers. Checkout https://caniuse.com/speech-recognition for a up to date list of diff --git a/panel/widgets/tables.py b/panel/widgets/tables.py index 13837e140d..849b978ad0 100644 --- a/panel/widgets/tables.py +++ b/panel/widgets/tables.py @@ -706,10 +706,10 @@ def selected_dataframe(self): class DataFrame(BaseTable): """ The `DataFrame` widget allows displaying and editing a pandas DataFrame. - + Note that editing is not possible for multi-indexed DataFrames, in which - case you will need to reduce the DataFrame to a single index. - + case you will need to reduce the DataFrame to a single index. + Also note that the `DataFrame` widget will eventually be replaced with the `Tabulator` widget, and so new code should be written to use `Tabulator` instead. diff --git a/panel/widgets/text_to_speech.py b/panel/widgets/text_to_speech.py index b7c03e5a74..677d53cef8 100644 --- a/panel/widgets/text_to_speech.py +++ b/panel/widgets/text_to_speech.py @@ -229,7 +229,7 @@ class TextToSpeech(Utterance, Widget): } def _process_param_change(self, msg): - speak = msg.get('speak') or ('value' in msg and self.auto_speak) + speak = msg.get('speak') or ('value' in msg and self.auto_speak) msg = super()._process_param_change(msg) if speak: msg['speak'] = self.to_dict() diff --git a/panel/widgets/texteditor.py b/panel/widgets/texteditor.py index a2fdaa200a..58483609d8 100644 --- a/panel/widgets/texteditor.py +++ b/panel/widgets/texteditor.py @@ -13,7 +13,7 @@ class TextEditor(Widget): """ The `TextEditor` widget provides a WYSIWYG (what-you-see-is-what-you-get) rich text editor which outputs HTML. - + The editor is built on top of the [Quill.js](https://quilljs.com/) library. Reference: https://panel.holoviz.org/reference/widgets/TextEditor.html diff --git a/pyproject.toml b/pyproject.toml index 59d98fa113..6dcebabfef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,4 +9,4 @@ requires = [ "bleach", "packaging", "tqdm >=4.48.0" -] \ No newline at end of file +] diff --git a/setup.cfg b/setup.cfg index 11b4449ec5..5065d08664 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,7 +8,7 @@ license_file = LICENSE.txt # E501 - line too long (see max-line-length) # E722 - do not use bare except, specify exception instead include = *.py -exclude = .git,__pycache__,.tox,.eggs,*.egg,doc,dist,build,_build,.ipynb_checkpoints,node_modules,apps +exclude = .git,__pycache__,.tox,.eggs,*.egg,doc,dist,build,_build,examples,.ipynb_checkpoints,node_modules,apps ignore = E,W,F812 select = F,E101,E111,E501,E722 max-line-length = 165