Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DEV-2677: Dismiss per region for textarea if there are other per region calculation #74

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions evalme/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,12 @@ def filter_results_by_from_name(cls, results, from_name):

@classmethod
def get_type(cls, result):
"""
Get type of control, per region data
:param result: Json result
:return: type of control, initial type (without regions), flag if control has per_region tags
"""
t = result.get('type')
# check for per_region conditions
if t in ('choices', 'textarea'):
if 'start' in result['value'] and 'end' in result['value']:
t += '[per_region=span]'
elif 'x' in result['value'] and 'y' in result['value']:
t += '[per_region=bbox]'
elif 'points' in result['value']:
t += '[per_region=poly]'
return t

@classmethod
Expand Down