Skip to content

Commit

Permalink
Merge pull request #358 from BCG-Gamma/dev/2.0rc2
Browse files Browse the repository at this point in the history
BUILD: release facet 2.0rc2
  • Loading branch information
j-ittner authored Jan 24, 2023
2 parents a072031 + 234f1d9 commit fb88729
Show file tree
Hide file tree
Showing 26 changed files with 255 additions and 227 deletions.
2 changes: 1 addition & 1 deletion .idea/facet.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ repos:
exclude: condabuild/meta.yaml

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v0.981
hooks:
- id: mypy
files: src|sphinx|test
language: python_venv
language_version: python39
additional_dependencies:
- numpy~=1.22
- gamma-pytools~=2.0,!=2.0.0
- sklearndf~=2.0
- gamma-pytools~=2.1rc
- sklearndf~=2.2.dev
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2020-2021 Boston Consulting Group
Copyright 2020-2023 Boston Consulting Group

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
10 changes: 7 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

|
**Release Candidate 2.0rc available now!**

|
FACET is an open source library for human-explainable AI.
It combines sophisticated model inspection and model-based simulation to enable better
explanations of your supervised machine learning models.
Expand Down Expand Up @@ -80,10 +84,10 @@ Quickstart
The following quickstart guide provides a minimal example workflow to get you
up and running with FACET.
For additional tutorials and the API reference,
see the `FACET documentation <https://bcg-gamma.github.io/facet/>`__.
see the `FACET documentation <https://bcg-gamma.github.io/facet/docs-version/2-0>`__.

Changes and additions to new versions are summarized in the
`release notes <https://bcg-gamma.github.io/facet/release_notes.html>`__.
`release notes <https://bcg-gamma.github.io/facet/docs-version/2-0/release_notes.html>`__.


Enhanced Machine Learning Workflow
Expand Down Expand Up @@ -467,4 +471,4 @@ or have a look at
.. |license_badge| image:: https://img.shields.io/badge/License-Apache%202.0-olivegreen.svg
:target: https://opensource.org/licenses/Apache-2.0

.. End-Badges
.. End-Badges
2 changes: 2 additions & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ Other

- API: class ``LearnerCrossfit`` is no longer needed in FACET |nbsp| 2.0 and has been
removed
- API: support new :obj:`~pytools.fit.fitted_only` decorator introduced in *pytools*
|nbsp| 2.1.


FACET 1.2
Expand Down
21 changes: 10 additions & 11 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ schedules:
displayName: Nightly full build
branches:
include:
- 1.2.x
- 2.0.x

resources:
repositories:
Expand Down Expand Up @@ -87,7 +87,7 @@ stages:
versionSpec: '3.9'
displayName: 'use Python 3.9'
- script: |
python -m pip install mypy~=0.971 numpy~=1.22 gamma-pytools~=2.0,!=2.0.0 sklearndf~=2.0
python -m pip install mypy~=0.981 numpy~=1.22 'gamma-pytools~=2.1rc' sklearndf~=2.2.dev
python -m mypy src
displayName: 'Run mypy'
Expand Down Expand Up @@ -132,6 +132,8 @@ stages:

jobs:
- job:
timeoutInMinutes: 120
cancelTimeoutInMinutes: 3
displayName: 'pytest @ develop environment'
condition: ne(variables.source_is_release_branch, 'True')

Expand All @@ -154,10 +156,8 @@ stages:
script: |
set -eux
eval "$(conda shell.bash hook)"
conda env create
conda activate $(project_name)-develop
export PYTHONPATH=$(System.DefaultWorkingDirectory)/src/
export RUN_PACKAGE_VERSION_TEST=$(project_name)
Expand Down Expand Up @@ -611,7 +611,6 @@ stages:
sshKeySecureFile: 'deploy_docs_$(project_name)'
displayName: 'Install the deploy SSH key'

- checkout: pytools
- checkout: self

