Skip to content

Commit

Permalink
Merge branch 'OSGeo:main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
a0x8o authored Mar 19, 2024
2 parents 722569d + b656141 commit 51bbea6
Show file tree
Hide file tree
Showing 12 changed files with 157 additions and 47 deletions.
6 changes: 6 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ Python:
- any-glob-to-any-file:
- '**/*.py'
- '**/pyproject.toml'
notebook:
- changed-files:
- any-glob-to-any-file:
- '**/*.ipynb'
- doc/notebooks/**
- python/grass/jupyter/**
C:
- changed-files:
- any-glob-to-any-file: '**/*.c'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/apt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ libpdal-dev
libpng-dev
libproj-dev
libreadline-dev
libsvm-dev
libzstd-dev
pdal
proj-bin
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_ubuntu-22.04.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export INSTALL_PREFIX=$1
--with-bzlib \
--with-blas \
--with-lapack \
--with-libsvm \
--with-readline \
--with-openmp \
--with-pdal \
Expand Down
88 changes: 78 additions & 10 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,88 @@ on:
- main
- releasebranch_*
pull_request:
branches:
- main
- releasebranch_*
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_protected != true }}
permissions: {}
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/[email protected]
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
- uses: DoozyX/clang-format-lint-action@11b773b1598aa4ae3b32f023701bca5201c3817d # v0.17
with:
source: "."
clangFormatVersion: 15
inplace: True
- name: Verify Changed files
uses: tj-actions/verify-changed-files@d774a4c7ebe335445d79c7b44138f56a76058ba0 # v19.0.0
id: verify-changed-files
- id: git-changed-files
run: |
{
echo 'CHANGED_FILES<<EOF'
git ls-files --other --modified --exclude-standard
echo EOF
} >> "$GITHUB_OUTPUT"
- name: List all changed files tracked and untracked files
run: |
echo "Changed files: ${{ steps.git-changed-files.outputs.CHANGED_FILES }}"
- name: Add job summary without changed files
if: ${{ steps.verify-changed-files.outputs.files_changed == 'false' }}
run: |
{
echo "### Changed files:"
echo "No files were changed by clang-format"
} >> "$GITHUB_STEP_SUMMARY"
- name: Add job summary with changed files
if: ${{ steps.verify-changed-files.outputs.files_changed == 'true' }}
run: |
{
echo '### Changed files:'
echo '```'
echo "${CHANGED_FILES}"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
env:
CHANGED_FILES: ${{ steps.git-changed-files.outputs.CHANGED_FILES }}
- name: Create unified diff of changes
if: ${{ steps.verify-changed-files.outputs.files_changed == 'true' }}
run: git diff --unified=0 --no-color --output=diff-clang-format.patch
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
if: ${{ steps.verify-changed-files.outputs.files_changed == 'true' }}
with:
name: diff
if-no-files-found: ignore
retention-days: 1
path: |
diff-clang-format.patch
- name: Add note to summary explaining that code suggestions will be applied if it is a PR
if: ${{ (github.event_name == 'pull_request') && (steps.verify-changed-files.outputs.files_changed == 'true') }}
run: |
{
echo ''
echo 'Suggestions can only be added near to lines changed in this PR.'
echo 'If any fixes can be added as code suggestions, they will be added shortly from another workflow.'
} >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
if: always()
with:
clang-format-version: '15'
check-path: .
name: formatted-clang-format
retention-days: 10
path: |
.clang-format
${{ steps.git-changed-files.outputs.CHANGED_FILES }}
- name: Explain that more files need to be fixed
if: ${{ steps.verify-changed-files.outputs.files_changed == 'true' }}
run: |
{
echo ''
# shellcheck disable=SC2016
echo 'All fixed files are included in the `formatted-*` artifact. This artifact can be downloaded and copied to the repository to replace unformatted files with the formatted files.'
} >> "$GITHUB_STEP_SUMMARY"
exit 1
4 changes: 2 additions & 2 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
with:
sync-labels: true
sync-labels: false
2 changes: 1 addition & 1 deletion .github/workflows/periodic_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: git status --ignored
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@a4f52f8033a6168103c2538976c07b467e8163bc # v6.0.1
uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e # v6.0.2
with:
commit-message: "config.guess + config.sub: updated from http://git.savannah.gnu.org/cgit/config.git/plain/"
branch: periodic/update-configure
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/post-pr-reviews.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Post PR code suggestions

on:
workflow_run:
workflows: ["ClangFormat Check"]
types:
- completed
permissions: {}
jobs:
post-suggestions:
runs-on: ubuntu-latest
# Only run on failures, since no changes are needed on success
if: >
(github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'failure')
permissions:
pull-requests: write
steps:
- name: Create a .git directory needed by reviewdog
run: git init
- uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
id: diff
continue-on-error: true
with:
name: diff
github-token: ${{ github.token }}
run-id: ${{github.event.workflow_run.id }}
- uses: reviewdog/action-setup@3f401fe1d58fe77e10d665ab713057375e39b887 # v1.3.0
- run: |
GITHUB_ACTIONS="" reviewdog \
-name="${INPUT_TOOL_NAME:-reviewdog-suggester}" \
-f=diff \
-f.diff.strip=1 \
-filter-mode=nofilter \
-guess \
-reporter="github-pr-review" < "${TMPFILE}"
env:
TMPFILE: diff-clang-format.patch
INPUT_TOOL_NAME: clang-format
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI_COMMIT: ${{ github.event.workflow_run.head_sha }}
CI_REPO_OWNER: ${{ github.event.workflow_run.repository.owner.login }}
CI_REPO_NAME: ${{ github.event.workflow_run.repository.name }}
# CI_PULL_REQUEST: "" # Populated from reviewdog's "-guess" flag since hard to get
7 changes: 3 additions & 4 deletions display/d.rast.num/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ int main(int argc, char **argv)
if (G_parser(argc, argv))
exit(EXIT_FAILURE);

/* Setup driver and check important information */
D_open_driver();

map_name = opt.map->answer;

if (strcmp("none", opt.grid_color->answer) == 0)
Expand Down Expand Up @@ -221,10 +224,6 @@ int main(int argc, char **argv)
"not allowed)"));
}

