Skip to content

Commit f3e53e6

Browse files
authored
docs update (#222)
* docs refresh * add dependencies for running python in quarto * update workflows * skip spacy * jupyter dependencies * restrict spacy * use all_models in CI
1 parent 4749b64 commit f3e53e6

19 files changed

Lines changed: 363 additions & 250 deletions

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
name: "Docs"
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
19-
- uses: actions/setup-python@v4
19+
- uses: actions/setup-python@v5
2020
with:
2121
python-version: "3.10"
2222
- name: Install dependencies

.github/workflows/tests.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ jobs:
3434
- name: Install dependencies
3535
run: |
3636
python -m pip install --upgrade pip
37-
python -m pip install -e ".[dev]"
38-
python -m pip install xgboost
39-
python -m pip install spacy
40-
python -m pip install torch
41-
python -m pip install statsmodels
37+
python -m pip install -e ".[dev, all_models]"
4238
- name: Run Tests
4339
run: |
4440
pytest -m 'not rsc_test and not docker' --cov --cov-report xml
@@ -159,7 +155,7 @@ jobs:
159155
name: "Release to pypi"
160156
runs-on: ubuntu-latest
161157
if: github.event_name == 'release'
162-
needs: [test-no-extras, tests, test-rsconnect]
158+
needs: [test-no-extras, tests, test-connect]
163159
steps:
164160
- uses: actions/checkout@v4
165161
- uses: actions/setup-python@v4

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2021 vetiver authors
3+
Copyright (c) 2024 vetiver authors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@ endif
1212
help:
1313
@echo "clean - remove all build, test, coverage and Python artifacts"
1414
@echo "clean-build - remove build artifacts"
15-
@echo "clean-pyc - remove Python file artifacts"
1615
@echo "clean-test - remove test and coverage artifacts"
1716
@echo "lint - check style with flake8"
1817
@echo "test - run tests quickly with the default Python"
1918
@echo "test-rsc - run tests for rsconnect"
2019
@echo "coverage - check code coverage quickly with the default Python"
2120
@echo "docs - generate HTML documentation, including API docs"
2221
@echo "release - package and upload a release"
23-
@echo "dist - package"
24-
@echo "install - install the package to the active Python's site-packages"
2522
@echo "dev - generate Connect API keys"
2623
@echo "dev-start - start up development Connect in Docker"
2724
@echo "dev-stop - stop Connect dev container"
@@ -35,12 +32,6 @@ clean-build:
3532
find . -name '*.egg-info' -exec rm -fr {} +
3633
find . -name '*.egg' -exec rm -f {} +
3734

38-
clean-pyc:
39-
find . -name '*.pyc' -exec rm -f {} +
40-
find . -name '*.pyo' -exec rm -f {} +
41-
find . -name '*~' -exec rm -f {} +
42-
find . -name '__pycache__' -exec rm -fr {} +
43-
4435
clean-test:
4536
rm -f .coverage
4637
rm -f coverage.xml
@@ -69,15 +60,6 @@ docs doc documentation:
6960
release: dist
7061
twine upload dist/*
7162

72-
dist: clean
73-
python setup.py sdist
74-
75-
install: clean
76-
python setup.py install
77-
78-
develop: clean-pyc
79-
python setup.py develop
80-
8163
dev: vetiver/tests/rsconnect_api_keys.json
8264

8365
dev-start:

docs/_quarto.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ quartodoc:
5050
package: vetiver
5151
renderer:
5252
style: markdown
53+
table_style: description-list
54+
show_signature_annotations: true
5355
display_name: relative
5456
sidebar: "_sidebar.yml"
57+
# css: _styles-quartodoc.css
5558
sections:
5659
- title: Version
5760
desc: ""
@@ -72,7 +75,7 @@ quartodoc:
7275
- predict
7376
- write_app
7477
- prepare_docker
75-
- write_docker
78+
- write_docker.write_docker
7679
- deploy_rsconnect
7780

7881
- title: Monitor
@@ -109,3 +112,5 @@ format:
109112
html:
110113
theme:
111114
- flatly
115+
css:
116+
- _styles-quartodoc.css

docs/_styles-quartodoc.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
This file generated automatically by quartodoc version 0.7.7.dev17+g4739a4e.
3+
Modifications may be overwritten by quartodoc build. If you want to
4+
customize styles, create a new .css file to avoid losing changes.
5+
*/
6+
7+
8+
/* styles for parameter tables, etc.. ----
9+
*/
10+
11+
.doc-section dt code {
12+
background: none;
13+
}
14+
15+
.doc-section dt {
16+
background-color: #f8e4d8;
17+
display: block;
18+
}
19+
20+
.doc-section dl dd {
21+
margin-left: 3rem;
22+
}

docs/index.qmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ You can use vetiver with:
2121
- [statsmodels](https://www.statsmodels.org/stable/index.html)
2222
- [xgboost](https://xgboost.readthedocs.io/en/stable/)
2323
- [spacy](https://spacy.io/)
24-
- or utilize [custom handlers](https://rstudio.github.io/vetiver-python/stable/custom_code.html) to support your own models!
24+
- or utilize [custom handlers](https://rstudio.github.io/vetiver-python/stable/advancedusage/custom_handler.html) to support your own models!
2525

2626
## Installation
2727

@@ -50,7 +50,7 @@ model = mock.get_mock_model().fit(X, y)
5050
v = VetiverModel(model, model_name='mock_model', prototype_data=X)
5151
```
5252

53-
You can **version** and **share** your `VetiverModel()` by choosing a [pins](https://rstudio.github.io/pins-python/) "board" for it, including a local folder, RStudio Connect, Amazon S3, and more.
53+
You can **version** and **share** your `VetiverModel()` by choosing a [pins](https://rstudio.github.io/pins-python/) "board" for it, including a local folder, [Connect](https://posit.co/products/enterprise/connect/), Amazon S3, and more.
5454

5555
```python
5656
from pins import board_temp
@@ -73,6 +73,6 @@ To start a server using this object, use `app.run(port = 8080)` or your port of
7373

7474
This project is released with a [Contributor Code of Conduct](https://www.contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
7575

76-
- For questions and discussions about deploying models, statistical modeling, and machine learning, please [post on RStudio Community](https://community.rstudio.com/new-topic?category_id=15&tags=vetiver,question).
76+
- For questions and discussions about deploying models, statistical modeling, and machine learning, please [post on Posit Community](https://forum.posit.co/new-topic?category_id=15&tags=vetiver,question).
7777

7878
- If you think you have encountered a bug, please [submit an issue](https://github.com/rstudio/vetiver-python/issues).

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,14 @@ dev = [
6666
"vetiver[docs]"
6767
]
6868
docs = [
69-
"quartodoc"
69+
"quartodoc",
70+
# quarto render dependencies
71+
"jupyter"
7072
]
7173
statsmodels = ["statsmodels"]
7274
torch = ["torch"]
7375
xgboost = ["xgboost"]
74-
spacy = ["spacy"]
76+
spacy = ["spacy; python_version < '3.13'"]
7577
typecheck = [
7678
"pyright",
7779
"pandas-stubs"

vetiver/handlers/base.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ def create_handler(model, prototype_data):
3737
3838
Examples
3939
--------
40-
>>> import vetiver
41-
>>> X, y = vetiver.mock.get_mock_data()
42-
>>> model = vetiver.mock.get_mock_model()
43-
>>> handler = vetiver.create_handler(model, X)
44-
>>> handler.describe()
45-
'A scikit-learn DummyRegressor model'
40+
```{python}
41+
import vetiver
42+
X, y = vetiver.mock.get_mock_data()
43+
model = vetiver.mock.get_mock_model()
44+
handler = vetiver.create_handler(model, X)
45+
handler.describe()
46+
```
4647
"""
4748

4849
raise InvalidModelError(
@@ -56,7 +57,10 @@ def create_handler(model, prototype_data):
5657

5758

5859
class BaseHandler:
59-
"""Base handler class for creating VetiverModel of different type.
60+
"""Base handler class for creating VetiverModel of different types of model.
61+
62+
Handlers are used in Vetiver to as a unified interface for different types of models.
63+
They are used to generate predictions and create metadata about a trained model.
6064
6165
Parameters
6266
----------

0 commit comments

Comments
 (0)