Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format and lint the code base #1320

Merged
merged 6 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .flake8

This file was deleted.

16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
default_stages: [commit]
repos:
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.1
rev: 1.8.5
hooks:
- id: nbqa-flake8
- id: nbqa-ruff
additional_dependencies: [ruff==0.3.7]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-builtin-literals
- id: check-case-conflict
Expand All @@ -19,12 +20,11 @@ repos:
- id: end-of-file-fixer
exclude: (\.min\.js$|\.svg$)
- id: trailing-whitespace
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.7
hooks:
- id: flake8 # See 'setup.cfg' for args
args: [hvplot]
files: hvplot/
- id: ruff
- id: ruff-format
- repo: https://github.com/hoxbro/clean_notebook
rev: v0.1.14
hooks:
Expand Down
91 changes: 47 additions & 44 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
param.parameterized.docstring_signature = False
param.parameterized.docstring_describe_params = False

from nbsite.shared_conf import *
import hvplot # noqa
from nbsite.shared_conf import * # noqa

project = 'hvPlot'
authors = 'HoloViz developers'
copyright_years['start_year'] = '2016'
copyright = copyright_fmt.format(**copyright_years)
copyright_years['start_year'] = '2016' # noqa
copyright = copyright_fmt.format(**copyright_years) # noqa
description = 'A high-level plotting API for the PyData ecosystem built on HoloViews'

import hvplot
version = release = base_version(hvplot.__version__)
version = release = base_version(hvplot.__version__) # noqa
nbbuild_cell_timeout = 600

# mystnb
Expand All @@ -22,50 +22,50 @@

exclude_patterns = ['governance']

html_static_path += ['_static']
html_static_path += ['_static'] # noqa

html_css_files += [
'custom.css'
]
html_css_files += ['custom.css'] # noqa

html_js_files = [
'https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js',
]

html_theme_options.update({
"github_url": "https://github.com/holoviz/hvplot",
"icon_links": [
{
"name": "Twitter",
"url": "https://twitter.com/HoloViews",
"icon": "fa-brands fa-twitter-square",
},
{
"name": "Discourse",
"url": "https://discourse.holoviz.org/c/hvplot",
"icon": "fa-brands fa-discourse",
},
{
"name": "Discord",
"url": "https://discord.gg/AXRHnJU6sP",
"icon": "fa-brands fa-discord",
},
],
"pygment_dark_style": "material",
})

html_theme = "pydata_sphinx_theme"
html_logo = "_static/logo_horizontal.svg"
html_favicon = "_static/favicon.ico"

