Ticket #7708 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Put back lazy-populating of workspace information in MantidDock

Reported by: Martyn Gigg Owned by: Martyn Gigg
Priority: critical Milestone: Release 3.0
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester: Gesner Passos

Description (last modified by Martyn Gigg) (diff)

This task relates to the workspace dock in MantidPlot.

The recent updates surrounding workspace groups, #7253, implemented a new scheme for populating the workspace list. The original idea for the implementation was to have a method on Workspace that would return a simple string representation of itself that would then be used to populate the item details and this would still only be called at the point when an item was expanded. Most of the time the items are never expanded so we want to do a minimum amount of work when actually populating it.

The actual implementation seems to have wandered a little bit and has ended up with something that is computing all of the details of a workspace every time the dock is updated, regardless of whether the details are actually shown or not.

The task her is to restore the lazy loading mechanism.

Attachments

myLoadLotsOfFiles.py (7.8 KB) - added by Gesner Passos 7 years ago.

Change History

comment:1 Changed 7 years ago by Martyn Gigg

  • Status changed from new to inprogress

ADS can now return map of top level items.

The map shows the name & workspace of any items that are groups or not members of groups. Refs #7708

Changeset: 297f458926f823f288850833961d6fd7de1137e0

comment:2 Changed 7 years ago by Martyn Gigg

Implemented Workspace::toString for all workspace types.

This now returns a human-readable string detailing the structure of the workspace. Refs #7708

Changeset: d28b436ec3c95cbdfc02f447824b63065c0f13c4

comment:3 Changed 7 years ago by Martyn Gigg

First cut at putting back lazy-population of the MantidDock

Still needs icons & WorkspaceGroup sub items. Refs #7708

Changeset: fe8a304c673e4731cc121cf8ec5f4ca0355030e8

comment:4 Changed 7 years ago by Martyn Gigg

Modified MantidDockWidget to use Workspace::toString

This will ease future extensions should the ADS ever be made to handle more than workspaces. Refs #7708

Changeset: f642a01444a384137410e34be8eac119e0b19d53

comment:5 Changed 7 years ago by Martyn Gigg

Only sort in MantidDock when tree is not updating.

Refs #7708

Changeset: d3ca8687b7c3f508633561e69d7b800ef7bc15dc

comment:6 Changed 7 years ago by Martyn Gigg

Removed unused code in MantidDock.

Refs #7708

Changeset: 95837e78c59c2ee108945cbf49d2146bc4c31c89

comment:7 Changed 7 years ago by Martyn Gigg

Remove obselete InfoNode class & all references.

Refs #7708

Changeset: f8d8c272caa713fcfc90920d8cdebfd7b34b3798

comment:8 Changed 7 years ago by Martyn Gigg

Attach DataItem::toString to Python repr method.

Refs #7708

Changeset: 391963f43d39b676df55dc073e573493ea0e75de

comment:9 Changed 7 years ago by Martyn Gigg

Fix memToString call to use explicitly instantiated type.

The OS X size_t version isn't covered by the ones currently used. Refs #7708

Changeset: d7198b5f1185542fb9d1d6ee4d6d55f33859d089

comment:10 Changed 7 years ago by Martyn Gigg

Fix MatrixWorkspaceTest after removing memory from description

Refs #7708

Changeset: 7b3553481875c3c45e9777f86d9883d74baf7d35

comment:11 Changed 7 years ago by Martyn Gigg

  • Description modified (diff)

Branch: bugfix/7708_lazy_dock_workspace_details

Tester: The tests here need to be quite involved. They should cover creation, at least once, of every type of workspace in Mantid. Check the details for each type look correct and also check the icons are correct.

Check that if an existing item is expanded then when that workspace is replaced: the item is left expanded but the details are updated.

Check fast running scripts (run a reduction in a loop hundreds of times) to check that no segfaults/hangs occur. The script in #7583 is a good example.

Finally, try and break it!

  • Run two scripts at once.
  • Try running an algorithm from the GUI while a script is executing.
  • ...
Last edited 7 years ago by Martyn Gigg (previous) (diff)

comment:12 Changed 7 years ago by Martyn Gigg

  • Status changed from inprogress to verify
  • Resolution set to fixed

comment:13 Changed 7 years ago by Gesner Passos

  • Status changed from verify to verifying
  • Tester set to Gesner Passos

Changed 7 years ago by Gesner Passos

comment:14 Changed 7 years ago by Gesner Passos

  • Status changed from verifying to reopened
  • Resolution fixed deleted

A nice implementation. It works quite well for normal operations. It is much more responsive. For example, while using this branch I found that it solves issues presented in #7564.

But, you have asked to break it. And, I'm affraid I was able to do it.

How?

Once I got some exceptions on the reduction, other times, it printed some warnings from the Dock:

Cannot find icon for workspace ID 'ManagedRawFileWorkspace2D'

And them, the workspace is displayed without icon.

Another concern, it is not related to this ticket, but I was not able to run the example in #7583.

comment:15 Changed 7 years ago by Martyn Gigg

  • Status changed from reopened to inprogress

Missed ManagedRawFileWorkspace2D from icon list.

Refs #7708

Changeset: d020377ae98a453cc155d9afbdd604775fa7d916

comment:16 Changed 7 years ago by Martyn Gigg

Fix missing ID string for IMDWorkspaces in workspace dock

Refs #7708

Changeset: 86e43e6897d4cafb76958ca4d66f607ce14eb056

comment:17 Changed 7 years ago by Martyn Gigg

  • Status changed from inprogress to verify
  • Resolution set to fixed

Fixed the missing icon and another issue with IMDWorkspaces ID strings that I spotted.

The exception seen is most probably a result of the two scripts intensely processing the same things and I think is enough of an edge case not to worry about. In any case the exception does kill Mantid so we should be okay.

comment:18 Changed 7 years ago by Gesner Passos

  • Status changed from verify to closed

Merge remote-tracking branch 'origin/bugfix/7708_lazy_dock_workspace_details'

comment:19 Changed 7 years ago by Gesner Passos

No more icons problems, and I could not agree more with Martyn. It is doing a good job and it is worth passing on.

comment:20 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8553

Note: See TracTickets for help on using tickets.