Skip to content

Commit

Permalink
Merge pull request #2 from FINRAOS/config-updates
Browse files Browse the repository at this point in the history
Config updates
  • Loading branch information
matthewgillett authored and aeftimia committed Apr 13, 2022
2 parents 4c62101 + f615822 commit d3601b5
Show file tree
Hide file tree
Showing 24 changed files with 1,507 additions and 704 deletions.
84 changes: 44 additions & 40 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,54 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1

# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.
# See: https://circleci.com/docs/2.0/orb-intro/
orbs:
# The python orb contains a set of prepackaged CircleCI configuration you can use repeatedly in your configuration files
# Orb commands and jobs help you with common scripting around a language/tool
# so you dont have to copy and paste it everywhere.
# See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python
python: circleci/[email protected]

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
build-and-test: # This is the name of the job, feel free to change it to better match what you're trying to do!
# These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/
# You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub
# A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python
# The executor is the environment in which the steps below will be executed - below will use a python 3.8 container
# Change the version below to your required version of python
test:
docker:
- image: circleci/python:3.8
steps:
- checkout
- run: sudo apt-get install pandoc
- run: sudo pip install tox
- run: tox
- run: ls -la docs
- persist_to_workspace:
root: docs
paths: html
docs-deploy:
docker:
- image: cimg/python:3.8
# Checkout the code as the first step. This is a dedicated CircleCI step.
# The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default.
# Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt.
# Then run your tests!
# CircleCI will report the results back to your VCS provider.
- image: node:16.14.2
steps:
- checkout
- python/install-packages:
pkg-manager: pip-dist
pip-dependency-file:
- attach_workspace:
at: docs
- run: mkdir -p website/docs && mv docs/html website/docs/
- run:
name: Run pre-commit
command: pip install pre-commit && pre-commit run --all
name: Disable jekyll builds
command: touch website/.nojekyll
- run: mkdir -p website/.circleci
- run: cp .circleci/config.yml website/.circleci/config.yml
- run:
name: Run tests
# This assumes pytest is installed via the install-package step above
no_output_timeout: 30m
command: pip install pytest && pytest tests

# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
name: Install and configure dependencies
command: |
npm install -g --silent [email protected]
git config user.email "$(git log --format=%ae -n 1)"
git config user.name "$(git log --format=%an -n 1)"
- add_ssh_keys:
fingerprints:
- "4e:e4:68:5b:4b:62:62:47:73:47:d5:b4:99:23:98:b1"
- run:
name: Deploy docs to gh-pages branch
command: gh-pages -b website --dotfiles --message "$(git log --format=%B -n 1)" --dist website
workflows:
sample: # This is the name of the workflow, feel free to change it to better match your workflow.
# Inside the workflow, you define the jobs you want to run.
version: 2
build:
jobs:
- build-and-test
- test:
filters:
branches:
ignore: website
- docs-deploy:
requires:
- test
filters:
branches:
only: main
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
repos:

- repo: https://github.com/ambv/black
rev: 21.7b0
rev: 22.3.0
hooks:
- id: black
language_version: python3.8
args: [--line-length=88, tests, mvtk]

- repo: https://gitlab.com/pycqa/flake8
rev: '3.9.2'
rev: 4.0.1
hooks:
- id: flake8
args: [--max-line-length=88, '--per-file-ignores=__init__.py:F401,F403', tests, mvtk]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.910'
rev: v0.942
hooks:
- id: mypy
files: mvtk/
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Check out this repository and `cd` into the directory.

Run `pip install -e ".[doc]"`.

The `[doc]` is used to install dependencies for building documentation.
The `[doc]` is used to install dependencies for building documentation. You
will need [pandoc](https://pandoc.org/) installed.

# Submodules
You can import:
Expand All @@ -29,7 +30,7 @@ You can import:
- `mvtk.interprenet` for building interpretable neural nets.
- `mvtk.thresholding` for adaptive thresholding.
- `mvtk.sobol` for Sobol sensitivity analysis
- `mvtk.supervisor` for divergence anlysis
- `mvtk.supervisor` for divergence analysis
- `mvtk.metrics` for specialised metrics

# Documentation
Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@
".txt": "markdown",
".md": "markdown",
}

