Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#749 closed enhancement (fixed)

Also allow the Python Shell/Editor to be invoked from the Fitting > Edit Custom Models sub-menu

Reported by: richardh Owned by: smk78
Priority: major Milestone: SasView 4.1.0
Component: SasView Keywords:
Cc: Work Package: SasView GUI Enhancements

Description

Also allow the Python Shell/Editor to be invoked from the Fitting > Edit Custom Models sub-menu because it is now used more with the enhancements to custom/plugin models.

Change History (9)

comment:1 Changed 8 years ago by smk78

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

comment:2 Changed 8 years ago by smk78

In 0733da4a5abf9b3a2d8e6c7ce9ea018a8d6d3500/sasview:

Added "Python Shell/Editor?" text to menu drop-down Fitting > Edit Custom
Model. Now need to invoke the functionality. Refs #749

comment:3 Changed 8 years ago by butler

We should discuss before closing but I believe that the better answer has always been available though little used and is now (since Piotr fix) even more useful for custom model editing — it is called advanced — perhaps a different nomenclature? or perhaps only a problem for those of us who know the old editor better and never used the advanced model editor?

comment:4 Changed 8 years ago by richardh

Paul said Basically would like to discuss what you are wanting exactly — As I understand what you are asking, I think is a very bad idea!! Only python ninja's should be using that console :-) — it is a direct command line console — further it is completely unrelated to fitting and thus properly in tools. For working with custom (i.e. plugin) models people should be using the "advanced" editor which Paul K and Piotr have been enhancing to not only allow full editing of both C and python but also run automatic checks of the code and return some level of error messages if it won't run.

Maybe I have completely misunderstood the point of 749 but figure I better get the discussion going before we go too far just in case it isn't needed

Richard says … Now I am confused, as I was only following to the letter the instructions in the documentation for how to put in a plugin model and test it, which uses the python shell tool. If there is something better in the pipeline then I don't know anything about it. The ticket was that I merely thought it awkward that the editor was not in the same menu as the plugin models, where I was needing to use it.

comment:5 Changed 8 years ago by butler

Ahhh… I should look at the instructions then — but seems like we should not be asking people to go to the python shell to write a plugin — a developer maybe but not for a user plugin. We should figure out what really needs doing and hopefully give the functionality from the plugin (advanced) editor without requiring full console access which I think is more dangerous. Perhaps we need to bring Andrew and or Piotr in on the discussion.

comment:6 Changed 8 years ago by butler

Ok … have looked at the instructions and while it is clear that we should revert the changes made so far on this ticket before closing it, I am worried about instructing the general user to go to the python shell.

That said the instructions are clear that you should switch to the shell tab and not go to the tool menu and the PyCrust editor. The advanced editor essentially is the same PyCrust editor apparently …. We should discuss these instructions a bit more broadly however I think and perhaps adjust them?

comment:7 follow-up: Changed 8 years ago by smk78

No. The instructions - which were written by PaulK by the way - instruct a user who only has a downloaded installer version of SasView to use the built-in Python shell to test their plugin, because they have nothing else! They could edit their model in it too if they wanted, but Notepad would be far easier! The switch to the shell tab relates to those with a development environment. But, like Richard, I am curious to know what this Advanced Editor is?

comment:8 Changed 8 years ago by smk78

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

In bc7b5da22222f028cc5564cd6e463dc47ef5f9e5/sasview:

Cancel modifications for #749 as deemed unwelcome. Close #749

comment:9 in reply to: ↑ 7 Changed 8 years ago by pkienzle

Replying to smk78:

No. The instructions - which were written by PaulK by the way - instruct a user who only has a downloaded installer version of SasView to use the built-in Python shell to test their plugin, because they have nothing else! They could edit their model in it too if they wanted, but Notepad would be far easier! The switch to the shell tab relates to those with a development environment. But, like Richard, I am curious to know what this Advanced Editor is?

The "Advanced Editor" is very similar to the >Tools >Python Console, but it is associated with a particular model, which allows you to click a menu item to reload and check the model. As per #668, the additional model tests I describe should be added into menu options so that users don't have to type obscure commands on the console. The advanced model documentation needs to be updated once this is done.

If editing models with a separate editor (after figuring out where the models are stored, which can sometimes be tricky on Windows), the checking tools will not be available from the model editor. How will they be triggered?

BTW, Notepad on windows gets confused by files without carriage_return-linefeed line separators. There are many much better editors for code, such as notepad++. Files generated on mac and uploaded to the matrix marketplace may not have the right line endings.

Note: See TracTickets for help on using tickets.