-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error Loading custom models if name attribute differs from the model file name #1443
Comments
|
Sorry ... I was being lazy. For number 1 I would have put critical (still higher than major because we added it early on to 4.x because of confusion and figure it will only be worse now that people are used to it? but maybe not), but indeed not blocker. The blocker was because of point 2 which I am very surprised didn't reproduce. Actually we did reproduce on 2 different windows 10 machines. Further it was failing in 5.0 release and on 5.0.1 nightly jenkins build #317 as well as probably 5.0.1 release candidate 1 (though could have been a later version). I eventually realized the reason the student could not load the plugin by noticing that an error was being generated "cannot find file xxxx" where xxx was the name attribute value not the file name. When we renamed the files to match the name attribute it worked on both computers. I will try to investigate a bit more, starting by seeing what happens for me when creating a test.py |
Perhaps a dialog to add models to the plugin directory? That way we don't have to document ~/.sasview/plugins as the path, which can be difficult to navigate to on Mac since dot files are hidden from the finder, and the GUI will know to reset the plugin list. |
Added plugin file loader to the Plugin Manager, under "Add file...". |
It's because it lives in a separate branch. Sorry - should've added this to the description. |
If this was merged into ESS_GUI 10 days ago shouldn't the plugin file loader be available in the 5.0.1 release? I also just tried pulling and building the ESS_GUI branch and it's not appearing there either. |
Ahh! So with the 5.0.1 release running, I went into my plugin folder and made a copy of a plugin that was available to use in a 5.0.1 FitPage. I renamed the .py file to something new, and edited the model name inside to something new also. I then went to the plugin manager > Add file... and selected the new .py file. I get this: which seemed odd? I then clicked Yes and the Log Explorer reported
and if I look in the list of plugins in the FitPage the model is not there. |
Let me also quickly add that whilst that example was a P(Q)*S(Q) plugin, the same behaviour is demonstrated by P(Q)+P(Q) plugins. |
Yes, I can reproduce this issue - I should've added a catch for shutil.copy for copying files to itself. |
As per discussion today moving this to 5.0.3 milestone. Also downgrading from blocker to critical since:
|
Having retested the original problem reported using 5.0.2 release I can in fact still reproduce both issues but will agree that issue 1 actually minor. Here is an update from more careful testing:
Bottom line is that I suggest we should close this issue and create two new ones for point 2 and 3 but both would be major not critical. For now I will just call this issue as major |
Here is the Traceback which appears in the console log and sasview.log (but strangely not the plugin.log). The python file name here is
|
Testing 5.0.5RC2 (windows 10) the original points remain true. In particular for point 2, I created a python model called polynomial.py using the sasview new model editor. Actually it is a simple quadratic with the three coefficients as parameters. It works fine for a number of tests. For this test I used the built in model editor to change the name attribute to poly_test2. Now choosing a different category then back to plugins, the new name appears in the dropdown: poly_test2. Selecting it however produces the single line error in the log: `Can't find the model No module nameds 'sasmodels.model.polynomial' Exiting the application then restarting it, then selecting Plugin Models again and poly_test2 the traceback shown in the previous post of May 2020 is thrown. |
A user from Lund University has found two bug in the 5.X custom models package (4.2.2 works correctly).
New models that are dropped into the plugin folder while SasView is running do not get picked up on the fly. This is true of 4.x as well which is why the option to "load plugin" under " Plugin Model Operations" was added. This option seems to have been lost in the transition to 5.x and clearly needs to be restored.
5.x incorrectly assumes the python file name is the same as the UI name given within the model file via the "name" attribute, appended with a .py. This of course is not the case. If it were, the name property would be pointless.
The text was updated successfully, but these errors were encountered: