Opened 11 years ago

Closed 11 years ago

#208 closed defect (fixed)

Category code structure needs fixing

Reported by: butler Owned by: butler
Priority: major Milestone: SasView 3.0.0
Component: SasView Keywords:
Cc: Work Package:

Description

Category manager only works somewhat. If you try to add too many categories it breaks down. Looking at code it is clear that the new category manager approach implemented by Kieren still has occasional clashes with the original way categories were set up. This code needs to be cleaned up.

Change History (3)

comment:1 Changed 11 years ago by butler

The code is more convoluted than originallly thought. This ticket is broken down into two parts:

  • Change the way the categories are stored persistantly from using a pickle file to a human readable json file.
  • Replace the hard coded "Shapes" and "Shape independent" menu items with menu items pulled from the category file

In the longer term, once the new model structure is implemente, the whole get models function in model.py should be rewritten as a loop over the models discovered (as opposed to having to hard code them here as being present - sometimes causing errors when it is hard coded but the corresponding py model file is not found). Further the models should then have attributes that can be queried to return whehter structure factor, multiplicity model etc which are currently also hard coded.

comment:2 Changed 11 years ago by butler

Part one is now done. Besides being a small cleanup, it allows for new models introduced at camp to have a default category that is not "uncategorized".

comment:3 Changed 11 years ago by butler

  • Resolution set to fixed
  • Status changed from new to closed

Phase I is complete — pickle file is converted to a human readable json file and the category lists have been separated from the "attribute" lists. No remaining hard coded shape and shape independent categories remains. Also large section of model.py is removed as obsolete. Also a fair amount of commenting of code has been added. The design could however be significantly cleaned up including renaming of functions and lists to be more descritptive. This will be for another ticket however. PDB April 26, 2014

Note: See TracTickets for help on using tickets.