Skip to content

Commit a85fdb1

Browse files
authored
Merge pull request #113 from nirabo/feature/integrated-pr111-and-tests
Feature/integrated pr111 and tests
2 parents 491faa7 + e914559 commit a85fdb1

Some content is hidden

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

73 files changed

+52097
-43860
lines changed

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master, feature/** ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
lint-and-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.12'
20+
21+
- name: Install GDAL system dependencies
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y gdal-bin libgdal-dev
25+
26+
- name: Get GDAL version
27+
id: gdal-version
28+
run: |
29+
GDAL_VERSION=$(gdal-config --version)
30+
echo "GDAL version: $GDAL_VERSION"
31+
echo "version=$GDAL_VERSION" >> $GITHUB_OUTPUT
32+
33+
- name: Install Python dependencies
34+
env:
35+
GDAL_VERSION: ${{ steps.gdal-version.outputs.version }}
36+
run: |
37+
python -m pip install --upgrade pip
38+
# Install build dependencies first (numpy<2 needed for GDAL compatibility)
39+
pip install setuptools wheel "numpy<2"
40+
# Install GDAL Python bindings with --no-build-isolation
41+
# This allows GDAL to see the numpy we just installed
42+
pip install --no-build-isolation --no-cache-dir GDAL==$GDAL_VERSION
43+
# Install all other dependencies (excluding GDAL and numpy from requirements.txt)
44+
grep -v -e "^gdal" -e "^numpy" requirements.txt > requirements_no_gdal_numpy.txt
45+
pip install -r requirements_no_gdal_numpy.txt
46+
# Install test/dev dependencies
47+
pip install pytest pytest-cov ruff
48+
49+
- name: Verify GDAL installation
50+
run: |
51+
python -c "from osgeo import gdal; print(f'GDAL version: {gdal.__version__}')"
52+
python -c "from osgeo import gdal_array; print('GDAL array support: OK')"
53+
54+
- name: Run ruff (lint)
55+
run: |
56+
ruff check . --exit-zero
57+
58+
- name: Run tests
59+
run: |
60+
pytest -q -m "not earth_engine and not slow"

.gitignore

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ touchterrain/server/GoogleMapsKey.txt
1616
*old.*
1717
*.xml
1818
# auto generated json
19-
example_config.json
19+
example_config.json
2020

2121
# any files in the tmp subfolders (but not .gitkeep!)
2222
touchterrain/server/tmp/??*
@@ -28,21 +28,20 @@ keep_for_later
2828

2929
tmp/*
3030
.vscode
31-
test/*
3231
*.zip
3332
*.tif
3433
*.stl
3534
*.txt
36-
*.ovr
37-
*.tfw
35+
*.ovr
36+
*.tfw
3837
*.xml
3938
*/*/*/*_CH*
4039
*/*/*_CH*
4140
*/*_CH*
4241
*_CH*
4342

4443
# default folder for stand alone
45-
terrain
44+
terrain
4645

4746
# polygon files
4847
*.kml
@@ -216,4 +215,4 @@ dmypy.json
216215

217216
# End of https://www.toptal.com/developers/gitignore/api/python,visualstudiocode
218217

219-
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
218+
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)

.pre-commit-config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
repos:
2+
- repo: https://github.com/pycqa/isort
3+
rev: 6.1.0
4+
hooks:
5+
- id: isort
6+
args: ["--profile", "black", "--line-length", "88"]
7+
8+
- repo: https://github.com/psf/black
9+
rev: 25.9.0
10+
hooks:
11+
- id: black
12+
13+
- repo: https://github.com/charliermarsh/ruff-pre-commit
14+
rev: v0.14.0
15+
hooks:
16+
- id: ruff
17+
args: ["--fix"]
18+
19+
- repo: https://github.com/pre-commit/pre-commit-hooks
20+
rev: v6.0.0
21+
hooks:
22+
- id: end-of-file-fixer
23+
- id: trailing-whitespace