/* Setup driver and check important information */

D_open_driver();

if (opt.font->answer)
D_font(opt.font->answer);
else if (opt.path->answer)
Expand Down
1 change: 0 additions & 1 deletion mswindows/osgeo4w/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ DLLS="
/mingw64/bin/zlib1.dll
/mingw64/bin/libbz2-1.dll
/mingw64/bin/libiconv-2.dll
/mingw64/bin/libexpat-1.dll
/mingw64/bin/libfontconfig-1.dll
/mingw64/bin/libgfortran-5.dll
/mingw64/bin/libbrotlidec.dll
Expand Down
18 changes: 0 additions & 18 deletions raster/r.in.gdal/r.in.gdal.html
Original file line number Diff line number Diff line change
Expand Up @@ -374,24 +374,6 @@ <h3>Raster file import over network</h3>
r.colors srtmgl1_v003_30m color=srtm_plus
</pre></div>

<h3>Worldclim.org data</h3>

To import the BIL data from <a href="http://www.worldclim.org">Worldclim</a>, the following
line has to be added to each .hdr file:
<div class="code"><pre>
PIXELTYPE SIGNEDINT
</pre></div>
<p>

To import the ESRI Grd data from <a href="http://www.worldclim.org">Worldclim</a>, the
broken spatial extent (exceeding the boundaries) needs to be fixed prior to import:

<div class="code"><pre>
# example: tmean dataset
gdal_translate -a_ullr -180 90 180 -60 tmean_1 tmean_1_fixed.tif
r.in.gdal input=tmean_1_fixed.tif output=tmean_1
</pre></div>

<h3>HDF</h3>

The import of HDF bands requires the specification of the individual bands
Expand Down
27 changes: 18 additions & 9 deletions raster/r.topidx/r.topidx.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
<h2>DESCRIPTION</h2>

<em>r.topidx</em> creates topographic index (wetness index), ln(a/tan(beta)), map from
elevation map
<p>where
<em>r.topidx</em> creates topographic index (wetness index), ln(a/tan(beta)),
map from elevation map where
<dl>
<dd>a: the area of the hillslope per unit contour length that drains through any point,
<p><dd>tan(beta): the local surface topographic slope (delta vertical) / (delta horizontal).
<dt>a</dt>
<dd>the area of the hillslope per unit contour length that drains through any
point,</dd>
<dt>tan(beta)</dt>
<dd>the local surface topographic slope (delta vertical) / (delta
horizontal).</dd>
</dl>
<p>Input maps may have NULL values. For example, if you have a MASK for
a watershed (basin map from <em>r.water.outlet</em>), the
following command will create a masked elevation map (belev):
<p>Input maps may have NULL values. For example, if you have a MASK for a
watershed (basin map from <em>r.water.outlet</em>), the following command will
create a masked elevation map (belev):
<div class="code"><pre>
r.mapcalc "belev = if(isnull(basin), basin, elev)"
</pre></div>
<p>
<em>r.stats -Anc</em> prints out averaged statistics for topographic index.

<p>Unprojected lat/long locations are not supported. If data is not projected
in a lat/long location, please create a new location in a projected coordinate
system and reproject the data into the new projected location. Please run
<em>r.topidx</em> from that location.

<h2>EXAMPLE</h2>

Running the command below will generate the topographic index map shown in the figure:
Running the command below will generate the topographic index map shown in the
figure:

<div class="code"><pre>
g.region raster=elevation -p
Expand Down
4 changes: 2 additions & 2 deletions vector/v.patch/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Markus Neteler <neteler itc.it>,
* Martin Landa <landa.martin gmail.com> (bbox)
* PURPOSE:
* COPYRIGHT: (C) 2002-2006 by the GRASS Development Team
* COPYRIGHT: (C) 2002-2024 by the GRASS Development Team
*
* This program is free software under the GNU General Public
* License (>=v2). Read the file COPYING that comes with GRASS
Expand Down Expand Up @@ -416,7 +416,7 @@ int main(int argc, char *argv[])
Vect_copy_head_data(&InMap, &OutMap);

if (do_table) {
add_cat = maxcat + 1;
add_cat = maxcat;
}
else {
add_cat = 0;
Expand Down

0 comments on commit 51bbea6

Please sign in to comment.