{"action":"created","issue":{"url":"https://api.github.com/repos/mantidproject/mantid/issues/15504","repository_url":"https://api.github.com/repos/mantidproject/mantid","labels_url":"https://api.github.com/repos/mantidproject/mantid/issues/15504/labels{/name}","comments_url":"https://api.github.com/repos/mantidproject/mantid/issues/15504/comments","events_url":"https://api.github.com/repos/mantidproject/mantid/issues/15504/events","html_url":"https://github.com/mantidproject/mantid/pull/15504","id":137551984,"number":15504,"title":"MuonAnalysis grouping selection - change unintuitive behaviour","user":{"login":"tom-perkins","id":15363125,"avatar_url":"https://avatars.githubusercontent.com/u/15363125?v=3","gravatar_id":"","url":"https://api.github.com/users/tom-perkins","html_url":"https://github.com/tom-perkins","followers_url":"https://api.github.com/users/tom-perkins/followers","following_url":"https://api.github.com/users/tom-perkins/following{/other_user}","gists_url":"https://api.github.com/users/tom-perkins/gists{/gist_id}","starred_url":"https://api.github.com/users/tom-perkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tom-perkins/subscriptions","organizations_url":"https://api.github.com/users/tom-perkins/orgs","repos_url":"https://api.github.com/users/tom-perkins/repos","events_url":"https://api.github.com/users/tom-perkins/events{/privacy}","received_events_url":"https://api.github.com/users/tom-perkins/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mantidproject/mantid/labels/Component:%20GUI","name":"Component: GUI","color":"009800"},{"url":"https://api.github.com/repos/mantidproject/mantid/labels/Component:%20Muon","name":"Component: Muon","color":"009800"}],"state":"open","locked":false,"assignee":{"login":"raquelalvarezbanos","id":8956985,"avatar_url":"https://avatars.githubusercontent.com/u/8956985?v=3","gravatar_id":"","url":"https://api.github.com/users/raquelalvarezbanos","html_url":"https://github.com/raquelalvarezbanos","followers_url":"https://api.github.com/users/raquelalvarezbanos/followers","following_url":"https://api.github.com/users/raquelalvarezbanos/following{/other_user}","gists_url":"https://api.github.com/users/raquelalvarezbanos/gists{/gist_id}","starred_url":"https://api.github.com/users/raquelalvarezbanos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raquelalvarezbanos/subscriptions","organizations_url":"https://api.github.com/users/raquelalvarezbanos/orgs","repos_url":"https://api.github.com/users/raquelalvarezbanos/repos","events_url":"https://api.github.com/users/raquelalvarezbanos/events{/privacy}","received_events_url":"https://api.github.com/users/raquelalvarezbanos/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mantidproject/mantid/milestones/5","html_url":"https://github.com/mantidproject/mantid/milestones/Release%203.7","labels_url":"https://api.github.com/repos/mantidproject/mantid/milestones/5/labels","id":1106939,"number":5,"title":"Release 3.7","description":"","creator":{"login":"peterfpeterson","id":404003,"avatar_url":"https://avatars.githubusercontent.com/u/404003?v=3","gravatar_id":"","url":"https://api.github.com/users/peterfpeterson","html_url":"https://github.com/peterfpeterson","followers_url":"https://api.github.com/users/peterfpeterson/followers","following_url":"https://api.github.com/users/peterfpeterson/following{/other_user}","gists_url":"https://api.github.com/users/peterfpeterson/gists{/gist_id}","starred_url":"https://api.github.com/users/peterfpeterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterfpeterson/subscriptions","organizations_url":"https://api.github.com/users/peterfpeterson/orgs","repos_url":"https://api.github.com/users/peterfpeterson/repos","events_url":"https://api.github.com/users/peterfpeterson/events{/privacy}","received_events_url":"https://api.github.com/users/peterfpeterson/received_events","type":"User","site_admin":false},"open_issues":571,"closed_issues":249,"state":"open","created_at":"2015-05-12T15:38:13Z","updated_at":"2016-03-02T10:31:03Z","due_on":"2016-06-05T23:00:00Z","closed_at":null},"comments":6,"created_at":"2016-03-01T11:46:56Z","updated_at":"2016-03-02T10:38:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mantidproject/mantid/pulls/15504","html_url":"https://github.com/mantidproject/mantid/pull/15504","diff_url":"https://github.com/mantidproject/mantid/pull/15504.diff","patch_url":"https://github.com/mantidproject/mantid/pull/15504.patch"},"body":"Fixed a bug/unintuitive behaviour reported in the MuonAnalysis interface. The choice of which group/pair to plot should not be changed unexpectedly, it should be changed only if the user explicitly chooses to (via dropdown list, or one of the Plot buttons).\r\n\r\nThis included some refactoring, a selection of free functions was turned into a class (`MuonGroupingHelper`) with the aim of making it a little clearer where the UI is updated.\r\n\r\n**To test:**\r\n\r\n_Test data available at_ `\\\\olympic\\babylon5\\Scratch\\TomPerkins\\Data\\argus00060926.nxs`\r\n\r\n1. (demonstrative test) Run through the steps in the issue and see that the behaviour is more intuitive:\r\n  - Load the test file into MuonAnalysis. Pair `long` should be plotted by default.\r\n  - Go to grouping tab and edit entry for `fwd` to exclude detectors 10-16, which are bad for this dataset.\r\n  - On editing, the data should be replotted (if you have auto-update set to on in the settings tab) The pair plotted should still be `long`, not `fwd`.\r\n  - Go back to Home tab and check the dropdown list is still on `long`.\r\n\r\n2. Use the dropdown list on the Home tab to switch between plotting `fwd`, `bwd` and `long`. Check this works as it should.\r\n\r\n3. On the grouping tab, use the \"Plot\" button by the top (groups) table. The highlighted row should be the group plotted. Check this changes the dropdown on the Home tab too.\r\n\r\n4. As with 3, but use the \"Plot\" button by the bottom (pairs) table.\r\n\r\n5. Edit groupings in the group table. The plot should update automatically (if this option is chosen in the setttings), but the previously selected group/pair (i.e. `long` by default) should not be changed.\r\n\r\n6. As 5 with the pair table\r\n\r\n7. Turn auto-update off in the settings and check that, under these conditions, the plot is only updated by explicitly clicking one of the \"Plot\" buttons\r\n\r\n8. With `fwd` selected in the Home tab dropdown list, edit the pairs table. Check that what is plotted is still `fwd` and not `long`.\r\n\r\n9. Try further combinations to get the interface to behave unexpectedly or break.\r\n\r\nFixes #15457 \r\n\r\n- [x] The [release notes](http://www.mantidproject.org/Release_Notes_3_7_MuonAnalysis#Muon_Analysis) have been updated\r\n\r\n---\r\n\r\n#### Reviewer ####\r\n\r\nPlease comment on the following ([full description](http://www.mantidproject.org/Individual_Ticket_Testing)):\r\n\r\n##### Code Review #####\r\n\r\n- [x] Is the code of an acceptable quality?\r\n- [x] Does the code conform to the coding standards? Is it well structured with small focussed classes/methods/functions?\r\n- [ ] Are there unit/system tests in place? Are the unit tests small and test the a class in isolation?\r\n\r\n##### Functional Tests #####\r\n\r\n- [x] Do changes function as described? Add comments below that describe the tests performed?\r\n- [x] How do the changes handle unexpected situations, e.g. bad input?\r\n- [x] Has the relevant documentation been added/updated?\r\n- [x] Is user-facing documentation written in a user-friendly manner?\r\n- [x] Has developer documentation been updated if required?\r\n\r\n- Does everything look good? Comment with the ship it emoji but don't merge. A member of `@mantidproject/gatekeepers` will take care of it."},"comment":{"url":"https://api.github.com/repos/mantidproject/mantid/issues/comments/191178375","html_url":"https://github.com/mantidproject/mantid/pull/15504#issuecomment-191178375","issue_url":"https://api.github.com/repos/mantidproject/mantid/issues/15504","id":191178375,"user":{"login":"tom-perkins","id":15363125,"avatar_url":"https://avatars.githubusercontent.com/u/15363125?v=3","gravatar_id":"","url":"https://api.github.com/users/tom-perkins","html_url":"https://github.com/tom-perkins","followers_url":"https://api.github.com/users/tom-perkins/followers","following_url":"https://api.github.com/users/tom-perkins/following{/other_user}","gists_url":"https://api.github.com/users/tom-perkins/gists{/gist_id}","starred_url":"https://api.github.com/users/tom-perkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tom-perkins/subscriptions","organizations_url":"https://api.github.com/users/tom-perkins/orgs","repos_url":"https://api.github.com/users/tom-perkins/repos","events_url":"https://api.github.com/users/tom-perkins/events{/privacy}","received_events_url":"https://api.github.com/users/tom-perkins/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T10:38:06Z","updated_at":"2016-03-02T10:38:06Z","body":"Yes, I think the call to `plotItem()` is unnecessary now that setting the group/pair causes a refresh of the plot. Hopefully this will be less confusing now the function has been renamed!\r\n\r\nThe point of forcing a replot when the group is changed is so that the plot is always in sync with the group/pair selected on the UI."}}