Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
roefem committed Jul 5, 2024
1 parent ead391a commit 61daf08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion brdr/aligner.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def process_dict_thematic(
self.dict_result_diff_min = dict_result_diff_min
self.dict_relevant_intersection = dict_relevant_intersection
self.dict_relevant_difference = dict_relevant_diff
self.feedback_info("thematic dictionary processed")
self.logger.feedback_info("thematic dictionary processed")
return self.get_results_as_dict(merged=False)

def predictor(
Expand Down
21 changes: 9 additions & 12 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import numpy as np

from brdr.aligner import Aligner
from brdr.enums import GRBType
from brdr.loader import GRBActualLoader
from brdr.utils import (
get_oe_dict_by_ids,
multipolygons_to_singles,
Expand All @@ -29,20 +31,15 @@ def test_example_combined_borders_adp_gbg(self):
aligner = Aligner()
dict_theme = get_oe_dict_by_ids([131635])
aligner.load_thematic_data_dict(dict_theme)
dict_adp, name_reference_id_adp = aligner.get_reference_data_dict_grb_actual(
grb_type="adp", partition=1000
)
dict_gbg, name_reference_id_gbg = aligner.get_reference_data_dict_grb_actual(
grb_type="gbg", partition=1000
)
dict_adp_gbg = dict_adp
dict_adp_gbg.update(dict_gbg) # combine 2 dictionaries
adp_loader = GRBActualLoader(grb_type=GRBType.ADP, partition=1000, aligner=aligner)
gbg_loader = GRBActualLoader(grb_type=GRBType.GBG, partition=1000, aligner=aligner)
dict_ref = adp_loader.load_data()
dict_ref.update(gbg_loader.load_data()) # combine 2 dictionaries
# make a polygonized version of the reference data with non-overlapping polygons
dict_ref = dict_adp_gbg
aligner.load_reference_data_dict(dict_ref)

rel_dist = 2
dict_results_by_distance = {}
dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(rel_dist, 4)
dict_results_by_distance = {rel_dist: aligner.process_dict_thematic(rel_dist, 4)}
results = dict_results_by_distance[rel_dist][0]
for key in results:
aligner.get_formula(results[key])
Expand Down Expand Up @@ -272,7 +269,7 @@ def test_example_predictor(self):
series = np.arange(0, 300, 10, dtype=int) / 100
# predict which relevant distances are interesting to propose as resulting geometry
dict_predicted, diffs = aligner.predictor(
relevant_distances=series, od_strategy=4, treshold_overlap_percentage=50
relevant_distances=series, od_strategy=4, threshold_overlap_percentage=50
)
for key in dict_predicted.keys():
continue

0 comments on commit 61daf08

Please sign in to comment.