Skip to content

Commit 3497525

Browse files
authored
Merge pull request #73 from isabelizimm/precommit
bulk precommit
2 parents 2047a99 + 66941b4 commit 3497525

45 files changed

Lines changed: 233 additions & 238 deletions

Some content is hidden

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

.github/ISSUE_TEMPLATE/release-checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ assignees: ''
1010
Prepare for release:
1111

1212
- [ ] `pre-commit run`
13-
- [ ] `pytest vetiver/tests/`
13+
- [ ] `pytest vetiver/tests/`
1414
- [ ] bump release number
1515

1616
Submit to PyPI:

.pre-commit-config.yaml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1+
2+
3+
exclude: "(.*\\.csv)|(^pins/tests/_snapshots)"
14
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v2.3.0
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v2.4.0
47
hooks:
5-
- id: check-yaml
6-
- id: end-of-file-fixer
7-
- id: trailing-whitespace
8-
- repo: https://github.com/psf/black
9-
rev: 21.12b0
8+
- id: flake8
9+
# line too long and line before binary operator (black is ok with these)
10+
types:
11+
- python
12+
- id: trailing-whitespace
13+
- id: end-of-file-fixer
14+
- id: check-yaml
15+
args: ["--unsafe"]
16+
- id: check-added-large-files
17+
- repo: https://github.com/psf/black
18+
rev: 22.3.0
1019
hooks:
11-
- id: black
20+
- id: black

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ python -m pip install git+https://github.com/rstudio/vetiver-python
3535

3636
## Example
3737

38-
A `VetiverModel()` object collects the information needed to store, version, and deploy a trained model.
38+
A `VetiverModel()` object collects the information needed to store, version, and deploy a trained model.
3939

4040
```python
4141
from vetiver import mock, VetiverModel

docs/figures/logo.svg

Lines changed: 4 additions & 4 deletions
Loading

docs/source/advancedusage/custom_handler.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ from vetiver.handlers.base import VetiverHandler
88
class SampleCustomHandler(VetiverHandler):
99
def __init__(model, ptype_data):
1010
super().__init__(model, ptype_data)
11-
11+
1212
def handler_predict(self, input_data, check_ptype):
1313
"""
1414
handler_predict defines how to make predictions from your model
@@ -17,9 +17,9 @@ class SampleCustomHandler(VetiverHandler):
1717
```
1818

1919
## New model type
20-
If your model type is not supported by vetiver, you should create and then register the handler using [single dispatch](https://docs.python.org/3/library/functools.html#functools.singledispatch). Once the new type is registered, you are able to use `VetiverModel()` as normal. Here is a template for such a function:
20+
If your model type is not supported by vetiver, you should create and then register the handler using [single dispatch](https://docs.python.org/3/library/functools.html#functools.singledispatch). Once the new type is registered, you are able to use `VetiverModel()` as normal. Here is a template for such a function:
2121

22-
```python
22+
```python
2323
from vetiver.handlers._interface import create_handler
2424

2525
@create_handler.register
@@ -34,8 +34,8 @@ If your model is a common type, please consider [submitting a pull request](http
3434
## Different model implementation
3535
If your model's prediction function is different than vetiver's, you should create a custom handler with a `handler_predict` method to make predictions. Then, initialize your handler with your model, and pass the object into `VetiverModel`.
3636

37-
```python
37+
```python
3838
new_model = SampleCustomHandler(your_model, your_ptype_data)
3939

4040
VetiverModel(new_model, "your_model")
41-
```
41+
```

docs/source/conf.py

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
1-
# Configuration file for the Sphinx documentation builder.
2-
#
3-
# This file only contains a selection of the most common options. For a full
4-
# list see the documentation:
5-
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6-
7-
# -- Path setup --------------------------------------------------------------
8-
9-
# If extensions (or modules to document with autodoc) are in another directory,
10-
# add these directories to sys.path here. If the directory is relative to the
11-
# documentation root, use os.path.abspath to make it absolute, like shown here.
12-
#
131
import os
142
import sys
15-
sys.path.insert(0, os.path.abspath('.'))
163
from vetiver import __version__
174

5+
sys.path.insert(0, os.path.abspath("."))
6+
187

198
# -- Project information -----------------------------------------------------
209

@@ -38,7 +27,7 @@
3827
"sphinx.ext.napoleon",
3928
"sphinx.ext.githubpages",
4029
"sphinx.ext.autodoc",
41-
"myst_parser"
30+
"myst_parser",
4231
]
4332
# Add any paths that contain templates here, relative to this directory.
4433
templates_path = ["_templates"]
@@ -61,14 +50,13 @@
6150
"use_repository_button": True,
6251
"use_issues_button": True,
6352
"use_edit_page_button": True,
64-
"home_page_in_toc": True
65-
53+
"home_page_in_toc": True,
6654
}
6755

6856
source_suffix = {
69-
'.rst': 'restructuredtext',
70-
'.txt': 'markdown',
71-
'.md': 'markdown',
57+
".rst": "restructuredtext",
58+
".txt": "markdown",
59+
".md": "markdown",
7260
}
7361
myst_heading_anchors = 2
7462

docs/source/index.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ Version
3636
:caption: Version
3737

3838
~VetiverModel
39-
~pin_read_write.vetiver_pin_read
4039
~pin_read_write.vetiver_pin_write
4140

4241
Deploy
@@ -51,13 +50,11 @@ Deploy
5150
~VetiverAPI.vetiver_post
5251
~vetiver_endpoint
5352
~predict
54-
~load_pkgs
55-
~vetiver_write_app
56-
~vetiver_write_docker
53+
~write_app
54+
~write_docker
5755

5856
Advanced Usage
5957
==================
6058
.. toctree::
6159
advancedusage/custom_handler.md
6260
:caption: Advanced Usage
63-

docs/source/reference/vetiver.VetiverAPI.rst

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,24 @@
55

66
.. autoclass:: VetiverAPI
77

8-
8+
99
.. automethod:: __init__
1010

11-
11+
1212
.. rubric:: Methods
1313

1414
.. autosummary::
15-
15+
1616
~VetiverAPI.__init__
1717
~VetiverAPI.run
1818
~VetiverAPI.vetiver_post
19-
20-
2119

22-
23-
20+
21+
22+
23+
2424
.. rubric:: Attributes
2525

2626
.. autosummary::
27-
27+
2828
~VetiverAPI.app
29-
30-

docs/source/reference/vetiver.VetiverAPI.run.rst

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

44
.. currentmodule:: vetiver
55

6-
.. automethod:: VetiverAPI.run
6+
.. automethod:: VetiverAPI.run

docs/source/reference/vetiver.VetiverAPI.vetiver_post.rst

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

44
.. currentmodule:: vetiver
55

6-
.. automethod:: VetiverAPI.vetiver_post
6+
.. automethod:: VetiverAPI.vetiver_post

0 commit comments

Comments
 (0)