.vscode/launch.json

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python Debugger: TT Standalone PA-river.json",
9+
"type": "debugpy",
10+
"request": "launch",
11+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
12+
"console": "integratedTerminal",
13+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
14+
"args": "PA-river.json"
15+
},
16+
{
17+
"name": "Python Debugger: TT Standalone IP-land.json",
18+
"type": "debugpy",
19+
"request": "launch",
20+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
21+
"console": "integratedTerminal",
22+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
23+
"args": "IP-land.json"
24+
},
25+
{
26+
"name": "Python Debugger: TT Standalone IP-water.json",
27+
"type": "debugpy",
28+
"request": "launch",
29+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
30+
"console": "integratedTerminal",
31+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
32+
"args": "IP-water.json"
33+
},
34+
{
35+
"name": "Python Debugger: TT Standalone IP-land-clip.json",
36+
"type": "debugpy",
37+
"request": "launch",
38+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
39+
"console": "integratedTerminal",
40+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
41+
"args": "IP-land-clip.json"
42+
},
43+
{
44+
"name": "Python Debugger: TT Standalone IP-water-clip.json",
45+
"type": "debugpy",
46+
"request": "launch",
47+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
48+
"console": "integratedTerminal",
49+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
50+
"args": "IP-water-clip.json"
51+
},
52+
{
53+
"name": "Python Debugger: TT Standalone DC-new-land-only.json",
54+
"type": "debugpy",
55+
"request": "launch",
56+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
57+
"console": "integratedTerminal",
58+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
59+
"args": "DC-new-land-only.json"
60+
},
61+
{
62+
"name": "Python Debugger: TT Standalone DC-new-land.json",
63+
"type": "debugpy",
64+
"request": "launch",
65+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
66+
"console": "integratedTerminal",
67+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
68+
"args": "DC-new-land.json"
69+
},
70+
{
71+
"name": "Python Debugger: TT Standalone DC-new-land-clip.json",
72+
"type": "debugpy",
73+
"request": "launch",
74+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
75+
"console": "integratedTerminal",
76+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
77+
"args": "DC-new-land-clip.json"
78+
},
79+
{
80+
"name": "Python Debugger: TT Standalone DC-new-river.json",
81+
"type": "debugpy",
82+
"request": "launch",
83+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
84+
"console": "integratedTerminal",
85+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
86+
"args": "DC-new-river.json"
87+
},
88+
{
89+
"name": "Python Debugger: TT Standalone DC-new-land-thru.json",
90+
"type": "debugpy",
91+
"request": "launch",
92+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
93+
"console": "integratedTerminal",
94+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
95+
"args": "DC-new-land-thru.json"
96+
},
97+
{
98+
"name": "Python Debugger: TT Standalone DC-new-river-thru.json",
99+
"type": "debugpy",
100+
"request": "launch",
101+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
102+
"console": "integratedTerminal",
103+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
104+
"args": "DC-new-river-thru.json"
105+
},
106+
{
107+
"name": "Python Debugger: TT Standalone WV-new-land-only.json",
108+
"type": "debugpy",
109+
"request": "launch",
110+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
111+
"console": "integratedTerminal",
112+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
113+
"args": "WV-new-land-only.json"
114+
},
115+
{
116+
"name": "Python Debugger: TT Standalone WV-new-land.json",
117+
"type": "debugpy",
118+
"request": "launch",
119+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
120+
"console": "integratedTerminal",
121+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
122+
"args": "WV-new-land.json"
123+
},
124+
{
125+
"name": "Python Debugger: TT Standalone WV-new-river.json",
126+
"type": "debugpy",
127+
"request": "launch",
128+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
129+
"console": "integratedTerminal",
130+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
131+
"args": "WV-new-river.json"
132+
},
133+
{
134+
"name": "Python Debugger: TT Standalone WV-new-land-thru.json",
135+
"type": "debugpy",
136+
"request": "launch",
137+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
138+
"console": "integratedTerminal",
139+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
140+
"args": "WV-new-land-thru.json"
141+
},
142+
{
143+
"name": "Python Debugger: TT Standalone WV-new-river-thru.json",
144+
"type": "debugpy",
145+
"request": "launch",
146+
"program": "${workspaceFolder}/TouchTerrain_standalone.py",
147+
"console": "integratedTerminal",
148+
"cwd": "${workspaceFolder}/../touchterrain-dev/",
149+
"args": "WV-new-river-thru.json"
150+
}
151+
]
152+
}

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"python-envs.defaultEnvManager": "ms-python.python:conda",
3+
"python-envs.defaultPackageManager": "ms-python.python:conda",
4+
"python-envs.pythonProjects": []
5+
}

0 commit comments

Comments
 (0)