File tree Expand file tree Collapse file tree 4 files changed +13
-15
lines changed Expand file tree Collapse file tree 4 files changed +13
-15
lines changed Original file line number Diff line number Diff line change 33import sys
44
55
6- __version__ = "4.4.36dev1 "
6+ __version__ = "4.4.35dev2 "
77
88
99os .environ .update ({"sa_version" : __version__ })
Original file line number Diff line number Diff line change @@ -2101,9 +2101,8 @@ def execute(self):
21012101 if categorization_enabled :
21022102 item_id_category_map = {}
21032103 for item_name in uploaded_annotations :
2104- category = (
2105- name_annotation_map [item_name ]["metadata" ]
2106- .get ("item_category" , None )
2104+ category = name_annotation_map [item_name ]["metadata" ].get (
2105+ "item_category" , None
21072106 )
21082107 if category :
21092108 item_id_category_map [name_item_map [item_name ].id ] = category
Original file line number Diff line number Diff line change 11import decimal
22import logging
3+ import math
34from collections import defaultdict
45from typing import List
56
@@ -608,10 +609,14 @@ def validate_project_type(self):
608609 def validate_connections (self ):
609610 if not self ._connections :
610611 return
611-
612- if len (self ._connections ) > len (self ._steps ):
612+ if not all ([len (i ) == 2 for i in self ._connections ]):
613+ raise AppException ("Invalid connections." )
614+ steps_count = len (self ._steps )
615+ if len (self ._connections ) > max (
616+ math .factorial (steps_count ) / (2 * math .factorial (steps_count - 2 )), 1
617+ ):
613618 raise AppValidationException (
614- "Invalid connections: more connections than steps ."
619+ "Invalid connections: duplicates in a connection group ."
615620 )
616621
617622 possible_connections = set (range (1 , len (self ._steps ) + 1 ))
Original file line number Diff line number Diff line change 1- import json
2- import os
3- import tempfile
4- from pathlib import Path
5-
6- from numpy .ma .core import arange
71from src .superannotate import AppException
82from src .superannotate import SAClient
9- from tests import DATA_SET_PATH
103from tests .integration .base import BaseTestCase
114
125sa = SAClient ()
@@ -236,7 +229,8 @@ def test_create_invalid_connection(self):
236229 sa .set_project_steps (
237230 * args ,
238231 connections = [
239- [1 , 2 , 1 ],
232+ [1 , 2 ],
233+ [2 , 1 ],
240234 ]
241235 )
242236 with self .assertRaisesRegexp (
You can’t perform that action at this time.
0 commit comments