Skip to content

Commit

Permalink
Add 'src/raster/r.slopeunits/' from commit 'e1bee74e3e4d656d1bde93924…
Browse files Browse the repository at this point in the history
…b49fb46ed29ee42'

git-subtree-dir: src/raster/r.slopeunits
git-subtree-mainline: a5c5f66
git-subtree-split: e1bee74
  • Loading branch information
mmacata committed Jan 14, 2025
2 parents a5c5f66 + e1bee74 commit f26e315
Show file tree
Hide file tree
Showing 24 changed files with 4,039 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/raster/r.slopeunits/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[flake8]

# E402 module level import not at top of file
# E501 line too long (83 > 79 characters)
# F821 undefined name '_'
# C0302: Too many lines in module (844/800) (too-many-lines)

exclude = .git

max-line-length = 80

per-file-ignores =
; ./r.slopeunits.clean/r.slopeunits.clean.py: C0302
./r.slopeunits.create/r.slopeunits.create.py: F821, E501
./r.slopeunits.metrics/r.slopeunits.metrics.py: F821, E501
./r.slopeunits.optimize/r.slopeunits.optimize.py: E501
9 changes: 9 additions & 0 deletions src/raster/r.slopeunits/.github/workflows/grass-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: GRASS GIS addon manual

on:
push:
branches: [ main ]

jobs:
grass-manual:
uses: mundialis/github-workflows/.github/workflows/grass-manual.yml@main
7 changes: 7 additions & 0 deletions src/raster/r.slopeunits/.github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Python Flake8, black and pylint code quality check

on: [push, pull_request]

jobs:
lint:
uses: mundialis/github-workflows/.github/workflows/[email protected]
1 change: 1 addition & 0 deletions src/raster/r.slopeunits/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.pylintrc
16 changes: 16 additions & 0 deletions src/raster/r.slopeunits/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/mundialis/github-workflows
rev: 1.2.0
hooks:
- id: linting
12 changes: 12 additions & 0 deletions src/raster/r.slopeunits/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM osgeo/grass-gis:releasebranch_8_4-alpine

RUN apk add coreutils gawk

COPY . /workdir/r.slopeunits

# RUN grass --tmp-location EPSG:4326 --exec g.extension extension=r.slopeunits url=/workdir/r.slopeunits

RUN grass --tmp-project EPSG:4326 --exec g.extension extension=r.slopeunits.create url=/workdir/r.slopeunits/r.slopeunits.create
RUN grass --tmp-project EPSG:4326 --exec g.extension extension=r.slopeunits.clean url=/workdir/r.slopeunits/r.slopeunits.clean
RUN grass --tmp-project EPSG:4326 --exec g.extension extension=r.slopeunits.metrics url=/workdir/r.slopeunits/r.slopeunits.metrics
RUN grass --tmp-project EPSG:4326 --exec g.extension extension=r.slopeunits.optimize url=/workdir/r.slopeunits/r.slopeunits.optimize
674 changes: 674 additions & 0 deletions src/raster/r.slopeunits/LICENSE

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions src/raster/r.slopeunits/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
MODULE_TOPDIR = ../..

PGM = r.slopeunits

# note: to deactivate a module, just place a file "DEPRECATED" into the subdir
ALL_SUBDIRS := ${sort ${dir ${wildcard */.}}}
DEPRECATED_SUBDIRS := ${sort ${dir ${wildcard */DEPRECATED}}}
RM_SUBDIRS := bin/ docs/ etc/ scripts/ testsuite/
SUBDIRS_1 := $(filter-out $(DEPRECATED_SUBDIRS), $(ALL_SUBDIRS))
SUBDIRS := $(filter-out $(RM_SUBDIRS), $(SUBDIRS_1))

include $(MODULE_TOPDIR)/include/Make/Dir.make

default: parsubdirs htmldir

install: installsubdirs
$(INSTALL_DATA) $(PGM).html $(INST_DIR)/docs/html/
20 changes: 20 additions & 0 deletions src/raster/r.slopeunits/RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Release and version

Steps when releasing:

- Run in terminal
```
ESTIMATED_VERSION=1.0.0
REPO_NAME=mundialis/r.slopeunits
gh api repos/$REPO_NAME/releases/generate-notes -f tag_name="$ESTIMATED_VERSION" -f target_commitish=main -q .body
```
- Go to [new release](../../releases/new)
- Copy the output of terminal command to the release description
- You can [compare manually](../../compare/1.0.0...main) if all changes are included. If changes were pushed directly to main branch, they are not included.
- Check if `ESTIMATED_VERSION` increase still fits - we follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Fill in tag and release title with this version
- At the bottom of the release, add
"generated with `gh api repos/$REPO_NAME/releases/generate-notes -f tag_name="$ESTIMATED_VERSION" -f target_commitish=main -q .body`" and replace `$REPO_NAME` and `$ESTIMATED_VERSION` with the actual version.
- Make sure that the checkbox for "Set as the latest release" is checked so that this version appears on the main github repo page
- Now you can save the release
7 changes: 7 additions & 0 deletions src/raster/r.slopeunits/r.slopeunits.clean/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
MODULE_TOPDIR = ../..

PGM = r.slopeunits.clean

include $(MODULE_TOPDIR)/include/Make/Script.make

default: script
28 changes: 28 additions & 0 deletions src/raster/r.slopeunits/r.slopeunits.clean/r.slopeunits.clean.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<h2>DESCRIPTION</h2>
<em>r.slopeunits.clean</em> cleans slope units layer, e.g. results of <em>r.slopeunits.create</em>.

<h2>NOTES</h2>

<h2>EXAMPLE</h2>

<div class="code"><pre>
r.slopeunits.clean \
demmap=dem_italia_isolegrandi@su_test \
plainsmap=flat \
slumap=su_tmp \
slumapclean=su_tmp_cl \
cleansize=25000 \
-m
</pre></div>

<h2>SEE ALSO</h2>
<em>
<a href="r.slopeunits.create.html">r.slopeunits.create</a>,
<a href="r.slopeunits.metrics.html">r.slopeunits.metrics</a>,
<a href="r.slopeunits.optimize.html">r.slopeunits.optimize</a>
</em>

<h2>AUTHORS</h2>
Main authors: Ivan Marchesini, Massimiliano Alvioli, CNR-IRPI
<br>
Markus Metz (refactoring, translation of "clean_method_3" to python), Carmen Tawalika (creation of extra addon), <a href="https://www.mundialis.de/">mundialis</a>
Loading

0 comments on commit f26e315

Please sign in to comment.