Skip to content

Commit 8368c6a

Browse files
committed
misc: Add and run pre-commit
1 parent bea00ac commit 8368c6a

File tree

106 files changed

+106176
-106306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+106176
-106306
lines changed

.github/workflows/tests.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ jobs:
3232
run: |
3333
pip install pytest
3434
pip install pytest-cov
35-
36-
pytest --cov=pyntcloud --cov-report=xml --cov-append tests/unit
37-
pytest --cov=pyntcloud --cov-report=xml --cov-append tests/integration
3835
39-
- name: Upload coverage to Codecov
36+
pytest --cov=pyntcloud --cov-report=xml --cov-append tests/unit
37+
pytest --cov=pyntcloud --cov-report=xml --cov-append tests/integration
38+
39+
- name: Upload coverage to Codecov
4040
if: matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.11'
4141
run: bash <(curl -s https://codecov.io/bash) -t $TOKEN -B $REF
4242
env:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ docs/_build
6161
\.idea/
6262

6363
\.pytest_cache/
64-
pythonenv*
64+
pythonenv*

.pre-commit-config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-case-conflict
7+
- id: check-json
8+
- id: check-merge-conflict
9+
args: ['--assume-in-merge']
10+
- id: check-toml
11+
- id: check-yaml
12+
- id: end-of-file-fixer
13+
- id: mixed-line-ending
14+
args: ['--fix=lf']
15+
- id: sort-simple-yaml
16+
- id: trailing-whitespace
17+
- repo: https://github.com/astral-sh/ruff-pre-commit
18+
rev: 'v0.9.10'
19+
hooks:
20+
- id: ruff
21+
args: [--fix, --exit-non-zero-on-fix]
22+
- id: ruff-format
23+
- repo: https://github.com/codespell-project/codespell
24+
rev: v2.4.1
25+
hooks:
26+
- id: codespell
27+
exclude: CODE_OF_CONDUCT.md

docs/conf.py

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
import sphinx_bootstrap_theme
2424

25-
sys.path.insert(0, os.path.abspath('../'))
25+
sys.path.insert(0, os.path.abspath("../"))
2626

2727

2828
# -- General configuration ------------------------------------------------
@@ -36,40 +36,40 @@
3636
# ones.
3737

3838
extensions = [
39-
'sphinx.ext.autodoc',
40-
'sphinx.ext.coverage',
41-
'sphinx.ext.viewcode',
42-
'sphinx.ext.githubpages',
43-
'sphinx.ext.autosummary',
44-
'sphinx.ext.napoleon'
39+
"sphinx.ext.autodoc",
40+
"sphinx.ext.coverage",
41+
"sphinx.ext.viewcode",
42+
"sphinx.ext.githubpages",
43+
"sphinx.ext.autosummary",
44+
"sphinx.ext.napoleon",
4545
]
4646

4747

4848
# Add any paths that contain templates here, relative to this directory.
49-
templates_path = ['_templates']
49+
templates_path = ["_templates"]
5050

5151
# The suffix(es) of source filenames.
5252
# You can specify multiple suffix as a list of string:
5353
#
5454
# source_suffix = ['.rst', '.md']
55-
source_suffix = '.rst'
55+
source_suffix = ".rst"
5656

5757
# The master toctree document.
58-
master_doc = 'index'
58+
master_doc = "index"
5959

6060
# General information about the project.
61-
project = 'pyntcloud'
62-
copyright = 'HAKUNA MATATA'
63-
author = 'David de la Iglesia Castro'
61+
project = "pyntcloud"
62+
copyright = "HAKUNA MATATA"
63+
author = "David de la Iglesia Castro"
6464

6565
# The version info for the project you're documenting, acts as replacement for
6666
# |version| and |release|, also used in various other places throughout the
6767
# built documents.
6868
#
6969
# The short X.Y version.
70-
version = '0.1.3'
70+
version = "0.1.3"
7171
# The full version, including alpha/beta/rc tags.
72-
release = '0.1.3'
72+
release = "0.1.3"
7373

7474
# The language for content autogenerated by Sphinx. Refer to documentation
7575
# for a list of supported languages.
@@ -81,10 +81,10 @@
8181
# List of patterns, relative to source directory, that match files and
8282
# directories to ignore when looking for source files.
8383
# This patterns also effect to html_static_path and html_extra_path
84-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
84+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
8585

8686
# The name of the Pygments (syntax highlighting) style to use.
87-
pygments_style = 'sphinx'
87+
pygments_style = "sphinx"
8888

8989
# If true, `todo` and `todoList` produce output, else they produce nothing.
9090
todo_include_todos = False
@@ -95,7 +95,7 @@
9595
# The theme to use for HTML and HTML Help pages. See the documentation for
9696
# a list of builtin themes.
9797
#
98-
html_theme = 'bootstrap'
98+
html_theme = "bootstrap"
9999
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
100100
html_logo = "images/pyntcloud_logo_small.png"
101101

@@ -112,7 +112,7 @@
112112
# -- Options for HTMLHelp output ------------------------------------------
113113

114114
# Output file base name for HTML help builder.
115-
htmlhelp_basename = 'pyntclouddoc'
115+
htmlhelp_basename = "pyntclouddoc"
116116

117117

118118
# -- Options for LaTeX output ---------------------------------------------
@@ -121,15 +121,12 @@
121121
# The paper size ('letterpaper' or 'a4paper').
122122
#
123123
# 'papersize': 'letterpaper',
124-
125124
# The font size ('10pt', '11pt' or '12pt').
126125
#
127126
# 'pointsize': '10pt',
128-
129127
# Additional stuff for the LaTeX preamble.
130128
#
131129
# 'preamble': '',
132-
133130
# Latex figure (float) alignment
134131
#
135132
# 'figure_align': 'htbp',
@@ -139,19 +136,21 @@
139136
# (source start file, target name, title,
140137
# author, documentclass [howto, manual, or own class]).
141138
latex_documents = [
142-
(master_doc, 'pyntcloud.tex', 'pyntcloud Documentation',
143-
'David de la Iglesia Castro', 'manual'),
139+
(
140+
master_doc,
141+
"pyntcloud.tex",
142+
"pyntcloud Documentation",
143+
"David de la Iglesia Castro",
144+
"manual",
145+
),
144146
]
145147

146148

147149
# -- Options for manual page output ---------------------------------------
148150

149151
# One entry per manual page. List of tuples
150152
# (source start file, name, description, authors, manual section).
151-
man_pages = [
152-
(master_doc, 'pyntcloud', 'pyntcloud Documentation',
153-
[author], 1)
154-
]
153+
man_pages = [(master_doc, "pyntcloud", "pyntcloud Documentation", [author], 1)]
155154

156155

157156
# -- Options for Texinfo output -------------------------------------------
@@ -160,7 +159,13 @@
160159
# (source start file, target name, title, author,
161160
# dir menu entry, description, category)
162161
texinfo_documents = [
163-
(master_doc, 'pyntcloud', 'pyntcloud Documentation',
164-
author, 'pyntcloud', 'One line description of project.',
165-
'Miscellaneous'),
162+
(
163+
master_doc,
164+
"pyntcloud",
165+
"pyntcloud Documentation",
166+
author,
167+
"pyntcloud",
168+
"One line description of project.",
169+
"Miscellaneous",
170+
),
166171
]

docs/filters_dev.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Filters are used by the method:
2525
Take a look at the source code in order to get a general overview of how filters are being used. All filters are classes and all have the same
2626
methods.
2727

28-
The sections below will guide you trough the filters module explaining how you can create your own filters or where you need
28+
The sections below will guide you through the filters module explaining how you can create your own filters or where you need
2929
to look in order to modify existing ones.
3030

3131
Base Class
@@ -37,7 +37,7 @@ All filters must inherit from the base class `Filter` and implement its abstract
3737

3838
The base class is located at pyntcloud/filters/base.py
3939

40-
.. autoclass:: Filter
40+
.. autoclass:: Filter
4141

4242
At the very least, all filters receive a PyntCloud when they are instantiated.
4343

@@ -64,14 +64,14 @@ methods of the Filter base class.
6464

6565
For example, in the f_kdtree submodule there is a Filter_KDTree class from which all the filters that require a KDTree inherit.
6666

67-
.. autoclass:: Filter_KDTree
67+
.. autoclass:: Filter_KDTree
6868

6969
If you don't find a submodule that extracts the information that your new filter needs, create a new one using as guideline one of the existing ones.
7070

7171
Specific Filter Class
7272
=====================
7373

74-
Once you have a submodule base class that extracts the right information, you have to actually create the specific class
74+
Once you have a submodule base class that extracts the right information, you have to actually create the specific class
7575
for your filter, inheriting from the submodule base class and overriding the `Filter.compute` method.
7676

7777
If the computation of your filter requires some parameters from the user, you should override the `__init__` method in order to accept those

docs/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ common point cloud processing operations:
4949

5050
- sampling
5151

52-
- :ref:`scalar_fields` / :ref:`scalar_fields_dev`
52+
- :ref:`scalar_fields` / :ref:`scalar_fields_dev`
5353

5454
- :ref:`structures` / :ref:`structures_dev`
5555

docs/io_dev.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
=========
44
I/O - Dev
5-
=========
5+
=========

docs/structures_dev.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
================
44
Structures - Dev
5-
================
5+
================

examples/[scalar_fields] eigenvalues.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@
167167
"metadata": {},
168168
"outputs": [],
169169
"source": [
170-
"anky_cloud = anky.get_sample(\"mesh_random\", n=100000, rgb=True, normals=True, as_PyntCloud=True)"
170+
"anky_cloud = anky.get_sample(\n",
171+
" \"mesh_random\", n=100000, rgb=True, normals=True, as_PyntCloud=True\n",
172+
")"
171173
]
172174
},
173175
{
@@ -319,9 +321,7 @@
319321
"metadata": {},
320322
"outputs": [],
321323
"source": [
322-
"eigenvalues = anky_cloud.add_scalar_field(\n",
323-
" \"eigen_values\", \n",
324-
" k_neighbors=k_neighbors)"
324+
"eigenvalues = anky_cloud.add_scalar_field(\"eigen_values\", k_neighbors=k_neighbors)"
325325
]
326326
},
327327
{

examples/[scalar_fields] normals.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@
167167
"metadata": {},
168168
"outputs": [],
169169
"source": [
170-
"anky_cloud = anky.get_sample(\"mesh_random\", n=100000, rgb=True, normals=True, as_PyntCloud=True)"
170+
"anky_cloud = anky.get_sample(\n",
171+
" \"mesh_random\", n=100000, rgb=True, normals=True, as_PyntCloud=True\n",
172+
")"
171173
]
172174
},
173175
{

0 commit comments

Comments
 (0)