From 4c7efdb8009f0e4dae2a15e34e68a2b90f8d120a Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Mon, 25 Oct 2021 13:21:27 +0200 Subject: [PATCH] #36 Quality checks * moves geometry check logic to upper class --- intervention/utils/quality.py | 13 ------------- konova/utils/quality.py | 12 ++++++++++++ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/intervention/utils/quality.py b/intervention/utils/quality.py index 72ed2a73..7896000d 100644 --- a/intervention/utils/quality.py +++ b/intervention/utils/quality.py @@ -97,16 +97,3 @@ class InterventionQualityChecker(AbstractQualityChecker): self.messages.append( _("No compensation of any type found (Compensation, Payment, Deduction)") ) - - def _check_geometry(self): - """ Checks on the geometry - - Returns: - - """ - try: - geometry_obj = self.obj.geometry - if geometry_obj.geom.empty: - self._add_missing_attr_name(_("Geometry")) - except AttributeError: - self._add_missing_attr_name(_("Geometry")) diff --git a/konova/utils/quality.py b/konova/utils/quality.py index b59c3272..adf76d4f 100644 --- a/konova/utils/quality.py +++ b/konova/utils/quality.py @@ -32,3 +32,15 @@ class AbstractQualityChecker: missing = _('missing') self.messages.append(f"{attr_name} {missing}") + def _check_geometry(self): + """ Checks on the geometry + + Returns: + + """ + try: + geometry_obj = self.obj.geometry + if geometry_obj.geom.empty: + self._add_missing_attr_name(_("Geometry")) + except AttributeError: + self._add_missing_attr_name(_("Geometry"))