diff --git a/fastkml/base.py b/fastkml/base.py index 0e3ce601..048fbf91 100644 --- a/fastkml/base.py +++ b/fastkml/base.py @@ -79,14 +79,24 @@ def etree_element( return element def from_element(self, element: Element) -> None: - """Load the KML Object from an Element.""" + """ + Load the KML Object from an Element. + + This implementation is deprecated and will be replaced by class_from_element + making it a classmethod. + """ if f"{self.ns}{self.__name__}" != element.tag: raise TypeError("Call of abstract base class, subclasses implement this!") for mapping in self.kml_object_mapping: mapping["from_kml"](self, element, **mapping) def from_string(self, xml_string: str) -> None: - """Load the KML Object from serialized xml.""" + """ + Load the KML Object from serialized xml. + + This implementation is deprecated and will be replaced by class_from_string + making it a classmethod. + """ self.from_element( cast(Element, config.etree.XML(xml_string)) # type: ignore[attr-defined] ) @@ -266,6 +276,7 @@ def _get_kwargs( element: Element, strict: bool, ) -> Dict[str, Any]: + """Get the keyword arguments to build the object from an element.""" return { "id": cls._get_id(element=element, strict=strict), "target_id": cls._get_target_id(element=element, strict=strict), diff --git a/fastkml/geometry.py b/fastkml/geometry.py index 97bb097b..837deb8d 100644 --- a/fastkml/geometry.py +++ b/fastkml/geometry.py @@ -49,7 +49,7 @@ class Geometry(_BaseObject): - """ """ + """Deprecated: to be replaced by the subclasses of _Geometry.""" geometry = None extrude = False diff --git a/tests/geometries/polygon_test.py b/tests/geometries/polygon_test.py index 6003870f..5274d233 100644 --- a/tests/geometries/polygon_test.py +++ b/tests/geometries/polygon_test.py @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Christian Ledermann +# Copyright (C) 2023 Christian Ledermann # # This library is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free