- script: dir $(Build.SourcesDirectory)
Expand All @@ -622,7 +621,7 @@ stages:
script: |
set -eux
cd $(System.DefaultWorkingDirectory)/$(project_root)
cd $(System.DefaultWorkingDirectory)
echo "Checking out github-pages"
git checkout --track origin/github-pages
Expand All @@ -644,14 +643,14 @@ stages:
set -eux
eval "$(conda shell.bash hook)"
cd $(System.DefaultWorkingDirectory)/$(project_root)
cd $(System.DefaultWorkingDirectory)
echo "Checking out $(branchName)"
git checkout $(branchName)
conda env create
conda activate $(project_name)-develop
export PYTHONPATH=$(System.DefaultWorkingDirectory)/$(project_root)/src/
export PYTHONPATH=$(System.DefaultWorkingDirectory)/src/
python sphinx/make.py html
Expand All @@ -667,14 +666,14 @@ stages:
# install the tree utility
sudo apt-get install tree
cd $(System.DefaultWorkingDirectory)/$(project_root)
cd $(System.DefaultWorkingDirectory)
echo "Restoring previous documentation to the docs directory"
mkdir -p docs
mv $(Build.ArtifactStagingDirectory)/docs-version.bak docs/docs-version
ls docs/docs-version
mkdir -p $(System.DefaultWorkingDirectory)/$(project_root)/sphinx/build/
mkdir -p $(System.DefaultWorkingDirectory)/sphinx/build/
conda activate $(project_name)-develop
python sphinx/make.py prepare_docs_deployment
Expand Down Expand Up @@ -708,7 +707,7 @@ stages:
targetType: 'inline'
script: |
set -eux
cd $(System.DefaultWorkingDirectory)/$(project_root)
cd $(System.DefaultWorkingDirectory)
echo "Adjusting git credentials"
git config --global user.name "Azure Pipelines"
Expand Down
62 changes: 31 additions & 31 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,41 @@ channels:
dependencies:
# run
- boruta_py ~= 0.3
- gamma-pytools ~= 2.0.4
- joblib ~= 1.1
- lightgbm ~= 3.3
- matplotlib ~= 3.5
- numpy ~= 1.22
- pandas ~= 1.4
- python ~= 3.9
- scikit-learn ~= 1.1
- scipy ~= 1.8
- gamma-pytools >= 2.1rc1, <3a
- joblib ~= 1.2
- lightgbm ~= 3.3.4
- matplotlib ~= 3.6.3
- numpy ~= 1.23.5
- pandas ~= 1.5.3
- python ~= 3.9.15
- scikit-learn ~= 1.2.0
- scipy ~= 1.10.0
- shap ~= 0.41
- sklearndf ~= 2.0
- sklearndf >= 2.2rc, < 3a
# build/test
- conda-build ~= 3.21
- conda-verify ~= 3.1
- docutils ~= 0.17
- flit ~= 3.0
- jinja2 ~= 2.11
- conda-build ~= 3.23.3
- conda-verify ~= 3.1.1
- docutils ~= 0.17.1
- flit ~= 3.8.0
- jinja2 ~= 2.11.3
- markupsafe ~= 2.0.1 # markupsafe 2.1 breaks support for jinja2
- m2r ~= 0.2
- pluggy ~= 0.13
- pre-commit ~= 2.20
- pytest ~= 7.1
- pytest-cov ~= 2.12
- pyyaml ~= 5.4
- toml ~= 0.10
- tox ~= 3.24
- yaml ~= 0.2
- m2r ~= 0.3.1
- pluggy ~= 0.13.1
- pre-commit ~= 2.21.0
- pytest ~= 7.2.1
- pytest-cov ~= 2.12.1
- pyyaml ~= 5.4.1
- toml ~= 0.10.2
- tox ~= 3.27.1
- yaml ~= 0.2.5
# sphinx
- nbsphinx ~= 0.8.9
- sphinx ~= 4.5
- sphinx-autodoc-typehints ~= 1.19
- sphinx ~= 4.5.0
- sphinx-autodoc-typehints ~= 1.19.2
- pydata-sphinx-theme ~= 0.8.1
# notebooks
- ipywidgets ~= 8.0
- jupyterlab ~= 3.2
- openpyxl ~= 3.0
- seaborn ~= 0.11
- tableone ~= 0.7
- ipywidgets ~= 8.0.4
- jupyterlab ~= 3.5.2
- openpyxl ~= 3.0.10
- seaborn ~= 0.12.2
- tableone ~= 0.7.12
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ dist-name = "gamma-facet"
license = "Apache Software License v2.0"

