Opened 3 years ago

Closed 2 years ago

#861 closed defect (fixed)

cannot defined a structure factor plugin

Reported by: pkienzle Owned by: lewis
Priority: major Milestone: SasView 4.2.0
Component: SasView Keywords:
Cc: Work Package: SasView Bug Fixing

Description

Plug-in models define the "is_structure_factor" attribute if structure_factor=True in the model.py file, but those plugins don't appear in the drop-down list of structure factor models in the sasview GUI.

Change History (3)

comment:1 Changed 3 years ago by pkienzle

In order to fix this, the code in sasgui/perspectives/fitting/models.py will need to be refactored so that whenever plugins_reset() is called, the entire list of standard models (available from sasmodels.sasview_models.MODELS) plus the entire list of plugins (available in self.stored_plugins) is scanned, creating a new self.struct_list with all the structure factor models.

The ModelManager.get_model_list() method uses self.struct_list to set the "Structure Factor" element of the model list dict, which it assigns to FitPanel.model_list_box in fitpanel.py, which sends it to the FitPage via panel.populate_box() method when add_empty_page() is called. This calls self.initialize_combox() to trigger _populate_box() to append the items one after the other to the self.structurebox combobox.

The same code that triggers plugins_reset() needs to reset the structure box for all fit pages. This happens in Plugin.update_custom_combo() within fitting.py. Once the new struct_list construction code is done, it should just be a matter of introducing the following code into update_custom_combo:

    page.structurebox.Clear()
    page.initialize_combox()

comment:2 Changed 2 years ago by lewis

  • Owner set to lewis
  • Status changed from new to assigned

comment:3 Changed 2 years ago by butler

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

Fixed by Lewis SasView PR 104

Note: See TracTickets for help on using tickets.