Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
SkafteNicki authored Mar 15, 2021
2 parents 4dfae65 + 179117b commit ee45fb3
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci_test-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('tests/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-
- name: Install dependencies
run: |
python -m pip install --upgrade --user pip
pip install --requirement ./requirements.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
pip install coverage pytest --quiet --upgrade-strategy only-if-needed
pip install "pytest>6.0" "pytest-cov>2.10" --upgrade-strategy only-if-needed
python --version
pip --version
pip list
Expand All @@ -66,7 +66,7 @@ jobs:
- name: Test Package [only]
run: |
# NOTE: run coverage on tests does not propagare faler status for Win, https://github.com/nedbat/coveragepy/issues/1003
coverage run --source torchmetrics -m pytest torchmetrics -v --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml
python -m pytest torchmetrics -v --cov=torchmetrics --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml
- name: Upload pytest test results
uses: actions/upload-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip-${{ hashFiles('requirements.txt') }}
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('tests/requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip-
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/code-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Check Code formatting
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the master branch
push:
branches: [master]
branches: [master, "release/*"]
pull_request:
branches: [master]
branches: [master, "release/*"]

jobs:
flake8:
Expand All @@ -18,7 +18,7 @@ jobs:
- name: Install dependencies
run: |
pip install flake8
pip --version
pip list
shell: bash
- name: PEP8
run: |
Expand All @@ -33,8 +33,8 @@ jobs:
python-version: 3.8
- name: Install isort
run: |
pip install isort==5.6.4
pip --version
pip install "isort==5.6.4"
pip list
- name: isort
run: |
isort --settings-path=./pyproject.toml . --check --diff
Expand All @@ -48,8 +48,23 @@ jobs:
python-version: 3.8
- name: Install mypy
run: |
pip install mypy
pip install "mypy==0.790"
pip list
- name: mypy
run: |
mypy
# format-check-yapf:
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@master
# - uses: actions/setup-python@v2
# with:
# python-version: 3.8
# - name: Install dependencies
# run: |
# pip install "yapf==0.30"
# pip list
# shell: bash
# - name: yapf
# run: yapf --diff --parallel --recursive .
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ clean:
test: clean env

# run tests with coverage
python -m coverage run --source torchmetrics -m pytest torchmetrics tests -v
python -m pytest torchmetrics tests -v --cov=torchmetrics
python -m coverage report

docs: clean
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pip install torchmetrics
```

<details>
<summary>Other installions</summary>
<summary>Other installations</summary>

Install using conda
```bash
Expand All @@ -69,7 +69,7 @@ pip install https://github.com/PyTorchLightning/metrics/archive/master.zip
TorchMetrics is a collection of 25+ PyTorch metrics implementations and an easy-to-use API to create custom metrics. It offers:

* A standardized interface to increase reproducibility
* Reduces Boilerplate
* Reduces boilerplate
* Automatic accumulation over batches
* Metrics optimized for distributed-training
* Automatic synchronization between multiple devices
Expand Down Expand Up @@ -243,8 +243,8 @@ to get help becoming a contributor!
For help or questions, join our huge community on [Slack](https://join.slack.com/t/pytorch-lightning/shared_invite/zt-f6bl2l0l-JYMK3tbAgAmGRrlNr00f1A)!

## Citations
We’re excited to continue the strong legacy of opensource software and have been inspired over the years by
Caffee, Theano, Keras, PyTorch, torchbearer, ignite, sklearn and fast.ai. When/if a paper is written about this,
We’re excited to continue the strong legacy of open source software and have been inspired over the years by
Caffe, Theano, Keras, PyTorch, torchbearer, ignite, sklearn and fast.ai. When/if a paper is written about this,
we’ll be happy to cite these frameworks and the corresponding authors.

## License
Expand Down
24 changes: 21 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,29 @@ jobs:
displayName: 'Sanity check'
- bash: |
python -m coverage run --source torchmetrics -m pytest torchmetrics tests -v --durations=50
python -m pytest torchmetrics tests -v --cov=torchmetrics --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
displayName: 'Testing'
- bash: |
python -m coverage report
python -m coverage xml
python -m codecov --token=$(CODECOV_TOKEN) --flags=gpu,pytest --name="GPU-coverage" --env=linux,azure
python -m coverage xml -o '$(Build.SourcesDirectory)/coverage.xml'
python -m coverage html
python -m codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,pytest --name="GPU-coverage" --env=linux,azure
ls -l
displayName: 'Statistics'
- task: PublishTestResults@2
displayName: 'Publish test results'
inputs:
testResultsFiles: '$(Build.StagingDirectory)/test-results.xml'
testRunTitle: '$(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)'
condition: succeededOrFailed()

- task: PublishCodeCoverageResults@1
displayName: 'Publish coverage report'
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '$(Build.SourcesDirectory)/coverage.xml'
reportDirectory: '$(Build.SourcesDirectory)/htmlcov'
testRunTitle: '$(Agent.OS) - $(Build.BuildNumber)[$(Agent.JobName)] - Python $(python.version)'
condition: succeededOrFailed()
7 changes: 4 additions & 3 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
coverage>=5.2
coverage>5.2
codecov>=2.1
pytest>=6.0
pytest-cov>2.10
pytest-xdist
# pytest-xdist
# pytest-flake8
flake8
check-manifest
twine>=3.2
isort>=5.0
mypy>=0.720
mypy>=0.790
yapf>=0.29.0

cloudpickle>=1.3
pytorch-lightning>=1.0
Expand Down

0 comments on commit ee45fb3

Please sign in to comment.