diff --git a/examples/__init__.py b/examples/__init__.py index 020fa08..a6e35d8 100644 --- a/examples/__init__.py +++ b/examples/__init__.py @@ -1,9 +1,8 @@ import logging -import geopandas as gpd -import matplotlib.pyplot as plt from math import ceil -import numpy as np +import geopandas as gpd +import matplotlib.pyplot as plt def _make_map( diff --git a/examples/example_131635.py b/examples/example_131635.py index c86bf18..c8fea1f 100644 --- a/examples/example_131635.py +++ b/examples/example_131635.py @@ -15,9 +15,9 @@ # RESULTS rel_dist = 2 dict_results_by_distance = {} - #put resulting tuple in a dictionary - dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(rel_dist,4) - aligner.export_results("output/",formula=True) + # put resulting tuple in a dictionary + dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(rel_dist, 4) + aligner.export_results("output/", formula=True) show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) for key in dict_results_by_distance[rel_dist][0]: diff --git a/examples/example_eo.py b/examples/example_eo.py index 632ae74..04805e1 100644 --- a/examples/example_eo.py +++ b/examples/example_eo.py @@ -1,7 +1,7 @@ import numpy as np from brdr.aligner import Aligner -from brdr.utils import get_oe_dict_by_ids, write_geojson, geojson_tuple_from_dict_theme +from brdr.utils import get_oe_dict_by_ids, write_geojson from examples import show_map, plot_series if __name__ == "__main__": @@ -35,13 +35,14 @@ # aligner.export_results("output/") # show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) - - series = np.arange(0, 200, 20, dtype=int)/100 - #predict which relevant distances are interesting to propose as resulting geometry - dict_predicted, diffs = aligner.predictor(relevant_distances=series, od_strategy=2,treshold_overlap_percentage=50) + series = np.arange(0, 200, 20, dtype=int) / 100 + # predict which relevant distances are interesting to propose as resulting geometry + dict_predicted, diffs = aligner.predictor( + relevant_distances=series, od_strategy=2, treshold_overlap_percentage=50 + ) fcs = aligner.get_predictions_as_geojson() - write_geojson('output/predicted.geojson',fcs[0]) - write_geojson('output/predicted_diff.geojson', fcs[1]) + write_geojson("output/predicted.geojson", fcs[0]) + write_geojson("output/predicted_diff.geojson", fcs[1]) for key in dict_predicted.keys(): diff = {} diff --git a/examples/example_local_data.py b/examples/example_local_data.py index 8ec961b..4393274 100644 --- a/examples/example_local_data.py +++ b/examples/example_local_data.py @@ -1,6 +1,5 @@ from brdr.aligner import Aligner from brdr.enums import OpenbaarDomeinStrategy -from examples import show_map if __name__ == "__main__": # Initiate brdr diff --git a/examples/example_parcel_change_detector.py b/examples/example_parcel_change_detector.py index 86448bd..3de08ee 100644 --- a/examples/example_parcel_change_detector.py +++ b/examples/example_parcel_change_detector.py @@ -5,8 +5,8 @@ from shapely.geometry import shape from brdr.aligner import Aligner -from brdr.utils import get_oe_geojson_by_bbox from brdr.utils import get_collection +from brdr.utils import get_oe_geojson_by_bbox # This code shows an example how the aligner can be used inside a flow of diff --git a/examples/example_parcel_vs_building.py b/examples/example_parcel_vs_building.py index 0c6092d..abc47be 100644 --- a/examples/example_parcel_vs_building.py +++ b/examples/example_parcel_vs_building.py @@ -1,4 +1,5 @@ import numpy as np + from brdr.aligner import Aligner from brdr.utils import diffs_from_dict_series from examples import plot_series diff --git a/examples/example_readme.py b/examples/example_readme.py index 4cbe102..cf884e0 100644 --- a/examples/example_readme.py +++ b/examples/example_readme.py @@ -1,5 +1,6 @@ -from brdr.aligner import Aligner from shapely import from_wkt + +from brdr.aligner import Aligner from brdr.enums import OpenbaarDomeinStrategy # CREATE AN ALIGNER diff --git a/examples/example_wanted_changes.py b/examples/example_wanted_changes.py index d95f3e3..8e05774 100644 --- a/examples/example_wanted_changes.py +++ b/examples/example_wanted_changes.py @@ -1,4 +1,5 @@ import numpy as np + from brdr.aligner import Aligner from brdr.utils import ( get_breakpoints_zerostreak, diff --git a/examples/examples_aligner.py b/examples/examples_aligner.py index aedfec1..ae6b1cf 100644 --- a/examples/examples_aligner.py +++ b/examples/examples_aligner.py @@ -1,6 +1,6 @@ from brdr.aligner import Aligner from brdr.enums import OpenbaarDomeinStrategy -from brdr.utils import diffs_from_dict_series, geojson_tuple_from_series, write_geojson +from brdr.utils import diffs_from_dict_series from examples import plot_series from examples import show_map diff --git a/examples/examples_predictor.py b/examples/examples_predictor.py index a779e90..cad8e05 100644 --- a/examples/examples_predictor.py +++ b/examples/examples_predictor.py @@ -1,6 +1,6 @@ import numpy as np + from brdr.aligner import Aligner -from brdr.utils import filter_resulting_series_by_key from examples import show_map # Press the green button in the gutter to run the script. diff --git a/tests/test_examples.py b/tests/test_examples.py index f0d4d59..7b4c026 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -1,17 +1,14 @@ import unittest import numpy as np -from shapely import from_wkt from brdr.aligner import Aligner -from brdr.enums import OpenbaarDomeinStrategy from brdr.utils import ( get_oe_dict_by_ids, multipolygons_to_singles, diffs_from_dict_series, filter_resulting_series_by_key, get_breakpoints_zerostreak, - get_oe_geojson_by_bbox, ) diff --git a/tests/test_geometry_utils.py b/tests/test_geometry_utils.py index 49d2913..a8718b0 100644 --- a/tests/test_geometry_utils.py +++ b/tests/test_geometry_utils.py @@ -1,6 +1,8 @@ import unittest -from shapely.geometry import Point, Polygon + from shapely import from_wkt +from shapely.geometry import Point, Polygon + from brdr.geometry_utils import ( buffer_neg_pos, buffer_neg, diff --git a/tests/test_utils.py b/tests/test_utils.py index cab6625..e4fddc3 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,9 +1,9 @@ import unittest -import shapely -import os +import shapely from shapely import is_empty from shapely.geometry import Polygon + from brdr.utils import ( multipolygons_to_singles, polygonize_reference_data, diff --git a/tests/test_version.py b/tests/test_version.py index 703bc69..8d62784 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -1,4 +1,5 @@ import os + import pytest import toml