Skip to content

Commit

Permalink
small documentation improvements (#276)
Browse files Browse the repository at this point in the history
* generating documentation from notebooks
Co-authored-by: DBI <danb@deepchecks.com>
Co-authored-by: Itay Gabbay <itay@deepchecks.com>
  • Loading branch information
yromanyshyn committed Dec 20, 2021
1 parent cc9a3bc commit 4a2fa7c
Show file tree
Hide file tree
Showing 89 changed files with 14,532 additions and 224 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ history/
.idea/
.DS_Store
*.pdf
*.rst

test/AutogluonModels
test/.agModels
Expand Down Expand Up @@ -84,5 +83,5 @@ ENV/
.ipynb_checkpoints

# Sphinx Docs
_build/
api-reference
_autosummary/
generated/
46 changes: 46 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ----------------------------------------------------------------------------
# Copyright (C) 2021 Deepchecks (https://www.deepchecks.com)
#
# This file is part of Deepchecks.
# Deepchecks is distributed under the terms of the GNU Affero General
# Public License (version 3 or later).
# You should have received a copy of the GNU Affero General Public License
# along with Deepchecks. If not, see <http://www.gnu.org/licenses/>.
# ----------------------------------------------------------------------------
#
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
tools:
python: "3.8"
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
# golang: "1.17"
apt_packages:
- pandoc

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: docs/source/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
# formats:
# - pdf

# Optionally declare the Python requirements required to build your docs
python:
system_packages: false
install:
- requirements: docs/requirements.txt
- requirements: requirements.txt
- method: pip
path: .
9 changes: 4 additions & 5 deletions deepchecks/base/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import inspect
import re
from collections import OrderedDict
from dataclasses import dataclass
from functools import wraps
from typing import Any, Callable, List, Union, Dict, cast

Expand Down Expand Up @@ -155,7 +154,7 @@ def __init__(self, value, header: str = None, display: Any = None):
value (Any): Value calculated by check. Can be used to decide if decidable check passed.
header (str): Header to be displayed in python notebook.
check (Class): The check class which created this result. Used to extract the summary to be
displayed in notebook.
displayed in notebook.
display (List): Objects to be displayed (dataframe or function or html)
"""
self.value = value
Expand Down Expand Up @@ -378,9 +377,9 @@ def run(self, model) -> CheckResult:
pass


@dataclass
class CheckFailure:
"""Class which holds a run exception of a check."""

check: Any # Check class, not instance
exception: Exception
def __init__(self, check: Any, exception: Exception):
self.check = check
self.exception = exception
24 changes: 12 additions & 12 deletions deepchecks/ppscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,20 +595,20 @@ def matrix(df, output="df", sorted=False, **kwargs):
Calculate the Predictive Power Score (PPS) matrix for all columns in the dataframe.
Args:
df : pandas.DataFrame
The dataframe that contains the data
output: str - potential values: "df", "list"
Control the type of the output. Either return a pandas.DataFrame (df) or a list with the score dicts
sorted: bool
Whether or not to sort the output dataframe/list by the ppscore
kwargs:
Other key-word arguments that shall be forwarded to the pps.score method,
e.g. `sample, `cross_validation, `random_seed, `invalid_score`, `catch_errors`
df : pandas.DataFrame
The dataframe that contains the data
output: str - potential values: "df", "list"
Control the type of the output. Either return a pandas.DataFrame (df) or a list with the score dicts
sorted: bool
Whether or not to sort the output dataframe/list by the ppscore
kwargs:
Other key-word arguments that shall be forwarded to the pps.score method,
e.g. `sample, `cross_validation, `random_seed, `invalid_score`, `catch_errors`
Returns:
pandas.DataFrame or list of Dict
Either returns a tidy dataframe or a list of all the PPS dicts. This can be influenced
by the output argument
pandas.DataFrame or list of Dict
Either returns a tidy dataframe or a list of all the PPS dicts. This can be influenced
by the output argument
"""
if not isinstance(df, pd.DataFrame):
raise TypeError(
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = $(shell realpath source)
BUILDDIR = $(shell realpath build)

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
8 changes: 0 additions & 8 deletions docs/_templates/module.rst_t

This file was deleted.

57 changes: 0 additions & 57 deletions docs/_templates/package.rst_t

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_templates/toc.rst_t

This file was deleted.

71 changes: 0 additions & 71 deletions docs/conf.py

This file was deleted.

12 changes: 12 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sphinx>=1.8.5
nbsphinx>=0.8.7
pydata-sphinx-theme>=0.7.2
sphinx-copybutton>=0.4.0
sphinx-gallery>=0.10.1
sphinxcontrib-applehelp>=1.0.2
sphinxcontrib-devhelp>=1.0.2
sphinxcontrib-htmlhelp>=2.0.0
sphinxcontrib-jsmath>=1.0.1
sphinxcontrib-qthelp>=1.0.3
sphinxcontrib-serializinghtml>=1.1.5
readthedocs-sphinx-search
16 changes: 16 additions & 0 deletions docs/source/_static/binder-badge.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/_static/colab-badge.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4a2fa7c

Please sign in to comment.