Skip to content

Commit

Permalink
Merge pull request #19 from thiippal/dev
Browse files Browse the repository at this point in the history
add error for missing training configuration under 'pool'
  • Loading branch information
thiippal authored Sep 22, 2022
2 parents 67a14f6 + 74a66c6 commit 0c17409
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "abulafia"
version = "0.1.3"
version = "0.1.4"
description = "A tool for fair and reproducible crowdsourcing using Toloka"
readme = "README.md"
requires-python = ">=3.8"
Expand Down
28 changes: 20 additions & 8 deletions src/abulafia/task_specs/core_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(self, configuration, client, task_spec, **kwargs):

except KeyError:

msg.warn(f"Could not find the column 'user_id' from blocklist.", exits=1)
msg.warn(f"Could not find the column 'user_id' in the blocklist.", exits=1)

# Print status message
msg.info(f'The unique ID for this object ({self.name}) is {self.task_id}')
Expand Down Expand Up @@ -368,18 +368,30 @@ def load_pool(self, client):
# If training has been defined, set up training and required quality
if self.train_conf is not None:

# Link training pool and retrieve minimum performance value
self.pool.set_training_requirement(training_pool_id=self.training.id,
**self.pool_conf['training'])
try:

# Link training pool and retrieve minimum performance value
self.pool.set_training_requirement(training_pool_id=self.training.id,
**self.pool_conf['training'])

except KeyError:

msg.warn(f"Could not find the key 'training' under the main pool configuration. "
f"Define the key 'training' and place a key/value pair with the key "
f"'training_passing_skill_value' under 'training' to link the training "
f"and main pools. This key is used to set the criteria for passing "
f"the training, e.g. training_passing_skill_value: 70", exits=1)

# Print status message
msg.good(f'Successfully configured a new main pool')

if 'estimated_time_per_suite' not in self.pool_conf.keys():
msg.warn(f"Parameter estimated_time_per_suite is not configured in pool settings for {self.name}. "
f"Consider adding it to verify that the reward_per_assignment you have set results in a fair "
f"hourly wage of at least $12. Do you wish to proceed with the current configuration anyway "
f"(y/n)?")

msg.warn(f"Parameter 'estimated_time_per_suite' is not configured in pool settings "
f"for {self.name}. Consider adding this key under 'pool' to ensure that the "
f"'reward_per_assignment' you have set results in a fair hourly wage of "
f"at least $12. Do you wish to proceed with the current configuration "
f"anyway (y/n)?")

choice = input("")

Expand Down

0 comments on commit 0c17409

Please sign in to comment.