Skip to content

Commit a6d775f

Browse files
Add black formatter to pre-commit (#143)
* Run `ruff-format` on codebase * Add .pre-commit, ignore large format commit * Use `black` instead with string processing * remove large file check * Update src/s1reader/s1_burst_slc.py Starting to address #141 Co-authored-by: Sara Mirzaee <[email protected]> --------- Co-authored-by: Sara Mirzaee <[email protected]>
1 parent bb585c7 commit a6d775f

21 files changed

+1822
-1360
lines changed

Diff for: .git-blame-ignore-revs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# .git-blame-ignore-revs
2+
# Run ruff-format on codebase
3+
b3f11b8ab7814094a433ff23852bd1e52eb8bbbd

Diff for: .github/ISSUE_TEMPLATE/feature_request.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ body:
4141
id: description
4242
attributes:
4343
label: Describe the feature request
44-
description: A clear and concise description of your request.
44+
description: A clear and concise description of your request.
4545
placeholder: Tell us what you want
4646
value: "I need or want [...]"
4747
validations:

Diff for: .pre-commit-config.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ci:
2+
autofix_prs: true
3+
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: "v5.0.0"
7+
hooks:
8+
- id: check-case-conflict
9+
- id: check-docstring-first
10+
- id: check-merge-conflict
11+
- id: check-yaml
12+
args: [--allow-multiple-documents]
13+
- id: debug-statements
14+
- id: end-of-file-fixer
15+
- id: file-contents-sorter
16+
files: (requirements.txt)$
17+
- id: mixed-line-ending
18+
- id: trailing-whitespace
19+
20+
- repo: https://github.com/psf/black
21+
rev: "25.1.0"
22+
hooks:
23+
- id: black
24+
args: [--preview, --enable-unstable-feature, string_processing]

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Create ISCE3-compatible Sentinel1 burst class given:
1313

1414
Creates a Burst ID based on [ESA's published burst ID maps](https://sentinel.esa.int/web/sentinel/-/publication-of-brust-id-maps-for-copernicus-sentinel-1/1.1).
1515

16-
🚨 This toolbox is still in **pre-alpha** stage and undergoing **rapid development**. 🚨
16+
🚨 This toolbox is still in **pre-alpha** stage and undergoing **rapid development**. 🚨
1717

1818
## Install
1919

Diff for: bin/s1_read.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
import s1reader
55

66
if __name__ == "__main__":
7-
'''testing script that prints burst info and write SLC to file'''
7+
"""testing script that prints burst info and write SLC to file"""
88
# TODO replace with argparse
99
path = sys.argv[1]
1010
if not os.path.exists(path):
1111
raise FileNotFoundError(f"{path} does not exist")
1212

1313
i_subswath = int(sys.argv[2])
14-
if i_subswath < 1 or i_subswath > 3:
14+
if i_subswath < 1 or i_subswath > 3:
1515
raise ValueError("i_subswath not <1 or >3")
1616

1717
pol = sys.argv[3]
18-
pols = ['vv', 'vh', 'hh', 'hv']
18+
pols = ["vv", "vh", "hh", "hv"]
1919
if pol not in pols:
2020
raise ValueError("polarization not in {pols}")
2121

@@ -31,8 +31,8 @@
3131
print(burst.burst_id, burst.center)
3232

3333
# write to ENVI (default)
34-
burst.slc_to_file('burst.slc')
34+
burst.slc_to_file("burst.slc")
3535
# write to geotiff
36-
burst.slc_to_file('burst.tif', 'GTiff')
36+
burst.slc_to_file("burst.tif", "GTiff")
3737
# write to VRT
38-
burst.slc_to_file('burst.vrt', 'VRT')
38+
burst.slc_to_file("burst.vrt", "VRT")

Diff for: requirements.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
python>=3.8
2-
numpy
1+
#isce3 # since the conda-installed isce3 is not the most updated version, installing isce3 from stratch is recommended, to stay in sync with isce3 development.
32
gdal
3+
lxml
4+
numpy
45
packaging
6+
python>=3.8
57
requests
6-
#isce3 # since the conda-installed isce3 is not the most updated version, installing isce3 from stratch is recommended, to stay in sync with isce3 development.
78
shapely
8-
lxml

0 commit comments

Comments
 (0)