Skip to content

Commit

Permalink
cleaned black formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
dieuska committed Sep 2, 2024
1 parent 4684146 commit ef1ba4a
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 39 deletions.
4 changes: 2 additions & 2 deletions brdr/aligner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import logging
import os
from collections import defaultdict
from datetime import datetime, date
from datetime import datetime
from math import pi
from typing import Iterable

import numpy as np
from math import pi
from shapely import GeometryCollection
from shapely import Polygon
from shapely import STRtree
Expand Down
7 changes: 3 additions & 4 deletions brdr/grb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
import logging
from datetime import date, datetime

from shapely import intersects
from shapely.geometry import shape
from shapely.geometry.base import BaseGeometry

from brdr.constants import (
DOWNLOAD_LIMIT,
DEFAULT_CRS,
Expand All @@ -15,17 +18,13 @@
GRB_KNW_ID,
)
from brdr.enums import GRBType, Evaluation
from shapely import intersects, make_valid
from shapely.geometry import shape

from brdr.geometry_utils import (
features_by_geometric_operation,
create_donut,
get_bbox,
buffer_pos,
)
from brdr.loader import GeoJsonLoader
from brdr.typings import ProcessResult
from brdr.utils import (
get_collection,
dict_series_by_keys,
Expand Down
2 changes: 1 addition & 1 deletion brdr/loader.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import json
from abc import ABC


import requests as requests
from shapely.geometry.base import BaseGeometry

from brdr.typings import FeatureCollection
from brdr.utils import geojson_to_dicts

Expand Down
1 change: 1 addition & 0 deletions examples/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import geopandas as gpd
import matplotlib.pyplot as plt

from brdr.typings import ProcessResult
from brdr.utils import processresult_to_dicts

Expand Down
2 changes: 1 addition & 1 deletion examples/example_combined_borders_adp_gbg.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from brdr.aligner import Aligner
from brdr.enums import GRBType
from brdr.grb import get_collection_grb_actual, GRBActualLoader
from brdr.loader import GeoJsonFileLoader
from brdr.aligner import Aligner
from brdr.utils import polygonize_reference_data, geojson_to_dicts
from examples import show_map, print_formula

Expand Down
1 change: 1 addition & 0 deletions examples/example_eo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np

from brdr.aligner import Aligner
from brdr.enums import GRBType
from brdr.utils import get_oe_dict_by_ids, write_geojson, dict_series_by_keys
Expand Down
5 changes: 3 additions & 2 deletions examples/example_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import numpy as np
from shapely import from_wkt

from brdr.aligner import Aligner
from brdr.enums import GRBType
from brdr.geometry_utils import get_bbox
Expand Down Expand Up @@ -35,7 +36,7 @@
thematic_dict_formula[key] = base_aligner.get_formula(thematic_dict_result[key])
base_aligner_result = Aligner()
base_aligner_result.load_thematic_data(DictLoader(thematic_dict_result))
dict_affected,dict_unchanged = get_geoms_affected_by_grb_change(
dict_affected, dict_unchanged = get_geoms_affected_by_grb_change(
base_aligner_result,
grb_type=GRBType.ADP,
date_start=date(2022, 1, 1),
Expand Down Expand Up @@ -63,7 +64,7 @@
thematic_dict_formula,
threshold_area=5,
threshold_percentage=1,
dict_unchanged=dict_unchanged
dict_unchanged=dict_unchanged,
)

fc = get_series_geojson_dict(
Expand Down
1 change: 1 addition & 0 deletions examples/example_evaluate_ao.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from datetime import date

import numpy as np

from brdr.aligner import Aligner
from brdr.enums import GRBType
from brdr.grb import (
Expand Down
10 changes: 5 additions & 5 deletions examples/example_evaluate_multi_to_single.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import numpy as np
from shapely import from_wkt

from brdr.aligner import Aligner
from brdr.enums import GRBType
from brdr.geometry_utils import get_bbox
from brdr.grb import (
get_geoms_affected_by_grb_change,
evaluate,
Expand All @@ -16,7 +16,7 @@
get_series_geojson_dict,
multipolygons_to_singles,
merge_process_results,
merge_dict_series, get_oe_dict_by_ids,
get_oe_dict_by_ids,
)

thematic_dict = {
Expand Down Expand Up @@ -47,12 +47,12 @@
# Determine all features that are possibly changed during timespan
base_aligner_result = Aligner()
base_aligner_result.load_thematic_data(DictLoader(thematic_dict_result))
dict_affected,dict_unchanged = get_geoms_affected_by_grb_change(
dict_affected, dict_unchanged = get_geoms_affected_by_grb_change(
base_aligner_result,
grb_type=GRBType.ADP,
date_start=date(2022, 1, 1),
date_end=date.today(),
one_by_one=False
one_by_one=False,
)
# Align the possibly affected geometry on the actual GRB parcels (evaluation)

Expand All @@ -72,7 +72,7 @@
thematic_dict_formula,
threshold_area=5,
threshold_percentage=1,
dict_unchanged=dict_unchanged
dict_unchanged=dict_unchanged,
)
fc = get_series_geojson_dict(
dict_evaluated,
Expand Down
1 change: 0 additions & 1 deletion examples/example_multipolygon.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Initiate brdr
import tests
from brdr.aligner import Aligner
from brdr.enums import GRBType
from brdr.utils import multipolygons_to_singles, write_geojson
Expand Down
6 changes: 2 additions & 4 deletions examples/example_parcel_change_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
from brdr.aligner import Aligner
from brdr.enums import GRBType
from brdr.grb import (
get_last_version_date,
get_geoms_affected_by_grb_change,
get_collection_grb_fiscal_parcels,
evaluate,
GRBFiscalParcelLoader,
GRBActualLoader,
Expand Down Expand Up @@ -94,7 +92,7 @@

base_aligner_result = Aligner()
base_aligner_result.load_thematic_data(DictLoader(thematic_dict_result))
dict_affected,dict_unchanged = get_geoms_affected_by_grb_change(
dict_affected, dict_unchanged = get_geoms_affected_by_grb_change(
aligner=base_aligner_result,
grb_type=GRBType.ADP,
date_start=date.today() - timedelta(days=365),
Expand Down Expand Up @@ -129,7 +127,7 @@
thematic_dict_formula,
threshold_area=5,
threshold_percentage=1,
dict_unchanged=dict_unchanged
dict_unchanged=dict_unchanged,
)
counter_equality = 0
counter_equality_by_alignment = 0
Expand Down
18 changes: 3 additions & 15 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
import json
import unittest

import numpy as np
from shapely import to_geojson
from shapely.geometry import shape

from brdr.aligner import Aligner
from brdr.enums import GRBType
from brdr.grb import GRBActualLoader
from brdr.loader import DictLoader, GeoJsonLoader
from brdr.utils import diffs_from_dict_series
from brdr.utils import get_breakpoints_zerostreak
from brdr.utils import get_oe_dict_by_ids
from brdr.utils import multipolygons_to_singles

import json

import numpy as np
from brdr.aligner import Aligner
from brdr.enums import DiffMetric
from brdr.enums import GRBType
from brdr.enums import OpenbaarDomeinStrategy
from brdr.grb import GRBActualLoader
from brdr.loader import DictLoader
from brdr.typings import GeoJSONGeometry
from brdr.utils import diffs_from_dict_series
from shapely import to_geojson
from shapely.geometry import shape


class TestExamples(unittest.TestCase):
Expand Down
4 changes: 0 additions & 4 deletions tests/test_loader.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import pytest
from shapely import Polygon

from brdr.aligner import Aligner
from brdr.enums import GRBType
from brdr.geometry_utils import get_partitions
from brdr.grb import GRBActualLoader
from brdr.loader import DictLoader
from brdr.utils import get_oe_dict_by_ids
Expand Down

0 comments on commit ef1ba4a

Please sign in to comment.