Skip to content

Commit

Permalink
Merge pull request #210 from statisticsnorway/gridlooper
Browse files Browse the repository at this point in the history
Fix explore (broken geocoder)
  • Loading branch information
mortewle authored Apr 16, 2024
2 parents e105db0 + 9a2819a commit efc3737
Show file tree
Hide file tree
Showing 29 changed files with 3,249 additions and 2,331 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v5
- name: Install Poetry
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
poetry --version
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5.1.0
with:
python-version: "3.10"
cache: "poetry"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip install --constraint=${{ github.workspace }}/.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pip install --constraint=.github/workflows/constraints.txt poetry
pip install --constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
poetry --version
- name: Check if there is a parent commit
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ jobs:
- name: Upgrade pip
if: matrix.os != 'macos-latest'
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip install --constraint=${{ github.workspace }}/.github/workflows/constraints.txt pip
pip --version
- name: Upgrade pip on MacOS
if: matrix.os == 'macos-latest'
run: |
pip3 install --constraint=.github/workflows/constraints.txt pip
pip3 install --constraint=${{ github.workspace }}/.github/workflows/constraints.txt pip
pip3 --version
- name: Install Poetry
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
poetry --version
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
Expand Down
3,137 changes: 2,161 additions & 976 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ssb-sgis"
version = "0.3.13"
version = "1.0.0"
description = "GIS functions used at Statistics Norway."
authors = ["Statistics Norway <ort@ssb.no>"]
license = "MIT"
Expand All @@ -9,7 +9,7 @@ packages = [{include = "sgis", from = "src"}]
homepage = "https://github.com/statisticsnorway/ssb-sgis"
repository = "https://github.com/statisticsnorway/ssb-sgis"
classifiers = [
"Development Status :: 3 - Alpha",
"Development Status :: 5 - Production/Stable",
"Topic :: Scientific/Engineering :: GIS",
]

Expand Down Expand Up @@ -70,6 +70,8 @@ pyupgrade = ">=3.3.1"
sphinx = ">=6.1.3"
sphinx-autobuild = ">=2021.3.14"
sphinx-autodoc-typehints = ">=1.22"
torch = ">=2.2.2"
torchgeo = ">=0.5.2"
xdoctest = {extras = ["colors"], version = ">=1.1.1"}


Expand Down
10 changes: 6 additions & 4 deletions src/sgis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@
buffdiss,
buffdissexp,
buffdissexp_by_cluster,
diss,
diss_by_cluster,
dissexp,
dissexp_by_cluster,
)
from .geopandas_tools.centerlines import get_rough_centerlines
from .geopandas_tools.cleaning import (
coverage_clean,
remove_interior_slivers,
remove_spikes,
snap_polygons,
snap_to_mask,
split_and_eliminate_by_longest,
split_by_neighbors,
split_spiky_polygons,
)
from .geopandas_tools.conversion import (
coordinate_array,
Expand Down Expand Up @@ -76,6 +76,7 @@
get_neighbor_dfs,
get_neighbor_indices,
k_nearest_neighbors,
sjoin_within_distance,
)
from .geopandas_tools.overlay import clean_overlay
from .geopandas_tools.point_operations import snap_all, snap_within_distance
Expand All @@ -87,6 +88,7 @@
eliminate_by_largest,
eliminate_by_longest,
eliminate_by_smallest,
get_cluster_mapper,
get_gaps,
get_holes,
get_polygon_clusters,
Expand Down Expand Up @@ -130,7 +132,7 @@
make_node_ids,
)
from .networkanalysis.traveling_salesman import traveling_salesman_problem
from .parallel.parallel import Parallel
from .parallel.parallel import Parallel, parallel_overlay
from .raster.cube import DataCube


Expand Down
8 changes: 2 additions & 6 deletions src/sgis/geopandas_tools/bounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,15 @@ class Gridlooper:
Instantiate a gridlooper.
>>> looper = sg.Gridlooper(gridsize=200, mask=buffered, parallelizer=sg.Parallel(1, backend="multiprocessing"))
>>> looper = sg.Gridlooper(gridsize=200, mask=buffered, concat=True, parallelizer=sg.Parallel(1, backend="multiprocessing"))
Run the function clean_overlay in a gridloop.
>>> resultslist = looper.run(
>>> results = looper.run(
... sg.clean_overlay,
... points,
... buffered,
... )
>>> type(resultslist)
list
>>> results = pd.concat(resultslist, ignore_index=True)
>>> results
idx_1 idx_2 geometry
0 220 220 POINT (254575.200 6661631.500)
Expand Down
Loading

0 comments on commit efc3737

Please sign in to comment.