Skip to content

Commit

Permalink
Fixed failing checks
Browse files Browse the repository at this point in the history
  • Loading branch information
meta-paul committed Dec 19, 2023
1 parent f82c7be commit bdc8c18
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 60 deletions.
2 changes: 1 addition & 1 deletion examples/simple_static_task/run_task_ec2_prolific.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def main(operator, cfg: DictConfig) -> None:

# Mephisto qualifications
shared_state.qualifications = [
make_qualification_dict('sample_qual_name', QUAL_GREATER_EQUAL, 1),
make_qualification_dict("sample_qual_name", QUAL_GREATER_EQUAL, 1),
]

# Prolific qualifications
Expand Down
44 changes: 22 additions & 22 deletions mephisto/abstractions/providers/prolific/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ Shared state handles both custom and Prolific-supported qualifications:
```python
shared_state.prolific_specific_qualifications = [
{
'name': 'AgeRangeEligibilityRequirement',
'min_age': 18,
'max_age': 100,
"name": "AgeRangeEligibilityRequirement",
"min_age": 18,
"max_age": 100,
},
]

shared_state.qualifications = [
make_qualification_dict('sample_qual_name', QUAL_GREATER_EQUAL, 1),
make_qualification_dict("sample_qual_name", QUAL_GREATER_EQUAL, 1),
]
```

Expand All @@ -48,7 +48,7 @@ under the key `prolific_eligibility_requirements` like so:
mephisto:
provider:
prolific_eligibility_requirements:
- name: 'AgeRangeEligibilityRequirement'
- name: "AgeRangeEligibilityRequirement"
min_age: 10
max_age: 20
```
Expand All @@ -63,35 +63,35 @@ List of supported Eligibility Requirements for `SharedState.prolific_specific_qu
```python
[
{
'name': 'AgeRangeEligibilityRequirement',
'min_age': '<value>',
'max_age': '<value>',
"name": "AgeRangeEligibilityRequirement",
"min_age": "<value>",
"max_age": "<value>",
},
{
'name': 'ApprovalNumbersEligibilityRequirement',
'minimum_approvals': '<value>',
'maximum_approvals': '<value>',
"name": "ApprovalNumbersEligibilityRequirement",
"minimum_approvals": "<value>",
"maximum_approvals": "<value>",
},
{
'name': 'ApprovalRateEligibilityRequirement',
'minimum_approval_rate': '<value>',
'maximum_approval_rate': '<value>',
"name": "ApprovalRateEligibilityRequirement",
"minimum_approval_rate": "<value>",
"maximum_approval_rate": "<value>",
},
{
'name': 'CustomBlacklistEligibilityRequirement',
'black_list': '<value>',
"name": "CustomBlacklistEligibilityRequirement",
"black_list": "<value>",
},
{
'name': 'CustomWhitelistEligibilityRequirement',
'white_list': '<value>',
"name": "CustomWhitelistEligibilityRequirement",
"white_list": "<value>",
},
{
'name': 'JoinedBeforeEligibilityRequirement',
'joined_before': '<value>',
"name": "JoinedBeforeEligibilityRequirement",
"joined_before": "<value>",
},
{
'name': 'ParticipantGroupEligibilityRequirement',
'id': '<value>',
"name": "ParticipantGroupEligibilityRequirement",
"id": "<value>",
},
]
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,38 +300,39 @@ function ModalForm(props: ModalFormProps) {

<hr />

{BONUS_FOR_WORKER_ENABLED && props.data.form.checkboxGiveBonus !== undefined && (
<>
<Form.Check
type={"checkbox"}
label={"Give Bonus"}
id={"giveBonus"}
checked={props.data.form.checkboxGiveBonus}
onChange={() =>
onChangeGiveBonus(!props.data.form.checkboxGiveBonus)
}
/>

{props.data.form.checkboxGiveBonus && (
<Row className={"second-line"}>
<Col xs={4}>
<Form.Control
size={"sm"}
type={"input"}
placeholder={"Bonus"}
value={props.data.form.bonus || ""}
onChange={(e) => onChangeBonus(e.target.value)}
/>
</Col>
<Col>
<span>Amount (cents)</span>
</Col>
</Row>
)}
{BONUS_FOR_WORKER_ENABLED &&
props.data.form.checkboxGiveBonus !== undefined && (
<>
<Form.Check
type={"checkbox"}
label={"Give Bonus"}
id={"giveBonus"}
checked={props.data.form.checkboxGiveBonus}
onChange={() =>
onChangeGiveBonus(!props.data.form.checkboxGiveBonus)
}
/>

{props.data.form.checkboxGiveBonus && (
<Row className={"second-line"}>
<Col xs={4}>
<Form.Control
size={"sm"}
type={"input"}
placeholder={"Bonus"}
value={props.data.form.bonus || ""}
onChange={(e) => onChangeBonus(e.target.value)}
/>
</Col>
<Col>
<span>Amount (cents)</span>
</Col>
</Row>
)}

<hr />
</>
)}
<hr />
</>
)}

{props.data.form.checkboxBanWorker !== undefined && (
<>
Expand All @@ -351,7 +352,9 @@ function ModalForm(props: ModalFormProps) {

<Form.Check
type={"checkbox"}
label={FEEDBACK_FOR_WORKER_ENABLED ? "Write Note" : "Write Note for Yourself"}
label={
FEEDBACK_FOR_WORKER_ENABLED ? "Write Note" : "Write Note for Yourself"
}
id={"reviewNote"}
checked={props.data.form.checkboxReviewNote}
onChange={() =>
Expand Down Expand Up @@ -380,7 +383,9 @@ function ModalForm(props: ModalFormProps) {
id={"reviewNoteSend"}
checked={props.data.form.checkboxReviewNoteSend}
onChange={() =>
onChangeWriteReviewNoteSend(!props.data.form.checkboxReviewNoteSend)
onChangeWriteReviewNoteSend(
!props.data.form.checkboxReviewNoteSend
)
}
/>
</Col>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ function TasksPage(props: PropsType) {
}
};

exportTaskResults(taskId, onSuccessExportResults, setLoadingExportResults, onError);
exportTaskResults(
taskId,
onSuccessExportResults,
setLoadingExportResults,
onError
);
};

useEffect(() => {
Expand Down
14 changes: 14 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions scripts/update_copyright_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ def _update_copyright_header(file_path: str, replace_existing: bool = False):
if is_empty_line(i):
if i < anchor_line_number:
# Move up lower notice boundary only if previous line is not comment opening
if line_has_words(i-1):
if line_has_words(i - 1):
first_line_number = i + 1
else:
last_line_number = i - 1
# Set upper notice boundary only except cases when
# next line is a comment closing line followed by an empty line
# (Note: this fails if old copyright notice has line breaks in it)
if not (not line_has_words(i+1) and is_empty_line(i+2)):
if not (not line_has_words(i + 1) and is_empty_line(i + 2)):
break

if last_line_number is None:
Expand Down
2 changes: 1 addition & 1 deletion test/review_app/server/api/base_test_api_view_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ def tearDown(self):
self.db.shutdown()
shutil.rmtree(self.data_dir, ignore_errors=True)

# Clean Falsk app context
# Clean Flask app context
self.app_context.pop()

0 comments on commit bdc8c18

Please sign in to comment.