Skip to content

Commit

Permalink
MNT: add pre-commit (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuehlbauer committed Jun 8, 2022
1 parent f570e2a commit 4911a49
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cancel.yml
Expand Up @@ -12,4 +12,4 @@ jobs:
steps:
- uses: styfle/cancel-workflow-action@0.9.1
with:
workflow_id: ${{ github.event.workflow.id }}
workflow_id: ${{ github.event.workflow.id }}
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,26 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements
- id: mixed-line-ending
- repo: https://github.com/myint/autoflake
rev: "v1.4"
hooks:
- id: autoflake
args: ["--in-place", "--ignore-init-module-imports"]
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -34,5 +34,3 @@ For this purpose, you need to have a [GitHub Account](https://github.com/signup/
## Development

To keep the code as clean as much all code contributions should be in line with [PEP 8](https://www.python.org/dev/peps/pep-0008/) conventions.


2 changes: 1 addition & 1 deletion LICENSE.txt
Expand Up @@ -6,4 +6,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -36,7 +36,7 @@ You can cite wradlib using the DOI below, or select the fitting zenodo DOI if yo

### User forum ###

In order to stay tuned, we recommend that you register to the [wradlib user forum and mailing list](https://groups.google.com/forum/?fromgroups#!forum/wradlib-users).
In order to stay tuned, we recommend that you register to the [wradlib user forum and mailing list](https://groups.google.com/forum/?fromgroups#!forum/wradlib-users).

### Found any bugs or want to add wishes ###

Expand Down
1 change: 1 addition & 0 deletions requirements_devel.txt
Expand Up @@ -2,6 +2,7 @@ codecov
coverage
nbconvert
nbformat
pre-commit
pytest
pytest-cov
pytest-doctestplus
Expand Down
2 changes: 1 addition & 1 deletion requirements_optional.txt
Expand Up @@ -6,4 +6,4 @@ h5netcdf
h5py
netCDF4
requests
xmltodict
xmltodict
2 changes: 1 addition & 1 deletion scripts/run_tests_profile.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright (c) 2011-2020, wradlib developers.
# Distributed under the MIT License. See LICENSE.txt for more info.
# Example:run_tests_profile.sh "wradlib.tests.test_io" "XarrayTests().test_read_odim()"
# Example:run_tests_profile.sh "wradlib.tests.test_io" "XarrayTests().test_read_odim()"

set -e

Expand Down
2 changes: 0 additions & 2 deletions wradlib/adjust.py
Expand Up @@ -308,14 +308,12 @@ def __call__(self, obs, raw, targets=None, rawatobs=None, ix=None):
(defaults to None)
"""
pass

def _check_shape(self, obs, raw):
"""INTERNAL: Check consistency of the input data obs and raw with
the shapes of the coordinates
"""
# TODO
pass

def _get_valid_pairs(self, obs, raw):
"""INTERNAL: Helper method to identify valid obs-raw pairs"""
Expand Down
2 changes: 0 additions & 2 deletions wradlib/atten.py
Expand Up @@ -40,8 +40,6 @@ class AttenuationOverflowError(Exception):
Exception, if attenuation exceeds ``thrs`` and no handling ``mode`` is set.
"""

pass


def correct_attenuation_hb(
gateset,
Expand Down
4 changes: 0 additions & 4 deletions wradlib/ipol.py
Expand Up @@ -55,14 +55,10 @@
class MissingSourcesError(Exception):
"""Is raised in case no source coordinates are available for interpolation."""

pass


class MissingTargetsError(Exception):
"""Is raised in case no interpolation targets are available."""

pass


class IpolBase:
"""
Expand Down
3 changes: 1 addition & 2 deletions wradlib/speedup.f
Expand Up @@ -17,7 +17,7 @@ SUBROUTINE F_UNFOLD_PHI(PHIDP, RHO, GRADPHI, STDARR, BEAMS, RS, W)

C iterate over all beams
DO beam=1, beams

IF ( ALL(phidp(beam,1:(rs-w_))==0) ) THEN
PRINT *, "empty beam at:", beam
EXIT
Expand Down Expand Up @@ -69,4 +69,3 @@ SUBROUTINE F_UNFOLD_PHI(PHIDP, RHO, GRADPHI, STDARR, BEAMS, RS, W)
ENDDO
ENDDO
END

0 comments on commit 4911a49

Please sign in to comment.