Skip to content

Latest commit

 

History

History
95 lines (76 loc) · 4.35 KB

CONTRIBUTING.md

File metadata and controls

95 lines (76 loc) · 4.35 KB

How to Contribute to GSTools

We are happy about all contributions! 👍

Did you find a bug?

  • Ensure that the bug was not already reported under GitHub issues
  • If the bug wasn't already reported, open a new issue with a clear description of the problem and if possible with a minimal working example.
  • please add the version number to the issue:
import gstools
print(gstools.__version__)

Do you have suggestions for new features?

Open a new issue with your idea or suggestion and we'd love to discuss about it.

Do you want to enhance GSTools or fix something?

  • Fork the repo on GitHub
  • Add yourself to AUTHORS.md (if you want to).
  • We use black and isort to format our code. Please use the scripts black . and isort . after you have written your code.
  • Add some tests if possible.
  • Add an example showing your new feature in one of the examples sub-folders if possible. Follow this Sphinx-Gallary guide.
  • Push to your fork and submit a pull request.

PyLint Settings

Your code will be checked by Pylint with pylint gstools in the CI. We made some generous default settings in pyproject.toml for the linter:

  • max-args = 20
  • max-locals = 50
  • max-branches = 30
  • max-statements = 80
  • max-attributes = 25
  • max-public-methods = 75

Since some classes in GSTools are quite huge and some function signatures are somewhat longish.

By default R0801 (duplicate-code) is disabled, since it produces a lot of false positive errors for docstrings and __init__.py settings.

We also disabled some pylint checks for some files by setting comments like these at the beginning:

# pylint: disable=C0103

Here is a list of the occurring disabled errors:

  • C0103 (invalid-name) - ax, r etc. are marked as no valid names
  • C0302 (too-many-lines) - namely the CovModel definition has more than 1000 lines
  • C0415 (import-outside-toplevel) - needed sometimes for deferred imports of optional dependencies like matplotlib
  • R0201 (no-self-use) - methods with no self calls in some base-classes
  • W0212 (protected-access) - we didn't want to draw attention to CovModel._prec
  • W0221 (arguments-differ) - the __call__ methods of SRF and Krige differ from Field
  • W0222 (signature-differ) - the __call__ methods of SRF and Krige differ from Field
  • W0231 (super-init-not-called) - some child classes have their specialized __init__
  • W0613 (unused-argument) - needed sometimes to match required call signatures
  • W0632 (unbalanced-tuple-unpacking) - false positive for some call returns
  • E1101 (no-member) - some times false positive
  • E1102 (not-callable) - this is a false-positive result form some called properties
  • E1130 (invalid-unary-operand-type) - false positive at some points

Although we disabled these errors at some points, we encourage you to prevent disabling errors when it is possible.