Skip to content

Commit

Permalink
Merge pull request #25 from Ingenjorsarbete-For-Klimatet/hotfix/groun…
Browse files Browse the repository at this point in the history
…d-base

Hotfix/ground base
  • Loading branch information
mgcth authored Apr 14, 2024
2 parents cb38a69 + ee7beab commit 9cb11e8
Show file tree
Hide file tree
Showing 12 changed files with 108 additions and 70 deletions.
1 change: 1 addition & 0 deletions src/lantmateriet/geometry.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Geometry module."""

from copy import deepcopy
from multiprocessing import Pool
from os import path
Expand Down
17 changes: 11 additions & 6 deletions src/lantmateriet/ground.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Ground module."""

import geopandas as gpd
import pandas as pd
from lantmateriet.geometry import Geometry
Expand Down Expand Up @@ -53,12 +54,16 @@ def process(
df_processed = self._process(
self.item_type, self.layer, self.dissolve, set_area, set_length
)
df_processed["Sverige"] = pd.concat(
[
v[~v["objekttyp"].isin(self.config.ground_water)]
for _, v in df_processed.items()
]
).dissolve()
df_processed["Sverige"] = (
pd.concat(
[
v # v[~v["objekttyp"].isin(self.config.ground_water)]
for _, v in df_processed.items()
]
)
.dissolve()
.explode(index_parts=False)
)
df_processed["Sverige"] = self._set_area(df_processed["Sverige"])
df_processed["Sverige"] = self._set_length(df_processed["Sverige"])
df_processed["Sverige"]["objekttyp"] = "Sverige"
Expand Down
1 change: 1 addition & 0 deletions src/lantmateriet/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utils module."""

import logging
import time
from functools import wraps
Expand Down
64 changes: 30 additions & 34 deletions tests/fixtures/test_integration_ground_mark.geojson

Large diffs are not rendered by default.

88 changes: 58 additions & 30 deletions tests/fixtures/test_integration_ground_mark_result.geojson

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/integration/test_integration_communication.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Communication integration tests."""

import geopandas as gpd
import pandas as pd
from geopandas import testing
Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_integration_construction.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Construction integration tests."""

import geopandas as gpd
import pandas as pd
from geopandas import testing
Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_integration_ground.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Ground integration tests."""

import geopandas as gpd
import pandas as pd
from geopandas import testing
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_unit_communication.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Communication unit tests."""

from unittest.mock import patch

import geopandas as gpd
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_unit_construction.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Construction unit tests."""

from unittest.mock import patch

import geopandas as gpd
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_unit_geometry.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Geometry unit tests."""

from copy import deepcopy
from unittest.mock import call, patch

Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_unit_ground.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Ground unit tests."""

from unittest.mock import patch

import geopandas as gpd
Expand Down

0 comments on commit 9cb11e8

Please sign in to comment.