Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
name: "Docs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install xgboost
python -m pip install spacy
python -m pip install torch
python -m pip install statsmodels
python -m pip install -e ".[dev, all_models]"
- name: Run Tests
run: |
pytest -m 'not rsc_test and not docker' --cov --cov-report xml
Expand Down Expand Up @@ -159,7 +155,7 @@ jobs:
name: "Release to pypi"
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs: [test-no-extras, tests, test-rsconnect]
needs: [test-no-extras, tests, test-connect]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 vetiver authors
Copyright (c) 2024 vetiver authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
18 changes: 0 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@ endif
help:
@echo "clean - remove all build, test, coverage and Python artifacts"
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "clean-test - remove test and coverage artifacts"
@echo "lint - check style with flake8"
@echo "test - run tests quickly with the default Python"
@echo "test-rsc - run tests for rsconnect"
@echo "coverage - check code coverage quickly with the default Python"
@echo "docs - generate HTML documentation, including API docs"
@echo "release - package and upload a release"
@echo "dist - package"
@echo "install - install the package to the active Python's site-packages"
@echo "dev - generate Connect API keys"
@echo "dev-start - start up development Connect in Docker"
@echo "dev-stop - stop Connect dev container"
Expand All @@ -35,12 +32,6 @@ clean-build:
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +

clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +

clean-test:
rm -f .coverage
rm -f coverage.xml
Expand Down Expand Up @@ -69,15 +60,6 @@ docs doc documentation:
release: dist
twine upload dist/*

dist: clean
python setup.py sdist

install: clean
python setup.py install

develop: clean-pyc
python setup.py develop

dev: vetiver/tests/rsconnect_api_keys.json

dev-start:
Expand Down
7 changes: 6 additions & 1 deletion docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ quartodoc:
package: vetiver
renderer:
style: markdown
table_style: description-list
show_signature_annotations: true
display_name: relative
sidebar: "_sidebar.yml"
# css: _styles-quartodoc.css
sections:
- title: Version
desc: ""
Expand All @@ -72,7 +75,7 @@ quartodoc:
- predict
- write_app
- prepare_docker
- write_docker
- write_docker.write_docker
- deploy_rsconnect

- title: Monitor
Expand Down Expand Up @@ -109,3 +112,5 @@ format:
html:
theme:
- flatly
css:
- _styles-quartodoc.css
22 changes: 22 additions & 0 deletions docs/_styles-quartodoc.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
This file generated automatically by quartodoc version 0.7.7.dev17+g4739a4e.
Modifications may be overwritten by quartodoc build. If you want to
customize styles, create a new .css file to avoid losing changes.
*/


/* styles for parameter tables, etc.. ----
*/

.doc-section dt code {
background: none;
}

.doc-section dt {
background-color: #f8e4d8;
display: block;
}

.doc-section dl dd {
margin-left: 3rem;
}
6 changes: 3 additions & 3 deletions docs/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can use vetiver with:
- [statsmodels](https://www.statsmodels.org/stable/index.html)
- [xgboost](https://xgboost.readthedocs.io/en/stable/)
- [spacy](https://spacy.io/)
- or utilize [custom handlers](https://rstudio.github.io/vetiver-python/stable/custom_code.html) to support your own models!
- or utilize [custom handlers](https://rstudio.github.io/vetiver-python/stable/advancedusage/custom_handler.html) to support your own models!

## Installation

Expand Down Expand Up @@ -50,7 +50,7 @@ model = mock.get_mock_model().fit(X, y)
v = VetiverModel(model, model_name='mock_model', prototype_data=X)
```

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.
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.

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

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.

- 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).
- 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).

- If you think you have encountered a bug, please [submit an issue](https://github.com/rstudio/vetiver-python/issues).
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ dev = [
"vetiver[docs]"
]
docs = [
"quartodoc"
"quartodoc",
# quarto render dependencies
"jupyter"
]
statsmodels = ["statsmodels"]
torch = ["torch"]
xgboost = ["xgboost"]
spacy = ["spacy"]
spacy = ["spacy; python_version < '3.13'"]
typecheck = [
"pyright",
"pandas-stubs"
Expand Down
18 changes: 11 additions & 7 deletions vetiver/handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ def create_handler(model, prototype_data):

Examples
--------
>>> import vetiver
>>> X, y = vetiver.mock.get_mock_data()
>>> model = vetiver.mock.get_mock_model()
>>> handler = vetiver.create_handler(model, X)
>>> handler.describe()
'A scikit-learn DummyRegressor model'
```{python}
import vetiver
X, y = vetiver.mock.get_mock_data()
model = vetiver.mock.get_mock_model()
handler = vetiver.create_handler(model, X)
handler.describe()
```
"""

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


class BaseHandler:
"""Base handler class for creating VetiverModel of different type.
"""Base handler class for creating VetiverModel of different types of model.

Handlers are used in Vetiver to as a unified interface for different types of models.
They are used to generate predictions and create metadata about a trained model.

Parameters
----------
Expand Down
Loading
Loading