Skip to content

Commit 7e36e6a

Browse files
authored
setup pre-commit hook + initial run against all files (#852)
+ install pre-commit GitHub Apps + add `.pre-commit-config.yaml` + changes from the initial run of pre-commit against all files - end-of-file-fixer - trailing-whitespace - sort imports via isort - modernize python via pyupgrade + info: printout h5 dataset compression info + tests: consistent script header comments + utils.readfile: use MACRO_CASE global var - replace standardMetadataKeys with STD_METADATA_KEYS
1 parent 73f4e28 commit 7e36e6a

File tree

253 files changed

+2359
-2284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+2359
-2284
lines changed

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ assignees: ''
2929
<!-- Add any other context about the feature request here. -->
3030

3131

32-
**Are you willing to help implement and maintain this feature?**
32+
**Are you willing to help implement and maintain this feature?**
3333

3434
- [ ] Yes
3535
- [ ] No
3636

3737
<!-- Every feature we add is code that we will have to maintain and keep updated. This takes a lot of effort. If you are willing to be involved in the project and help maintain your feature, it will make it easier for us to accept it. -->
38-

.github/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ newPRWelcomeComment: >
2020

2121
# Comment to be posted to on pull requests merged by a first time user
2222
firstPRMergeComment: >
23-
🎉 🎉 🎉 Congrats on merging your first pull request! We here at behaviorbot are proud of you! 🎉 🎉 🎉
23+
🎉 🎉 🎉 Congrats on merging your first pull request! We here at behaviorbot are proud of you! 🎉 🎉 🎉
2424
2525
# It is recommend to include as many gifs and emojis as possible

.github/workflows/publish-to-test-pypi.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,3 @@ jobs:
5555
with:
5656
password: ${{ secrets.PYPI_API_TOKEN }}
5757
verbose: true
58-

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,4 @@ venv.bak/
131131
dmypy.json
132132

133133
# Pyre type checker
134-
.pyre/
134+
.pyre/

.pre-commit-config.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
ci:
4+
autofix_prs: false
5+
6+
fail_fast: true
7+
8+
repos:
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: "v4.3.0"
11+
hooks:
12+
- id: check-added-large-files
13+
args: ['--maxkb=20']
14+
exclude_types: [image]
15+
- id: check-ast
16+
- id: check-case-conflict
17+
- id: check-docstring-first
18+
- id: check-merge-conflict
19+
- id: check-json
20+
- id: check-toml
21+
- id: check-yaml
22+
- id: debug-statements
23+
- id: end-of-file-fixer
24+
- id: mixed-line-ending
25+
- id: trailing-whitespace
26+
exclude: tests/data/
27+
28+
- repo: https://github.com/PyCQA/isort
29+
rev: "5.10.1"
30+
hooks:
31+
- id: isort
32+
name: sort imports
33+
args: ['--multi-line=VERTICAL_HANGING_INDENT',
34+
'--trailing-comma',
35+
'--combine-as']
36+
37+
- repo: https://github.com/asottile/pyupgrade
38+
rev: "v2.37.3"
39+
hooks:
40+
- id: pyupgrade
41+
name: modernize python
42+
args: ['--py36-plus']
43+
44+
45+
############################################################
46+
#- repo: https://github.com/psf/black
47+
# rev: "22.6.0"
48+
# hooks:
49+
# - id: black
50+
51+
#- repo: https://github.com/PyCQA/flake8
52+
# rev: "5.0.4"
53+
# hooks:
54+
# - id: flake8
55+
56+
#- repo: https://github.com/pre-commit/mirrors-mypy
57+
# rev: "v0.971"
58+
# hooks:
59+
# - id: mypy
60+
61+
#- repo: https://github.com/hadialqattan/pycln
62+
# rev: "v2.1.1"
63+
# hooks:
64+
# - id: pycln
65+
66+
#- repo: https://github.com/PyCQA/pydocstyle
67+
# rev: "6.1.1"
68+
# hooks:
69+
# - id: pydocstyle
70+
# additional_dependencies: [toml]
71+
# exclude: test
72+
73+
#- repo: https://github.com/sirosen/texthooks
74+
# rev: "0.3.1"
75+
# hooks:
76+
# - id: fix-ligatures
77+
# - id: fix-smartquotes

.readthedocs.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ python:
2222
version: 3.7
2323
install:
2424
- requirements: docs/requirements4rtd.txt
25-

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Copyright (c) 2016, Zhang Yunjun and Heresh Fattahi
22
Copyright (c) 2013, Heresh Fattahi
33

4-
This is free software; you can redistribute it and/or modify it
4+
This is free software; you can redistribute it and/or modify it
55
under the terms of the GNU General Public License as published by
66
the Free Software Foundation; either version 3 of the License, or
77
(at your option) any later version.

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ include docs/README.md
33

44
# Include the license file
55
include LICENSE
6-

docs/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing Guidelines
22

3-
This document is inspired by similar instructions from numpy, GMT, ISCE, gdal and jupyterhub. If you're reading this section, you're probably interested in contributing to MintPy. Welcome and thanks for your interest in contributing!
3+
This document is inspired by similar instructions from numpy, GMT, ISCE, gdal and jupyterhub. If you're reading this section, you're probably interested in contributing to MintPy. Welcome and thanks for your interest in contributing!
44

55
These are several ways to contribute to the MintPy project:
66

@@ -14,7 +14,7 @@ These are several ways to contribute to the MintPy project:
1414
If you get stuck at any point you can open an [issue on GitHub](https://github.com/insarlab/MintPy/issues) or comment on any open issue or pull request or contact us on the [user forum](https://groups.google.com/forum/#!forum/mintpy).
1515

1616
For more information on contributing to open source projects, [GitHub's own guide](https://guides.github.com/activities/contributing-to-open-source/)
17-
is a great starting point if you are new to version control.
17+
is a great starting point if you are new to version control.
1818

1919
## Development process ##
2020

docs/FAQs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ For LOS displacement (velocity) in the unit of meters (m/yr), i.e. 'timeseries'
88

99
### 2. How to prepare the input for MintPy if I am using currently un-supported InSAR softwares?
1010

11-
The input of MintPy routine workflow (`smallbaselineApp.py`) is a stack of unwrapped interferograms. For "stack", we mean all the interferograms (unwrapped phase and spatial coherence) and geometries (DEM, incidence angle, etc.) have the same spatial extent and same spatial resolution, either in geo-coordinates or radar (range-doppler) coordinates. The input has 2 components: data and attributes.
11+
The input of MintPy routine workflow (`smallbaselineApp.py`) is a stack of unwrapped interferograms. For "stack", we mean all the interferograms (unwrapped phase and spatial coherence) and geometries (DEM, incidence angle, etc.) have the same spatial extent and same spatial resolution, either in geo-coordinates or radar (range-doppler) coordinates. The input has 2 components: data and attributes.
1212

1313
All inputs are saved into the following HDF5 files during the data loading process in MintPy:
1414

@@ -52,7 +52,7 @@ Note that MintPy assumes **date1_date2** convention for interferograms (date1 <
5252

5353
#### Attributes
5454

55-
For each data file, MintPy requires some attributes/metadata in `ROI_PAC .rsc` format as described [here](https://mintpy.readthedocs.io/en/latest/api/attributes/). The optional attributes are highly recommend. The interferogram specific attributes (DATE12, P_BASELINE_TOP/BOTTOM_HDR) is not needed for geometry files (DEM, incidence angle, etc.).
55+
For each data file, MintPy requires some attributes/metadata in `ROI_PAC .rsc` format as described [here](https://mintpy.readthedocs.io/en/latest/api/attributes/). The optional attributes are highly recommend. The interferogram specific attributes (DATE12, P_BASELINE_TOP/BOTTOM_HDR) is not needed for geometry files (DEM, incidence angle, etc.).
5656

5757
For the supported InSAR software workflows, we prepare these metadata via `prep_isce.py`, `prep_gamma.py`, etc., to read their native metadata, convert and write them into `ROI_PAC .rsc` style for each data file.
5858

0 commit comments

Comments
 (0)