requires = [
"gamma-pytools ~=2.0.4",
"gamma-pytools >=2.1rc,<3a",
"matplotlib ~=3.0",
"numpy >=1.21,<2a", # cannot use ~= due to conda bug
"packaging >=20",
"pandas ~=1.0",
"scipy ~=1.2",
"shap >=0.34,<0.42a",
"sklearndf ~=2.0",
"sklearndf >=2.2rc,<3a",
]

requires-python = ">=3.7,<4a"
Expand Down Expand Up @@ -74,19 +74,19 @@ no-binary.min = ["matplotlib", "shap"]

[build.matrix.min]
# direct requirements of gamma-facet
gamma-pytools = "~=2.0.4"
gamma-pytools = "~=2.1rc"
matplotlib = "~=3.0.3"
numpy = "==1.21.6" # cannot use ~= due to conda bug
packaging = "~=20.9"
pandas = "~=1.0.5"
python = ">=3.7.12,<3.8a" # cannot use ~= due to conda bug
scipy = "~=1.4.1"
shap = "~=0.34.0"
sklearndf = "~=2.0.1"
sklearndf = "~=2.2rc"
# additional minimum requirements of sklearndf
boruta = "~=0.3.0"
lightgbm = "~=3.0.0"
scikit-learn = "~=0.21.3"
scikit-learn = "~=0.24.2"
xgboost = "~=1.5"
# additional minimum requirements of gamma-pytools
joblib = "~=0.14.1"
Expand All @@ -97,15 +97,15 @@ numba = "~=0.55" # required to support numpy 1.21

[build.matrix.max]
# direct requirements of gamma-facet
gamma-pytools = "~=2.0.4"
gamma-pytools = ">=2.1rc,<3a"
matplotlib = "~=3.5"
numpy = ">=1.22,<2a" # cannot use ~= due to conda bug
packaging = ">=20"
pandas = "~=1.4"
python = ">=3.9,<4a" # cannot use ~= due to conda bug
scipy = "~=1.8"
shap = "~=0.41"
sklearndf = "~=2.1"
sklearndf = ">=2.2rc,<3a"
# additional maximum requirements of sklearndf
boruta = "~=0.3"
lightgbm = "~=3.3"
Expand Down
2 changes: 1 addition & 1 deletion sphinx/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
from urllib import request

BRANCH = "2.0.x"
BRANCH = "2.1.x"


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion src/facet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""


__version__ = "2.0rc1"
__version__ = "2.0rc2"

__logo__ = (
r"""
Expand Down
10 changes: 5 additions & 5 deletions src/facet/data/partition/_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import numpy.typing as npt

from pytools.api import AllTracker, inheritdoc
from pytools.fit import FittableMixin
from pytools.fit import FittableMixin, fitted_only

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -99,22 +99,22 @@ def max_partitions(self) -> int:
return self._max_partitions

@property
@fitted_only
def partitions_(self) -> Sequence[T_Values]:
"""
The values representing the partitions.
"""

self.ensure_fitted()
assert self._partitions is not None, ASSERTION__PARTITIONER_IS_FITTED
return self._partitions

@property
@fitted_only
def frequencies_(self) -> npt.NDArray[np.int_]:
"""
The count of values allocated to each partition.
"""

self.ensure_fitted()
assert self._frequencies is not None, ASSERTION__PARTITIONER_IS_FITTED
return self._frequencies

Expand Down Expand Up @@ -177,6 +177,7 @@ def is_categorical(self) -> bool:
return False

@property
@fitted_only
def partition_bounds_(self) -> Sequence[Tuple[T_Values_Scalar, T_Values_Scalar]]:
"""
Return the endpoints of the intervals that delineate each partition.
Expand All @@ -186,17 +187,16 @@ def partition_bounds_(self) -> Sequence[Tuple[T_Values_Scalar, T_Values_Scalar]]
bound of a partition range
"""

self.ensure_fitted()
assert self._partition_bounds is not None, ASSERTION__PARTITIONER_IS_FITTED
return self._partition_bounds

@property
@fitted_only
def partition_width_(self) -> T_Values_Scalar:
"""
The width of each partition.
"""

self.ensure_fitted()
assert self._step is not None, ASSERTION__PARTITIONER_IS_FITTED
return self._step

Expand Down
Loading

0 comments on commit fb88729

Please sign in to comment.