Skip to content

Commit

Permalink
Merge pull request #23 from thiippal/dev
Browse files Browse the repository at this point in the history
fix checkbox description & bump to 0.1.6
  • Loading branch information
thiippal authored Nov 7, 2022
2 parents 31f473c + f2f200d commit 6eb4c6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ build-backend = "setuptools.build_meta"

[project]
name = "abulafia"
version = "0.1.4"
version = "0.1.6"
description = "A tool for fair and reproducible crowdsourcing using Toloka"
readme = "README.md"
requires-python = ">=3.8"
authors = [
{name = "Tuomo Hiippala"},
{name = "Helmiina Hotti"}
{name = "Helmiina Hotti"},
{name = "Rosa Suviranta"}
]
dependencies = [
"crowd_kit>=1.0.0",
Expand Down
19 changes: 12 additions & 7 deletions src/abulafia/task_specs/task_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def specify_task(configuration):
validation=tb.AnyConditionV1(conditions=[tb.SchemaConditionV1(data=tb.OutputData(output_data['json']),
schema={'type': 'array', 'minItems': 2}),
tb.EqualsConditionV1(data=tb.OutputData(output_data['bool']), to=True)],
hint="Outline at least one target or check the box if target does not exist."),
hint="Outline at least one target or check the box if necessary."),
)
)

Expand Down Expand Up @@ -557,12 +557,17 @@ def specify_task(configuration):
# Define the text prompt below the segmentation UI
prompt = tb.TextViewV1(content=configuration['interface']['prompt'])

# Create a button for cases where a target does not exist
checkbox = tb.CheckboxFieldV1(
data=tb.OutputData('no_target', default=tb.InputData(input_data['bool'])),
label="Target does not exist",
disabled=True
)
# Create a checkbox for special cases
try:
checkbox = tb.CheckboxFieldV1(
data=tb.OutputData('no_target', default=tb.InputData(input_data['bool'])),
label=configuration['interface']['checkbox'],
disabled=True)

except KeyError:
msg.warn(f"Please add the key 'checkbox' under the top-level key 'interface' to "
f"define a text that is displayed above the checkbox. Define the text as a "
f"string e.g. checkbox: There is nothing to outline.", exits=1)

# Set up a radio group for labels
radio_group = tb.ButtonRadioGroupFieldV1(
Expand Down

0 comments on commit 6eb4c6c

Please sign in to comment.