Skip to content

Commit fb6a989

Browse files
committed
Merge remote-tracking branch 'github/master'
2 parents 89ce5bd + 3771a1a commit fb6a989

28 files changed

+3536
-1187
lines changed

.gitlab-ci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@ image: mambaorg/micromamba
33
stages:
44
- test
55

6-
test:
6+
test-code:
77
stage: test
88
script:
9-
- micromamba create -n glaes --file=requirements.yml
9+
- micromamba create -n glaes --file=requirements-dev.yml
1010
- eval "$(micromamba shell hook --shell bash)"
1111
- micromamba activate glaes
1212
- pip install -e . --no-deps
1313
- pytest --cov=glaes glaes/test/
1414

15-
15+
test-formatting:
16+
stage: test
17+
image: pyfound/black:latest_release
18+
script:
19+
# Dry-run black auto-formatter. If the code needs reformatting this test
20+
# will fail.
21+
- black --version
22+
- black --check glaes
23+
- black --check Examples

Examples/00_basic_workflow.ipynb

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"outputs": [],
5353
"source": [
5454
"# Choose a region to operate on (Here, a predefined region for Aachen, Germany is used)\n",
55-
"regionPath = gl._test_data_['aachenShapefile.shp']\n",
55+
"regionPath = gl._test_data_[\"aachenShapefile.shp\"]\n",
5656
"\n",
5757
"# Initialize ExclusionCalculator object\n",
5858
"ec = gl.ExclusionCalculator(regionPath, srs=3035, pixelSize=100)"
@@ -147,7 +147,7 @@
147147
"clcRasterPath = gl._test_data_[\"clc-aachen_clipped.tif\"]\n",
148148
"\n",
149149
"# Apply exclusion\n",
150-
"ec.excludeRasterType(clcRasterPath, value=(12,22))\n",
150+
"ec.excludeRasterType(clcRasterPath, value=(12, 22))\n",
151151
"\n",
152152
"# Visualize\n",
153153
"ec.draw()"
@@ -194,7 +194,7 @@
194194
],
195195
"source": [
196196
"# Apply exclusion\n",
197-
"ec.excludeRasterType(clcRasterPath, value=(1,2), buffer=1000)\n",
197+
"ec.excludeRasterType(clcRasterPath, value=(1, 2), buffer=1000)\n",
198198
"\n",
199199
"# Visualize\n",
200200
"ec.draw()"
@@ -404,7 +404,7 @@
404404
"## Apply exclusions from the given set\n",
405405
"ec.excludeSet(\n",
406406
" exclusion_set=exclusion_set,\n",
407-
" clc=gl._test_data_['clc-aachen_clipped.tif'],\n",
407+
" clc=gl._test_data_[\"clc-aachen_clipped.tif\"],\n",
408408
" osm_roads=gl._test_data_[\"aachenRoads.shp\"],\n",
409409
")\n",
410410
"\n",
@@ -459,10 +459,10 @@
459459
"source": [
460460
"ec_p = gl.ExclusionCalculator(regionPath, srs=3035, pixelSize=100)\n",
461461
"\n",
462-
"ec_p.excludePrior(\"agriculture_proximity\", value=(None,0))\n",
463-
"ec_p.excludePrior(\"settlement_proximity\", value=(None,1000))\n",
464-
"ec_p.excludePrior(\"roads_main_proximity\", value=(None,200))\n",
465-
" \n",
462+
"ec_p.excludePrior(\"agriculture_proximity\", value=(None, 0))\n",
463+
"ec_p.excludePrior(\"settlement_proximity\", value=(None, 1000))\n",
464+
"ec_p.excludePrior(\"roads_main_proximity\", value=(None, 200))\n",
465+
"\n",
466466
"ec_p.draw()"
467467
]
468468
},
@@ -507,10 +507,8 @@
507507
"source": [
508508
"## Set the initial value to those we computer previously\n",
509509
"ec = gl.ExclusionCalculator(\n",
510-
" regionPath, \n",
511-
" srs=3035, \n",
512-
" pixelSize=100, \n",
513-
" initialValue=\"aachens_best_pv_spots.tif\")\n",
510+
" regionPath, srs=3035, pixelSize=100, initialValue=\"aachens_best_pv_spots.tif\"\n",
511+
")\n",
514512
"\n",
515513
"\n",
516514
"## Draw the result\n",
@@ -546,7 +544,7 @@
546544
}
547545
],
548546
"source": [
549-
"ax = ec.drawWithSmopyBasemap(zoom=11, figsize=(40,20))"
547+
"ax = ec.drawWithSmopyBasemap(zoom=11, figsize=(40, 20))"
550548
]
551549
},
552550
{

Examples/01_Placement_algorithm.ipynb

Lines changed: 134 additions & 31 deletions
Large diffs are not rendered by default.
4.51 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PROJCS["ETRS89_LAEA_Europe",GEOGCS["GCS_ETRS_1989",DATUM["D_ETRS_1989",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["latitude_of_origin",52],PARAMETER["central_meridian",10],PARAMETER["false_easting",4321000],PARAMETER["false_northing",3210000],UNIT["Meter",1]]
983 KB
Binary file not shown.
1.52 KB
Binary file not shown.

Examples/aachen_placements.dbf

2.34 KB
Binary file not shown.

Examples/aachen_placements.prj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PROJCS["ETRS89_LAEA_Europe",GEOGCS["GCS_ETRS_1989",DATUM["D_ETRS_1989",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["latitude_of_origin",52],PARAMETER["central_meridian",10],PARAMETER["false_easting",4321000],PARAMETER["false_northing",3210000],UNIT["Meter",1]]

Examples/aachen_placements.shp

5.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)