Skip to content

Update subject priority for sequential selection - #339

Open
yuenmichelle1 wants to merge 3 commits into
masterfrom
update-subject-priority-for-sequential-selection
Open

Update subject priority for sequential selection#339
yuenmichelle1 wants to merge 3 commits into
masterfrom
update-subject-priority-for-sequential-selection

Conversation

@yuenmichelle1

Copy link
Copy Markdown
Collaborator

Part of this panoptes issue: zooniverse/panoptes#4582

TL;DR of the issue is that when project teams want to set up sequential subject selection BUT did not upload priority within subject metadata on initial upload, Designator does not see updated priority when project team updates subject metadata. [Eg script of how project teams update subject metadata found here: https://github.com/zooniverse/Data-digging/blob/master/scripts_Utility/edit_metadata_indiv.py] Mainly because Designator looks at a Subject's corresponding SetMemberSubject to view priority.

This change allows project teams a way to not only update subject metadata's priority but also the SetMemberSubject for Designator to show correct subject order.


if self.id is None:
raise ObjectNotSavedException

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line contains whitespace

side_effect=[
iter([set_member_subject_1]),
iter([set_member_subject_2]),
],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closing bracket does not match indentation of opening bracket's line
continuation line with same indent as next logical line

with patch.object(self.subject, "save") as mock_save, \
patch(
"panoptes_client.panoptes.LinkResolver.__getattr__",
return_value=[subject_set_1, subject_set_2],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for hanging indent

set_member_subject_2 = MagicMock()

with patch.object(self.subject, "save") as mock_save, \
patch(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line over-indented for hanging indent

with self.assertRaises(ObjectNotSavedException):
self.subject.update_priority(1)

def test_update_priority_updates_priority_for_saved_subject(self):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

Comment thread panoptes_client/tests/test_subject.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant