From b8382ecaa22b4c91a0ad543c73f7a02658f7b1fd Mon Sep 17 00:00:00 2001
From: Christopher Rhodes <christopher.rhodes@embl.de>
Date: Fri, 13 Sep 2024 14:19:45 +0200
Subject: [PATCH] Inserted valid type hint

---
 model_server/base/roiset.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/model_server/base/roiset.py b/model_server/base/roiset.py
index 9e1efc42..60cb5912 100644
--- a/model_server/base/roiset.py
+++ b/model_server/base/roiset.py
@@ -2,6 +2,7 @@ import itertools
 from math import sqrt, floor
 from pathlib import Path
 from typing import List, Union
+from typing_extensions import Self
 from uuid import uuid4
 
 import numpy as np
@@ -564,8 +565,7 @@ class RoiSet(object):
         self.set_classification(f'classify_by_{name}', se)
 
 
-    # TODO: typecheck RoiSet not recognized
-    def get_instance_classification(self, roiset_from, iou_min: float = 0.5) -> pd.DataFrame:
+    def get_instance_classification(self, roiset_from: Self, iou_min: float = 0.5) -> pd.DataFrame:
         """
         Transfer instance classification labels from another RoiSet based on intersection over union (IOU) similarity
         :param roiset_from: RoiSet source of classification labels, same shape as this RoiSet
-- 
GitLab