hi-ml/.pre-commit-config.yaml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 строки
2.2 KiB
YAML
Исходник Обычный вид История

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# See https://github.com/pre-commit/pre-commit-hooks/blob/master/.pre-commit-config.yaml for an example with more hooks
ci:
autofix_prs: true
autoupdate_commit_msg: "ENH: Autoupdate hooks [pre-commit.ci]"
autoupdate_schedule: monthly
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-ast # Simply check whether the files parse as valid python
- id: check-yaml # Attempts to load all yaml files to verify syntax
- id: check-added-large-files # Prevent giant files from being committed
- id: check-docstring-first # Checks a common error of defining a docstring after code
- id: check-merge-conflict # Check for files that contain merge conflict strings
- id: detect-private-key # Detects the presence of private keys
- id: end-of-file-fixer # Ensures that a file is either empty, or ends with one newline
- id: trailing-whitespace # This hook trims trailing whitespace
- id: mixed-line-ending # Replaces or checks mixed line ending
- id: check-shebang-scripts-are-executable # Checks that scripts with shebangs are executable
# The structure of this was suggested by the author of pre-commit and maintainer of flake8
# See https://stackoverflow.com/a/66485642/3956024
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
name: flake8 ./hi-ml/
alias: flake8-hi-ml
files: ^hi-ml/
args: [--config, hi-ml/.flake8]
- id: flake8
name: flake8 ./hi-ml-azure/
alias: flake8-hi-ml-azure
files: ^hi-ml-azure/
args: [--config, hi-ml-azure/.flake8]
- id: flake8
name: flake8 ./hi-ml-cpath/
alias: flake8-hi-ml-cpath
files: ^hi-ml-cpath/
args: [--config, hi-ml-cpath/.flake8]
ENH: Add text and image inference code for CXR multimodal (#438) * add image encoder and utils * update the imports * add file headers * pin the library versions * restructure the dir, add text related code, and update the env * add text inference tests * insert the missing headers * Fix PEP8 issues * Remove placeholder files * flake8 fixes * update the env and add img model tests * fix image related tests and environment * cosmetic changes related to linters * add test image preprocessing * update the test env * update env * pr comments -- env update * fix mypy and add text module * add tests for cxrbert * revert * mypy - pyright disable * Add minor edits to io module * Add __init__ files * Fix some mypy errors * add image and text inference engines * add init * add headers and update docstrings * sort imports * Unify imports * Replace Health Intelligence with Health Futures * Update GitHub workflow * Add multimodal package to flake8 checks * Fix flake8 errors * test pretrained checkpoint * remove unused par * Add phrase grounding notebook * pretrained path -- image model * add ipython in the env for notebooks * Fix incorrect install command in CI workflow * move visualisation and update the notebook * update the import * Remove phrase grounding example Python file * Use linear interpolation for similarity maps * Stop trying to compute and upload coverage * Fix float comparison in test * add another demo example, unifying plotting * Fix some mypy errors * Fix similarity map indexing * Fix warning about interpolation * Remove hard-coded strings from notebook * Ignore mypy error in test * Add typing hints to visualization function * flake8 * Start adding docs * Move notebook outside Python package * Run notebook in CI * Move requirement * Add call to pytest and install kernel for papermill * Move requirements to file * Improve docstring by adding info on percentiles * Use Path class for path parameter * Add typing hints in notebook functions * Add clarifying comment * Move notebooks command to local Makefile * Remove unused variables * Add docstrings to visualization functions * Add Microsoft file header * Launch CI tests also when hi-ml changes * Pass list of transforms to validation function * Fix docstring * Update typing hints * Update kwarg name * Fix docstring * Replace hard-coded variable with kwarg * Declare variable before the line in which it is used * Fix type of returned value * Rename class and fix docstrings * Fix docstring * Improve some docstrings * Improve assertion * Replace import with type definition * Stop initializing list in kwarg * Fix docstring * Fix docstring * Fix docstring * Fix docstring * Remove old comment from ImageTextInferenceEngine docstring * Update docstring for get_patch_embeddings_from_image * Apply docstring suggestion for get_patch_embeddings_from_image Co-authored-by: Fernando Pérez-García <fepegar@gmail.com> * Stop running multimodal tests when the hi-ml libraries change. * Fix docstring * Use double quotes for consistency * Improve error message and add ResNet enum * Update docstring for tokenize_input_prompts * Refactor some requirements * Add missing requirement * Stop installing hi-ml-azure in CI * Install all requirements in CI * Install all requirements in CI before pytest * Add missing run requirements * Ignore mypy error * Upgrade Pillow to 9.0.1 to avoid security flag * Add some VLP unit tests * Improve check for special tokens * Add missing Microsoft headers * Remove some unused test requirements * Allow [MASK] token in TextInput prompts * Update docstring for MultiTaskModel * Add __init__ file * Fix docstring * Read requirements from files in Conda YAML * Enable members documentation by default * Add multimodal folder to docs conf path * Add multimodal run requirements to RTD requirements * Stop ignoring multimodal API rst file * Git-add multimodal API file * Fix docstrings * Refactor API documentation * Use package description file for docs Co-authored-by: Fernando Pérez-García <fperezgarcia@microsoft.com> Co-authored-by: Shruthi42 <13177030+Shruthi42@users.noreply.github.com> Co-authored-by: Fernando Pérez-García <fepegar@gmail.com>
2022-06-27 14:02:55 +03:00
- id: flake8
name: flake8 ./hi-ml-multimodal/
alias: flake8-hi-ml-multimodal
files: ^hi-ml-multimodal/
args: [--config, hi-ml-multimodal/.flake8]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
extend-exclude: ^docs/source/amulet/amulet_script.py
args: [--line-length, "120", --skip-string-normalization]