Skip to content
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

Also allow the Python Shell/Editor to be invoked from the Fitting > Edit Custom Models sub-menu (Trac #749) #865

Closed
RichardHeenan opened this issue Mar 30, 2019 · 9 comments
Assignees
Labels
Enhancement Feature requests and/or general improvements Major Big change in the code or important change in behaviour
Milestone

Comments

@RichardHeenan
Copy link
Contributor

RichardHeenan commented Mar 30, 2019

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.

Migrated from http://trac.sasview.org/ticket/749

{
    "status": "closed",
    "changetime": "2016-10-10T14:09:48",
    "_ts": "2016-10-10 14:09:48.955472+00:00",
    "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.",
    "reporter": "richardh",
    "cc": "",
    "resolution": "fixed",
    "workpackage": "SasView GUI Enhancements",
    "time": "2016-10-09T17:00:51",
    "component": "SasView",
    "summary": "Also allow the Python Shell/Editor to be invoked from the Fitting > Edit Custom Models sub-menu",
    "priority": "major",
    "keywords": "",
    "milestone": "SasView 4.1.0",
    "owner": "smk78",
    "type": "enhancement"
}
@RichardHeenan RichardHeenan added this to the SasView 4.1.0 milestone Mar 30, 2019
@RichardHeenan RichardHeenan added Enhancement Feature requests and/or general improvements Incomplete Migration Major Big change in the code or important change in behaviour and removed Incomplete Migration labels Mar 30, 2019
@smk78
Copy link
Contributor

smk78 commented Mar 30, 2019

Trac update at 2016/10/09 17:01:39:

  • smk78 changed owner from "" to "smk78"
  • smk78 changed status from "new" to "assigned"

@smk78
Copy link
Contributor

smk78 commented Mar 30, 2019

Trac update at 2016/10/09 17:06:31: smk78 commented:

In changeset 0733da4:

#!CommitTicketReference repository="sasview" revision="0733da4a5abf9b3a2d8e6c7ce9ea018a8d6d3500"
Added "Python Shell/Editor" text to menu drop-down Fitting > Edit Custom
Model. Now need to invoke the functionality. Refs #865

@butlerpd
Copy link
Member

Trac update at 2016/10/09 20:54:35: butler commented:

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?

@RichardHeenan
Copy link
Contributor Author

Trac update at 2016/10/09 22:50:32: richardh commented:

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.

@butlerpd
Copy link
Member

Trac update at 2016/10/09 22:58:07: butler commented:

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.

@butlerpd
Copy link
Member

Trac update at 2016/10/10 01:07:39: butler commented:

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?

@smk78
Copy link
Contributor

smk78 commented Mar 30, 2019

Trac update at 2016/10/10 02:11:28: smk78 commented:

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?

@smk78
Copy link
Contributor

smk78 commented Mar 30, 2019

Trac update at 2016/10/10 02:23:48:

  • smk78 commented:

In changeset bc7b5da:

#!CommitTicketReference repository="sasview" revision="bc7b5da22222f028cc5564cd6e463dc47ef5f9e5"
Cancel modifications for #865 as deemed unwelcome. Close #865
  • smk78 changed resolution from "" to "fixed"
  • smk78 changed status from "assigned" to "closed"

@pkienzle
Copy link
Contributor

Trac update at 2016/10/10 14:09:48: pkienzle commented:

Replying to [comment:7 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 #799, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Feature requests and/or general improvements Major Big change in the code or important change in behaviour
Projects
None yet
Development

No branches or pull requests

4 participants