GeoscienceAustralia / PyRate

A Python tool for estimating velocity and time-series from Interferometric Synthetic Aperture Radar (InSAR) data.
https://geoscienceaustralia.github.io/PyRate/
Apache License 2.0
199 stars 69 forks source link

A whole bunch of pylint warning/error/refactor fixes #384

Open mwheeler opened 2 years ago

mwheeler commented 2 years ago

WARNING: This PR is pretty big, it's a LOT of small fixes all throughout the whole code base. Probably can't be reviewed in one sitting (take your time, go through one file at a time). Thankfully, it's all low risk minor changes.

This PR is specifically intended to address hundreds of pylint warnings/errors & convention guidelines to bring the PyRate code base into a more standardised set of coding paradigms & conventions.

This PR should have absolutely zero impact on processing outcomes, the code should run exactly as it did before this PR.

The primary reason for this is to enable PyRate to use pylint as an additional QA mechanism to keep the quality of the code base maintainable and less prone to error, which will help future refactors (eg: cleaning up shared.py / configuration.py / etc) by giving us an extra tool to ensure we haven't done something wrong / haven't forgotten something.

Before this PR:

Messages by category
--------------------

+-----------+-------+---------+-----------+
|type       |number |previous |difference |
+===========+=======+=========+===========+
|convention |465    |465      |465        |
+-----------+-------+---------+-----------+
|refactor   |85     |85       |85         |
+-----------+-------+---------+-----------+
|warning    |156    |156      |156        |
+-----------+-------+---------+-----------+
|error      |31     |31       |31         |
+-----------+-------+---------+-----------+

After this PR:

Messages by category
--------------------

+-----------+-------+---------+-----------+
|type       |number |previous |difference |
+===========+=======+=========+===========+
|convention |9      |9        |9          |
+-----------+-------+---------+-----------+
|refactor   |29     |32       |32         |
+-----------+-------+---------+-----------+
|warning    |8      |8        |8          |
+-----------+-------+---------+-----------+
|error      |4      |4        |4          |
+-----------+-------+---------+-----------+

The remaining errors/warnings I left in are legitimate problems, however out of scope (or I lack the context/PyRate-knowledge) to fix them immediately (best done in their own PRs).