diff --git a/brdr/aligner.py b/brdr/aligner.py index ec41c53..46f2173 100644 --- a/brdr/aligner.py +++ b/brdr/aligner.py @@ -1151,46 +1151,46 @@ def load_thematic_data(self, loader: Loader): # Deprecated loader methods def load_thematic_data_geojson(self, thematic_input, name_thematic_id): - logging.warning('deprecated method, use load_thematic_data instead') + logging.warning("deprecated method, use load_thematic_data instead") loader = GeoJsonLoader(thematic_input, name_thematic_id) self.load_thematic_data(loader) def load_thematic_data_file(self, path_to_file, name_thematic_id): - logging.warning('deprecated method, use load_thematic_data instead') + logging.warning("deprecated method, use load_thematic_data instead") loader = GeoJsonFileLoader(path_to_file, name_thematic_id) self.load_thematic_data(loader) def load_thematic_data_dict(self, dict_theme): - logging.warning('deprecated method, use load_thematic_data instead') + logging.warning("deprecated method, use load_thematic_data instead") loader = DictLoader(dict_theme) self.load_thematic_data(loader) def load_thematic_data_url(self, url, name_thematic_id): - logging.warning('deprecated method, use load_thematic_data instead') + logging.warning("deprecated method, use load_thematic_data instead") loader = GeoJsonUrlLoader(url, name_thematic_id) self.load_thematic_data(loader) def load_reference_data_dict(self, dict_ref): - logging.warning('deprecated method, use load_reference_data instead') + logging.warning("deprecated method, use load_reference_data instead") loader = DictLoader(dict_ref) self.load_reference_data(loader) def load_reference_data_geojson(self, reference_input, name_reference_id): - logging.warning('deprecated method, use load_reference_data instead') + logging.warning("deprecated method, use load_reference_data instead") loader = GeoJsonLoader(reference_input, name_reference_id) self.load_reference_data(loader) def load_reference_data_file(self, path_to_file, name_reference_id): - logging.warning('deprecated method, use load_reference_data instead') + logging.warning("deprecated method, use load_reference_data instead") loader = GeoJsonFileLoader(path_to_file, name_reference_id) self.load_reference_data(loader) def load_reference_data_url(self, url, name_reference_id): - logging.warning('deprecated method, use load_reference_data instead') + logging.warning("deprecated method, use load_reference_data instead") loader = GeoJsonUrlLoader(url, name_reference_id) self.load_reference_data(loader) def load_reference_data_grb_actual(self, *, grb_type=GRBType.ADP, partition=0): - logging.warning('deprecated method, use load_reference_data instead') + logging.warning("deprecated method, use load_reference_data instead") loader = GRBActualLoader(grb_type, partition, self) self.load_reference_data(loader) diff --git a/brdr/geometry_utils.py b/brdr/geometry_utils.py index 86ff37e..905d60b 100644 --- a/brdr/geometry_utils.py +++ b/brdr/geometry_utils.py @@ -346,7 +346,7 @@ def grid_bounds(geom: BaseGeometry, delta: float): return grid -def get_relevant_polygons_from_geom( geometry: BaseGeometry, buffer_distance: float ): +def get_relevant_polygons_from_geom(geometry: BaseGeometry, buffer_distance: float): """ Get only the relevant parts (polygon) from a geometry. Points, Lines and Polygons smaller than relevant distance are excluded from the result diff --git a/brdr/typings.py b/brdr/typings.py index 47b9301..97b55ff 100644 --- a/brdr/typings.py +++ b/brdr/typings.py @@ -6,7 +6,7 @@ class GeoJSONGeometry(TypedDict): type: str - coordinates: List[float] | List[List[float]] | List[List[List[float]]] | List[List[List[List[float]]]] + coordinates: List class Crs(TypedDict): diff --git a/tests/test_examples.py b/tests/test_examples.py index 40d1322..6bbe2b5 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -31,15 +31,21 @@ 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) - adp_loader = GRBActualLoader(grb_type=GRBType.ADP, partition=1000, aligner=aligner) - gbg_loader = GRBActualLoader(grb_type=GRBType.GBG, partition=1000, aligner=aligner) + 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 + dict_ref.update(gbg_loader.load_data()) # combine 2 dictionaries # make a polygonized version of the reference data with non-overlapping polygons aligner.load_reference_data_dict(dict_ref) rel_dist = 2 - 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]) diff --git a/tests/test_loader.py b/tests/test_loader.py index 0459ac0..fc3750c 100644 --- a/tests/test_loader.py +++ b/tests/test_loader.py @@ -37,4 +37,4 @@ def test_partition(self): # Check if the result is a list of Polygon objects self.assertIsInstance(filtered_partitions, list) for partition in filtered_partitions: - self.assertIsInstance(partition, Polygon) \ No newline at end of file + self.assertIsInstance(partition, Polygon)