user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0"
11 changes: 6 additions & 5 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Everyone can contribute to Model Validation Toolkit, and we value everyone's con
ways to contribute, including:


- Answering questions on Model Validation Toolkit's [discussions page](https://github.com/FINRAOS/model-validation-toolkit/discussions)
- Answering questions on Model Validation Toolkit's [Gitter channel](https://gitter.im/FINRAOS/model-validation-toolkit)
- Improving or expanding Model Validation Toolkit's [documentation](https://finraos.github.io/model-validation-toolkit/docs/html/index.html)
- Contributing to Model Validation Toolkit's [code-base](https://github.com/FINRAOS/model-validation-toolkit/)

Expand All @@ -18,7 +18,8 @@ We welcome pull requests, in particular for those issues marked with

For other proposals, we ask that you first open a GitHub
[Issue](https://github.com/FINRAOS/model-validation-toolkit/issues/new/choose) or
[Discussion](https://github.com/FINRAOS/model-validation-toolkit/discussions)
[Gitter channel](https://gitter.im/FINRAOS/model-validation-toolkit)

to seek feedback on your planned contribution.

## Contributing code using pull requests
Expand Down Expand Up @@ -80,7 +81,7 @@ Follow these steps to contribute code:
git commit -s -m "Your commit message"
```

Please be sure to sign off your work when you commit it with the `-s` or, equivalently `--sign-off` flag to agree to our [DCO](https://raw.githubusercontent.com/FINRAOS/model-validation-toolkit/main/DCO.txt).
Please be sure to sign off your work when you commit it with the `-s` or, equivalently `--sign-off` flag to agree to our [DCO](https://raw.githubusercontent.com/FINRAOS/model-validation-toolkit/main/DCO).

Then sync your code with the main repo:

Expand All @@ -98,7 +99,7 @@ Follow these steps to contribute code:

8. Create a pull request from the Model Validation Toolkit repository and send it for review.
Check the {ref}`pr-checklist` for considerations when preparing your PR, and
consult [GitHub Help](https://help.github.com/articles/about-pull-requests/)
consult [GitHub Help](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)
if you need more information on using pull requests.

## Model Validation Toolkit pull request checklist
Expand All @@ -107,7 +108,7 @@ As you prepare a Model Validation Toolkit pull request, here are a few things to

### DCO

By contributing to this project, you agree to our [DCO](https://raw.githubusercontent.com/FINRAOS/model-validation-toolkit/main/DCO.txt).
By contributing to this project, you agree to our [DCO](https://raw.githubusercontent.com/FINRAOS/model-validation-toolkit/main/DCO).

### Single-change commits and pull requests

Expand Down
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ The Model Validation Toolkit is a library for model validation, metaanalysis, an
notebooks/divergence/Airlines
notebooks/divergence/DivergenceFunctions
notebooks/divergence/CategoricalColumns
notebooks/divergence/BugDetection
notebooks/divergence/TrainingDatasetDrift

.. toctree::
:maxdepth: 1
Expand Down
9 changes: 5 additions & 4 deletions docs/interprenet_user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ and return a scalar value is generally limited to various measures of feature
importance. This can be problematic as what makes a feature "important" can
vary between use cases.

Rather than interpret a neural network as a black box, we seek to constrain
neural network in ways we consider useful and interpretable. In particular, The
`interprenet <interprenet.html>`_ module currently have two such constraints
implemented:
Rather than interpret a neural network as a black
box, we seek to constrain neural network in ways we
consider useful and interpretable. In particular,
The interprenet module currently has two such
constraints implemented:

* Monotonicity
* Lipschitz constraint
Expand Down
Loading

0 comments on commit d3601b5

Please sign in to comment.