Skip to content

Commit

Permalink
Merge pull request #49 from hotosm/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
Sujanadh authored Oct 4, 2024
2 parents 8119b91 + 29c2af2 commit dff2f77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
repos:
# Versioning: Commit messages & changelog
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.28.0
rev: v3.29.1
hooks:
- id: commitizen
stages: [commit-msg]

# Lint / autoformat: Python code
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.5.6"
rev: "v0.6.8"
hooks:
# Run the linter
- id: ruff
Expand All @@ -19,7 +19,7 @@ repos:

# Lint & Autoformat: SQL
- repo: https://github.com/sqlfluff/sqlfluff
rev: 3.1.0
rev: 3.2.0
hooks:
- id: sqlfluff-lint
files: ^fmtm_splitter/fmtm_algorithm.sql
Expand Down Expand Up @@ -47,7 +47,7 @@ repos:
]
# Lint: Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
rev: v0.42.0
hooks:
- id: markdownlint
args:
Expand Down
9 changes: 5 additions & 4 deletions fmtm_splitter/fmtm_algorithm.sql
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ CREATE TABLE buildings AS (
SELECT
b.*,
polys.polyid
FROM "ways_poly" AS b, polygonsnocount AS polys
FROM ways_poly AS b, polygonsnocount AS polys
WHERE
ST_INTERSECTS(polys.geom, ST_CENTROID(b.geom))
AND b.tags ->> 'building' IS NOT NULL
Expand Down Expand Up @@ -146,7 +146,7 @@ CREATE TABLE splitpolygons AS (
COUNT(b.geom) AS numfeatures,
ST_AREA(sp.geog) AS area
FROM polygonsnocount AS sp
LEFT JOIN "buildings" AS b
LEFT JOIN buildings AS b
ON sp.polyid = b.polyid
GROUP BY sp.polyid, sp.geom
)
Expand Down Expand Up @@ -244,9 +244,10 @@ CREATE TABLE clusteredbuildings AS (
SELECT
*,
ST_CLUSTERKMEANS(
geom, CAST((b.numfeatures / %(num_buildings)s) + 1 AS integer)
b.geom,
CAST((b.numfeatures / %(num_buildings)s) + 1 AS integer)
)
OVER (PARTITION BY polyid)
OVER (PARTITION BY b.polyid)
AS cid
FROM buildingstocluster AS b
),
Expand Down

0 comments on commit dff2f77

Please sign in to comment.