extensions += [
html_theme_options.update( # noqa
{
'github_url': 'https://github.com/holoviz/hvplot',
'icon_links': [
{
'name': 'Twitter',
'url': 'https://twitter.com/HoloViews',
'icon': 'fa-brands fa-twitter-square',
},
{
'name': 'Discourse',
'url': 'https://discourse.holoviz.org/c/hvplot',
'icon': 'fa-brands fa-discourse',
},
{
'name': 'Discord',
'url': 'https://discord.gg/AXRHnJU6sP',
'icon': 'fa-brands fa-discord',
},
],
'pygment_dark_style': 'material',
}
)

html_theme = 'pydata_sphinx_theme'
html_logo = '_static/logo_horizontal.svg'
html_favicon = '_static/favicon.ico'

extensions += [ # noqa
'nbsite.gallery',
'nbsite.analytics',
'sphinx_copybutton',
'sphinxext.rediraffe',
]

myst_enable_extensions = ["colon_fence"]
myst_enable_extensions = ['colon_fence']

nbsite_gallery_conf = {
'github_org': 'holoviz',
Expand All @@ -75,7 +75,8 @@
'reference': {
'title': 'Reference Gallery',
'intro': (
'Find the list of supported libraries on the `Integrations <../user_guide/Integrations.html>`_ page.'),
'Find the list of supported libraries on the `Integrations <../user_guide/Integrations.html>`_ page.'
),
'sections': [
'tabular',
'geopandas',
Expand Down Expand Up @@ -118,9 +119,11 @@
'developer_guide/testing': 'developer_guide/index',
}

html_context.update({
"last_release": f"v{release}",
"github_user": "holoviz",
"github_repo": "panel",
"default_mode": "light",
})
html_context.update( # noqa
{
'last_release': f'v{release}',
'github_user': 'holoviz',
'github_repo': 'panel',
'default_mode': 'light',
}
)
41 changes: 18 additions & 23 deletions doc/conftest.py
Original file line number Diff line number Diff line change
@@ -1,49 +1,44 @@
import dask
from importlib.util import find_spec
from bokeh.io.webdriver import webdriver_control

collect_ignore_glob = []

try:
import pygraphviz
except ModuleNotFoundError:
if not find_spec('pygraphviz'):
collect_ignore_glob += [
"user_guide/NetworkX.ipynb",
'user_guide/NetworkX.ipynb',
]

try:
import geoviews
except ModuleNotFoundError:
if not find_spec('geoviews'):
collect_ignore_glob += [
"getting_started/hvplot.ipynb",
"reference/geopandas/*.ipynb",
"reference/xarray/contour.ipynb",
"reference/xarray/contourf.ipynb",
"reference/xarray/image.ipynb",
"reference/xarray/quadmesh.ipynb",
"reference/xarray/vectorfield.ipynb",
"user_guide/Explorer.ipynb",
"user_guide/Geographic_Data.ipynb",
"user_guide/Integrations.ipynb",
'getting_started/hvplot.ipynb',
'reference/geopandas/*.ipynb',
'reference/xarray/contour.ipynb',
'reference/xarray/contourf.ipynb',
'reference/xarray/image.ipynb',
'reference/xarray/quadmesh.ipynb',
'reference/xarray/vectorfield.ipynb',
'user_guide/Explorer.ipynb',
'user_guide/Geographic_Data.ipynb',
'user_guide/Integrations.ipynb',
]

try:
import ibis
except ModuleNotFoundError:
if not find_spec('ibis'):
collect_ignore_glob += [
"user_guide/Integrations.ipynb",
'user_guide/Integrations.ipynb',
]

try:
webdriver_control.create()
except RuntimeError:
# hvplot.save() with bokeh
collect_ignore_glob += [
"user_guide/Viewing.ipynb",
'user_guide/Viewing.ipynb',
]
finally:
webdriver_control.cleanup()


# From Dask 2024.3.0 they now use `dask_expr` by default
# https://github.com/dask/dask/issues/10995
dask.config.set({"dataframe.query-planning": False})
dask.config.set({'dataframe.query-planning': False})
3 changes: 2 additions & 1 deletion doc/user_guide/Pandas_API.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,8 @@
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd, numpy as np"
"import pandas as pd\n",
"import numpy as np"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion envs/py3.10-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ dependencies:
- dask>=2021.3.0
- datashader>=0.6.5
- fiona
- flake8
- fugue
- geodatasets>=2023.12.0
- geopandas
Expand Down Expand Up @@ -56,6 +55,7 @@ dependencies:
- pytest-xdist
- rasterio
- rioxarray
- ruff
- s3fs>=2022.1.0
- scikit-image>=0.17.2
- scipy
Expand Down
2 changes: 1 addition & 1 deletion envs/py3.11-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ dependencies:
- dask>=2021.3.0
- datashader>=0.6.5
- fiona
- flake8
- fugue
- geodatasets>=2023.12.0
- geopandas
Expand Down Expand Up @@ -56,6 +55,7 @@ dependencies:
- pytest-xdist
- rasterio
- rioxarray
- ruff
- s3fs>=2022.1.0
- scikit-image>=0.17.2
- scipy
Expand Down
2 changes: 1 addition & 1 deletion envs/py3.12-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ dependencies:
- dask>=2021.3.0
- datashader>=0.6.5
- fiona
- flake8
- fugue
- geodatasets>=2023.12.0
- geopandas
Expand Down Expand Up @@ -56,6 +55,7 @@ dependencies:
- pytest-xdist
- rasterio
- rioxarray
- ruff
- s3fs>=2022.1.0
- scikit-image>=0.17.2
- scipy
Expand Down
2 changes: 1 addition & 1 deletion envs/py3.8-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ dependencies:
- dask>=2021.3.0
- datashader>=0.6.5
- fiona
- flake8
- fugue
- geodatasets>=2023.12.0
- geopandas
Expand Down Expand Up @@ -56,6 +55,7 @@ dependencies:
- pytest-xdist
- rasterio
- rioxarray
- ruff
- s3fs>=2022.1.0
- scikit-image>=0.17.2
- scipy
Expand Down
2 changes: 1 addition & 1 deletion envs/py3.9-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ dependencies:
- dask>=2021.3.0
- datashader>=0.6.5
- fiona
- flake8
- fugue
- geodatasets>=2023.12.0
- geopandas
Expand Down Expand Up @@ -56,6 +55,7 @@ dependencies:
- pytest-xdist
- rasterio
- rioxarray
- ruff
- s3fs>=2022.1.0
- scikit-image>=0.17.2
- scipy
Expand Down
Loading
Loading