Skip to content

Commit

Permalink
reformat for black formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
dieuska committed Jun 26, 2024
1 parent d5d489b commit cba6a69
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 24 deletions.
5 changes: 2 additions & 3 deletions examples/__init__.py
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
6 changes: 3 additions & 3 deletions examples/example_131635.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
15 changes: 8 additions & 7 deletions examples/example_eo.py
Original file line number Diff line number Diff line change
@@ -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__":
Expand Down Expand Up @@ -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 = {}
Expand Down
1 change: 0 additions & 1 deletion examples/example_local_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from brdr.aligner import Aligner
from brdr.enums import OpenbaarDomeinStrategy
from examples import show_map

if __name__ == "__main__":
# Initiate brdr
Expand Down
2 changes: 1 addition & 1 deletion examples/example_parcel_change_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions examples/example_parcel_vs_building.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.utils import diffs_from_dict_series
from examples import plot_series
Expand Down
3 changes: 2 additions & 1 deletion examples/example_readme.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions examples/example_wanted_changes.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.utils import (
get_breakpoints_zerostreak,
Expand Down
2 changes: 1 addition & 1 deletion examples/examples_aligner.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/examples_predictor.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 0 additions & 3 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
@@ -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,
)


Expand Down
4 changes: 3 additions & 1 deletion tests/test_geometry_utils.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
1 change: 1 addition & 0 deletions tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

import pytest
import toml

Expand Down

0 comments on commit cba6a69

Please sign in to comment.