Opened 5 years ago

Closed 5 years ago

#588 closed defect (fixed)

old custom models break !SasView

Reported by: butler Owned by:
Priority: blocker Milestone: SasView 4.0.0
Component: SasView Keywords:
Cc: Work Package: SasView Bug Fixing

Description

If the user has any custom models in the plugins directory which will likely be true for most if not all existing users, installing SasView 4.0 alpha will cause fitting not to load at all on startup due to a failing import statement (the old plugin class the custom models use is no longer available). Thus we have two problems:

  1. returning users will find the new version doesn't even run
  2. if we fix that somehow we still have the problem that all their custom models are now broken.

For the full release we must fix 1 and should do something to minimize pain of 2. A cheap solution to 1 might be to surround loading of plugins with a try except and on failure provide feedback that old models are in the directory? A step further could remove those files to a subdirectory and provide infrastructure to make them continue to work. Alternatively we could try to provide a converter?

Change History (4)

comment:1 Changed 5 years ago by wojciech

It seems that the simple (cheap) solution can be achieved by moving a load_custom_model function (line 189) in src/sas/sasgui/perspectives/fitting/model.py to "try:" statement (a few lines above). It will load plugin models from ./sasview/plugin_models if possible. Otherwise empty dict is returned and no custom models are available.

comment:2 Changed 5 years ago by wojciech

The change in src/sas/sasgui/perspectives/fitting/model.py as explained in earlier comment seems to fix issue 1 (returning users will find the new version doesn't even run). The 2nd issue (old custom models are broken) remains unsolved.

comment:3 Changed 5 years ago by butler

Andrew suggests a possible "fix" to 2 would be that when trapping (presumably the fix just applied) on except we pop up a box informing the user of the change and what they need to do to get their models working again (or point then to instructions) … and maybe an apolgy explaining this change does make things a lot better in the long run?

comment:4 Changed 5 years ago by pkienzle

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.