Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
5477d86
Updated ImageNet example (#1138)
vfdev-5 Jun 18, 2020
a10bf6e
Updated pytorch-version-tests.yml to run cron every day at 00:00 UTC …
anmolsjoshi Jun 18, 2020
454e1a3
Added check_compute_fn argument to EpochMetric and related metrics (#…
anmolsjoshi Jun 19, 2020
04bdede
Docs cosmetics (#1142)
vfdev-5 Jun 19, 2020
676890b
Fix batch size calculation error (#1137)
InCogNiTo124 Jun 21, 2020
0ee7553
Docs updates (#1139)
vfdev-5 Jun 21, 2020
de4c80f
Fixes docs (#1147)
vfdev-5 Jun 21, 2020
f096742
Issue #1115 : pbar persists due to specific rule in tqdm (notebook) w…
sdesrozis Jun 22, 2020
6f51156
Updated codebase such that torch>=1.3 (#1150)
anmolsjoshi Jun 22, 2020
72db3bc
add wandb (#1152)
lavanyashukla Jun 23, 2020
e86ca81
Fixed typo and missing part of "Where to go next" (#1151)
vfdev-5 Jun 23, 2020
3827412
Fixes #1153 (#1154)
vfdev-5 Jun 23, 2020
f061557
Use global_step as priority, if it exists (#1155)
amatsukawa Jun 23, 2020
2d0f30a
Fix TrainsSaver handling of Checkpoint's n_saved (#1135)
jkhenning Jun 23, 2020
543ae1e
Stateful handlers (#1156)
amatsukawa Jun 24, 2020
9a7be7b
Fixes #1162 (#1163)
vfdev-5 Jun 26, 2020
30e826c
Cosmetics (#1164)
vfdev-5 Jun 26, 2020
4e5fb14
update ignite version to 0.5.0 in preparation of next release. (#1158)
erip Jun 26, 2020
515b55a
Create FUNDING.yml
vfdev-5 Jun 27, 2020
05cc7de
Update README.md
vfdev-5 Jul 1, 2020
aa72e2f
Issue 1124 (#1170)
vfdev-5 Jul 1, 2020
4b59484
Improved namings in _XlaDistModel (#1173)
vfdev-5 Jul 2, 2020
ab546ab
Issue 1123 - Improve usage of contrib common methods with other save …
vfdev-5 Jul 2, 2020
c6f0327
Issue 1165 : nccl + torch.cuda not available (#1166)
sdesrozis Jul 2, 2020
cabd9af
Fix typo in the docstring of ModelCheckpoint
vfdev-5 Jul 3, 2020
5ef2581
Fixes failing tests with native dist comp model (#1177)
vfdev-5 Jul 3, 2020
1032093
Set isort to 4.3.21 as it fails on 5.0 (#1180)
vfdev-5 Jul 4, 2020
b53c6ae
improve docs for custom events (#1179)
sdesrozis Jul 5, 2020
f5c20d7
ValueError -> TypeError (#1175)
WrRan Jul 5, 2020
edaa171
Update cifar10 (#1181)
vfdev-5 Jul 7, 2020
7c5d46a
Fix Exception misuse in `ignite.contrib.handlers.base_logger.py` (#1183)
WrRan Jul 7, 2020
37ea5dc
Fixed failing cifar10 test (#1184)
vfdev-5 Jul 7, 2020
cf55d09
Fix Exception misuse in `ignite.contrib.handlers.custom_events.py` (#…
WrRan Jul 8, 2020
cf4ad7f
Update tpu-tests.yml
vfdev-5 Jul 8, 2020
c4c2e53
Fix Exception misuse in `ignite.contrib.engines.common.py` (#1182)
WrRan Jul 8, 2020
ef5fbd6
Refactored test_utils.py into 3 files (#1185)
vfdev-5 Jul 8, 2020
14cdc04
Fix Exception misuse in `ignite.contrib.handlers.lr_finder.py` (#1187)
WrRan Jul 8, 2020
17f4952
Fix Exception misuse in `ignite.contrib.handlers.mlflow_logger.py` (#…
WrRan Jul 8, 2020
e09a305
Fix Exception misuse in `ignite.contrib.handlers.neptune_logger.py` (…
WrRan Jul 9, 2020
9485328
Update README.md (#1190)
jspisak Jul 9, 2020
b9f3467
fix for distributed proxy sampler runtime error (#1192)
ryanwongsa Jul 9, 2020
67d7c16
Updated timers to include fired hanlders' times (#1104) (#1194)
sdesrozis Jul 10, 2020
64597c7
Improve pascalvoc (#1193)
vfdev-5 Jul 10, 2020
31c1dcc
Custom filename pattern for saving checkpoints (#1127)
Joel-hanson Jul 11, 2020
b4e81fe
Docs update and auto_model change (#1197)
vfdev-5 Jul 13, 2020
0c9d1e4
Minor optimization for idist.get_* (#1196)
vfdev-5 Jul 13, 2020
24b29e8
Propagate spawn kwargs from parallel to model's spawn (#1201)
vfdev-5 Jul 14, 2020
7207c0c
Fixes #1198 - bug with CM in PascalVOC example (#1200)
vfdev-5 Jul 14, 2020
058fe86
Added link to Discuss.PyTorch forum (#1205)
vfdev-5 Jul 16, 2020
de0f6a9
Fixed wrong IoU computation in Pascal VOC (#1204)
vfdev-5 Jul 16, 2020
0266dfb
Fix Typo in `ignite.handlers.timing` (#1208)
WrRan Jul 18, 2020
68d3ba1
Fixes issue with logging XLA tensors (#1207)
vfdev-5 Jul 19, 2020
185320f
REFACTOR: Early Return Pattern (if elif else -> if if return) (#1211)
archsyscall Jul 21, 2020
585236f
Issue 1133 - Fixes flaky Visdom tests (#1149)
sdesrozis Jul 22, 2020
db7e001
Updated about page
vfdev-5 Jul 22, 2020
6faa6ac
Replaced teaser code by a notebook runnable in Colab (#1216)
vfdev-5 Jul 24, 2020
ddb1eab
Added support of Horovod (#1195)
vfdev-5 Aug 3, 2020
4a7428c
metrics: add SSIM (#1217)
Aug 4, 2020
3395eac
add the EpochOutputStore with tests (#1226)
ZhiliangWu Aug 5, 2020
f044948
add horovod test (#1230) (#1231)
vfdev-5 Aug 6, 2020
44c6056
Update README.md
vfdev-5 Aug 17, 2020
2dd5ddf
Added idist.broadcast (#1237)
vfdev-5 Aug 19, 2020
a82d890
Docker for users #1214 (#1218)
fco-dv Aug 20, 2020
2edefd2
[BC-breaking] NotImplementedError -> NotImplemented (#1178)
WrRan Aug 25, 2020
c2c4a36
Allow passing keyword arguments to save function on checkpoint. (#1245)
kilianyp Aug 25, 2020
11a7918
Docs updates and fix of black version (#1250)
vfdev-5 Aug 27, 2020
71129ea
Update governance.rst
vfdev-5 Aug 27, 2020
9d88232
Fix Exception misuse in `ignite.contrib.handlers.param_scheduler.py` …
WrRan Aug 27, 2020
b829473
Issue #1247 (#1252)
Tawishi Aug 28, 2020
c667371
[WIP] Update readme for docker (#1254)
fco-dv Aug 28, 2020
a72a6c6
Update README.md
vfdev-5 Aug 29, 2020
ab3a117
Update index.rst
vfdev-5 Aug 30, 2020
d8a54f6
Update common.py
vfdev-5 Aug 30, 2020
789958a
Update CONTRIBUTING.md
vfdev-5 Sep 4, 2020
7c9c1f6
[WIP] Added sync_bn to auto_model with tests (#1265)
vfdev-5 Sep 5, 2020
2fd8c79
Added dist support for EpochMetric and other similar metrics (#1229)
vfdev-5 Sep 8, 2020
c9f384c
Fixes #1258 (#1268)
vfdev-5 Sep 8, 2020
2778893
Updated CONTRIBUTING.md (#1275)
vfdev-5 Sep 9, 2020
2028fe6
Rename Epoch to Iterations when using epoch_length with max_epochs=1 …
M3L6H Sep 11, 2020
d92f1c6
Update README.md
vfdev-5 Sep 11, 2020
002b595
[BC-breaking] Make Metrics accumulate values on device specified by u…
vfdev-5 Sep 11, 2020
ef985db
Specify tqdm to be less than or equal to v4.48.0 (#1293)
benji011 Sep 15, 2020
51fc9ca
Fixes #1285 (#1290)
vfdev-5 Sep 15, 2020
b6c96a0
Issue 1249 : fix ParamGroupScheduler with schedulers based on differe…
sdesrozis Sep 15, 2020
766167e
remove prints (#1292)
nzare Sep 15, 2020
564e541
Fix link to pytorch documents (#1294)
kamahori Sep 15, 2020
d4f7252
Added required_output_keys public attribute (1289) (#1291)
vfdev-5 Sep 15, 2020
b2af4f4
Fixed typo in docs (concepts). (#1295)
theodumont Sep 15, 2020
d206ac9
Setup Mypy check at CI step (#1296)
kenjihiraoka Sep 16, 2020
28fbd2a
Update README.md
vfdev-5 Sep 16, 2020
ef02104
Docker for users with Horovod (#1248)
fco-dv Sep 16, 2020
e6ef77d
Added input data type check (#1301)
vfdev-5 Sep 17, 2020
4578af1
Update metrics.rst
vfdev-5 Sep 18, 2020
d1f33ac
Docker for users with MSDeepSpeed (#1304)
fco-dv Sep 18, 2020
0c41778
Update README.md
vfdev-5 Sep 18, 2020
936ef53
Updated hvd images + scripts (#1306)
vfdev-5 Sep 22, 2020
f9d5434
Update BatchFiltered docstring
vfdev-5 Sep 23, 2020
fca0c95
Improve Canberra metric (#1312)
sdesrozis Sep 23, 2020
540b814
Improve Canberra metric for DDP (#1314)
sdesrozis Sep 24, 2020
4f81d37
Improve ManhattanDistance metric for DDP (#1320)
sdesrozis Sep 24, 2020
bf621a4
Update README.md
vfdev-5 Sep 24, 2020
1808fb5
Update about.rst
vfdev-5 Sep 24, 2020
9525630
Update Circle CI docker image to pytorch 1.6.0 (#1325)
Amab Sep 26, 2020
87be305
Update CONTRIBUTING.md
vfdev-5 Sep 26, 2020
9c7e919
Add new logo (#1324)
isabela-pf Sep 26, 2020
6026e64
Fixed CI on GPUs with pth 1.6.0 (#1326)
vfdev-5 Sep 26, 2020
58d7c09
Updated about us (#1327)
vfdev-5 Sep 28, 2020
c1b5d2f
Improve R2Score metric for DDP (#1318)
sdesrozis Sep 28, 2020
51d3e3e
Fix canberra docstring : reference already in namespace (#1330)
sdesrozis Sep 28, 2020
a6664de
Improve State and Engine docs #1259 (#1333)
fco-dv Oct 2, 2020
c116703
#1336 missing link in doc fix (#1337)
sroy8091 Oct 2, 2020
f86d42e
Make SSIM accumulate on specified device (#1328)
n2cholas Oct 2, 2020
d384dc6
Update documentation for terminate Events (#1338)
shngt Oct 3, 2020
20167fe
Update README.md
vfdev-5 Oct 3, 2020
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
86 changes: 85 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ parameters:
pytorch_stable_image:
type: string
# https://hub.docker.com/r/pytorch/pytorch/tags
default: "pytorch/pytorch:1.5-cuda10.1-cudnn7-runtime"
default: "pytorch/pytorch:1.6.0-cuda10.1-cudnn7-runtime"
pytorch_stable_image_devel:
type: string
# https://hub.docker.com/r/pytorch/pytorch/tags
default: "pytorch/pytorch:1.6.0-cuda10.1-cudnn7-devel"
workingdir:
type: string
default: "/tmp/ignite"
Expand Down Expand Up @@ -40,6 +44,12 @@ pull_pytorch_stable_image: &pull_pytorch_stable_image
command: |
docker pull << pipeline.parameters.pytorch_stable_image >>

pull_pytorch_stable_devel_image: &pull_pytorch_stable_devel_image
- run:
name: Pull PyTorch Stable Develop Image
command: |
docker pull << pipeline.parameters.pytorch_stable_image_devel >>


run_pytorch_container: &run_pytorch_container
- run:
Expand All @@ -51,6 +61,17 @@ run_pytorch_container: &run_pytorch_container
docker exec -it pthd nvidia-smi
docker exec -it pthd ls


run_pytorch_devel_container: &run_pytorch_devel_container
- run:
name: Start Pytorch dev container
environment:
wd: << pipeline.parameters.workingdir >>
command: |
docker run --gpus=all --rm -itd --shm-size 16G -v ${wd}:/ignite -w /ignite --name pthd << pipeline.parameters.pytorch_stable_image_devel >>
docker exec -it pthd nvidia-smi
docker exec -it pthd ls

install_dependencies: &install_dependencies
- run:
name: Install dependencies
Expand Down Expand Up @@ -194,6 +215,68 @@ jobs:
docker exec -it pthd /bin/bash -c "${test_cmd} --num_epochs=7 ${resume_opt}"


two_gpus_hvd_tests:
<<: *two_gpus

working_directory: << pipeline.parameters.workingdir >>

steps:
- checkout
- <<: *pull_pytorch_stable_devel_image
- <<: *run_pytorch_devel_container
- <<: *install_dependencies
- run:
name: "Install Horovod with NCCL GPU ops"
command: |

# Following https://github.com/horovod/horovod/blob/master/Dockerfile.test.gpu
# and https://github.com/horovod/horovod/issues/1944#issuecomment-628192778
docker exec -it pthd /bin/bash -c "apt-get update && apt-get install -y git"
docker exec -it pthd /bin/bash -c "git clone --recursive https://github.com/horovod/horovod.git /horovod && cd /horovod && python setup.py sdist"
docker exec -it pthd /bin/bash -c "conda install -y cmake=3.16 nccl=2.7 -c conda-forge"
docker exec -it pthd /bin/bash -c 'cd /horovod && HOROVOD_GPU_OPERATIONS=NCCL HOROVOD_NCCL_LINK=SHARED HOROVOD_WITHOUT_MPI=1 HOROVOD_WITH_PYTORCH=1 pip install -v $(ls /horovod/dist/horovod-*.tar.gz) && ldconfig'
docker exec -it pthd horovodrun --check-build

- run:
name: Run 1 Node 2 GPUs Unit Tests
command: |
export test_cmd='sh tests/run_gpu_tests.sh'
docker exec -it pthd /bin/bash -c "${test_cmd}"
# no CUDA devices Horovod tests
export test_cmd='CUDA_VISIBLE_DEVICES="" py.test --cov ignite --cov-append --cov-report term-missing --cov-report xml -vvv tests/ -m distributed'
docker exec -it pthd /bin/bash -c "${test_cmd}"

- run:
name: Codecov upload
command: |
bash <(curl -s https://codecov.io/bash) -Z -F gpu-2-hvd

- run:
name: "Check CIFAR10 using horovodrun"
command: |
docker exec -it pthd pip install fire
export example_path="examples/contrib/cifar10"
# initial run
export stop_cmd="--stop_iteration=500"
export test_cmd="cd ${example_path} && CI=1 horovodrun -np 2 python -u main.py run --backend=horovod"
docker exec -it pthd /bin/bash -c "${test_cmd} ${stop_cmd}"
# resume
export resume_opt="--resume-from=/tmp/output-cifar10/resnet18_backend-horovod-2_stop-on-500/training_checkpoint_400.pt"
docker exec -it pthd /bin/bash -c "${test_cmd} --num_epochs=7 ${resume_opt}"

- run:
name: "Check CIFAR10 using spawn"
command: |
export example_path="examples/contrib/cifar10"
# initial run
export stop_cmd="--stop_iteration=500"
export test_cmd="cd ${example_path} && CI=1 python -u main.py run --backend=horovod --nproc_per_node=2"
docker exec -it pthd /bin/bash -c "${test_cmd} ${stop_cmd}"
# resume
export resume_opt="--resume-from=/tmp/output-cifar10/resnet18_backend-horovod-2_stop-on-500/training_checkpoint_400.pt"
docker exec -it pthd /bin/bash -c "${test_cmd} --num_epochs=7 ${resume_opt}"


# -------------------------------------------------------------------------------------
# Workflows
# -------------------------------------------------------------------------------------
Expand All @@ -204,3 +287,4 @@ workflows:
- one_gpu_tests
- two_gpus_tests
- two_gpus_check_dist_cifar10_example
- two_gpus_hvd_tests
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: [vfdev-5, ] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
2 changes: 1 addition & 1 deletion .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
with:
python-version: '3.7'
- run: |
python -m pip install autopep8 black isort
python -m pip install autopep8 "black==19.10b0" "isort==4.3.21"
isort -rc .
autopep8 --recursive --in-place --aggressive --aggressive .
black .
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/pytorch-version-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
schedule:
# Run at 00:00 UTC on Sunday
- cron: '0 0 * * 0'
# Run at 00:00 UTC Every Day
- cron: '0 0 * * *'

jobs:
build:
Expand All @@ -11,16 +11,10 @@ jobs:
fail-fast: false
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]
pytorch-version: [1.4.0, 1.3.1, 1.2.0, 1.1.0, 1.0.1]
pytorch-version: [1.5.1, 1.4.0, 1.3.1]
exclude:
- pytorch-version: 1.3.1
python-version: 3.8
- pytorch-version: 1.2.0
python-version: 3.8
- pytorch-version: 1.1.0
python-version: 3.8
- pytorch-version: 1.0.1
python-version: 3.8

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: '3.6'
python-version: '3.6.10'
architecture: 'x64'

- name: Install Torch XLA and others
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ jobs:
shell: bash -l {0}
run: |
conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }}
# Keep fix in case of problem with torchvision nightly releases
pip install -r requirements-dev.txt
# Fixes #1153
pip install --upgrade scipy==1.4.1
python setup.py install

- name: Run Tests
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ jobs:
- stage: Lint check
python: "3.7"
before_install: # Nothing to do
install: pip install flake8 black isort
install: pip install flake8 "black==19.10b0" "isort==4.3.21" "mypy==0.782"
script:
- flake8 .
- black --check .
- isort -rc -c .
- mypy --config-file mypy.ini
after_success: # Nothing to do

# GitHub Pages Deployment: https://docs.travis-ci.com/user/deployment/pages/
Expand Down
8 changes: 8 additions & 0 deletions CITATION
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@misc{pytorch-ignite,
author = {V. Fomin and J. Anmol and S. Desroziers and J. Kriss and A. Tejani},
title = {High-level library to help with training neural networks in PyTorch},
year = {2020},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/pytorch/ignite}},
}
107 changes: 88 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,34 @@ If you find a typo in the documentation, do not hesitate to submit a GitHub pull
- Pick an issue and comment on the task that you want to work on this feature.
- If you need more context on a particular issue, please ask and we shall provide.


## Developing Ignite

### Installation

To get the development installation with the necessary dependencies, run the following:
```bash
git clone https://github.com/pytorch/ignite.git
cd ignite
python setup.py develop
pip install -r requirements-dev.txt
pip install flake8 "black==19.10b0" "isort==4.3.21" "mypy==0.782"
```

### Code development

#### Codebase structure

- [ignite](ignite) - Core library files
- [engine](ignite/engine) - Module containing core classes like Engine, Events, State.
- [handlers](ignite/handlers) - Module containing out-of-the-box handlers
- [metrics](ignite/metrics) - Module containing out-of-the-box metrics
- [contrib](ignite/contrib) - Contrib module with other metrics, handlers classes that may require additional dependencies
- [distributed](ignite/distributed) - Module with helpers for distributed computations
- [tests](tests) - Python unit tests
- [examples](examples) - Examples and notebook tutorials
- [docs](docs) - Documentation files

If you modify the code, you will most probably also need to code some tests to ensure the correct behaviour. We are using
`pytest` to write our tests:
- naming convention for files `test_*.py`, e.g. `test_precision.py`
Expand All @@ -34,25 +62,34 @@ If you modify the code, you will most probably also need to code some tests to e
New code should be compatible with Python 3.X versions. Once you finish implementing a feature or bugfix and tests,
please run lint checking and tests:

#### Formatting Code without pre-commit
If you choose not to use pre-commit, you can take advantage of IDE extensions configured to black format or invoke black manually to format files and commit them.
#### Formatting Code

To ensure the codebase complies with a style guide, we use [flake8](https://flake8.pycqa.org/en/latest/),
[black](https://black.readthedocs.io/en/stable/) and [isort](https://pycqa.github.io/isort/) tools to
format and check codebase for compliance with PEP8.

##### Formatting without pre-commit

If you choose not to use pre-commit, you can take advantage of IDE extensions configured to black format or invoke
black manually to format files and commit them.

```bash
pip install black
black .
# This should autoformat the files
isort -rc .
black .
# Run lint checking
flake8 ignite/ tests/ examples/
# If everything is OK, then commit
git add .
git commit -m "....."
git commit -m "Added awesome feature"
```

#### with pre-commit

To ensure the codebase complies with a style guide, we use [black](https://black.readthedocs.io/en/stable/) and [flake8](https://flake8.pycqa.org/en/latest/) to format and check codebase for compliance with PEP8.
#### Formatting with pre-commit

To automate the process, we have configured the repo with [pre-commit hooks](https://pre-commit.com/) to use black to autoformat the staged files to ensure every commit complies with a style guide. This requires some setup, which is described below:

1. Install pre-commit in your python environment.
2. Run pre-commit install that configures a virtual environment to invoke black and flake8 on commits.
2. Run pre-commit install that configures a virtual environment to invoke black, isort and flake8 on commits.

```bash
pip install pre-commit
Expand All @@ -67,25 +104,20 @@ pre-commit install
git add .
git commit -m "Added awesome feature"
# DONT'T WORRY IF ERRORS ARE RAISED.
# YOUR CODE IS NOT COMPLIANT WITH FLAKE8 or BLACK
# YOUR CODE IS NOT COMPLIANT WITH flake8, isort or black
# Fix any flake8 errors by following their suggestions
# black will automatically format the files so they might look different, but you'll need to stage the files again for committing
# isort and black will automatically format the files so they might look different, but you'll need to stage the files
# again for committing
# After fixing any flake8 errors
git add .
git commit -m "Added feature"
```


#### Run lint checking
```bash
flake8 ignite/ tests/ examples/
```

#### Run tests:

To run a specific test, for example `test_terminate` from `test_engine.py`
```bash
pytest tests/ignite/engine/test_terminate -vvv -k test_terminate
pytest tests/ignite/engine/test_engine.py -vvv -k test_terminate
```
To run all tests with coverage (assuming installed `pytest-cov`):
```bash
Expand All @@ -94,6 +126,14 @@ CI_PYTHON_VERSION=<your python version, e.g 3.7> sh tests/run_cpu_tests.sh
# CI_PYTHON_VERSION=3.7 sh tests/run_cpu_tests.sh
```

#### Run Mypy checks:
To run mypy to check the optional static type:
```bash
mypy --config-file mypy.ini
```

To change any config for specif folder, please see the file mypy.ini

#### Send a PR

If everything is OK, please send a Pull Request to https://github.com/pytorch/ignite
Expand All @@ -103,7 +143,36 @@ If you are not familiar with creating a Pull Request, here are some guides:
- https://help.github.com/articles/creating-a-pull-request/


## Writing documentation
### Writing documentation

Ignite uses [Google style](http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
for formatting docstrings. Length of line inside docstrings block must be limited to 120 characters.

#### Local documentation building and deploying

Please, follow the instructions to build and deploy the documentation locally.

##### Install requirements

```bash
cd docs
pip install -r requirements.txt
```

##### Build

```bash
cd docs
make html
```

##### Local deployment

Please, use python 3.X for the command below:
```bash
cd docs/build
python -m http.server <port>
# python -m http.server 1234
```
Then open the browser at `0.0.0.0:<port>` (e.g. `0.0.0.0:1234`) and click to `html` folder.

Loading