<div dir="ltr">For those interested and unaware, many of the patterns in the Design Patterns book (<a href="http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612">http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612</a>, also easily found on google) deal with enabling this kind of functionality. Not coming from a formal CS background, that book taught me a lot about good application design.<div>
<br></div><div style>In particular, the "Command" pattern deals with encapsulating state, and making it more reproducible. The basic idea is to map GUI interactions into explicit request/command objects -- the GUI code creates and fires off these commands, which the backend responds to. This allows you to keep a log of commands, which you can use to recreate state. You can also create a second, scripting interface for building these commands, and even write a translation layer to convert a command log to scripting layer calls.</div>
<div style><br></div><div style><br></div><div style>The ChIPS people used this approach for Chandra (<a href="http://cxc.harvard.edu/chips4.4/index.html">http://cxc.harvard.edu/chips4.4/index.html</a>), and that code has lots of good examples.</div>
<div style><br></div><div style>chris</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 21, 2013 at 7:58 AM, Perry Greenfield <span dir="ltr"><<a href="mailto:stsci.perry@gmail.com" target="_blank">stsci.perry@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On Jun 20, 2013, at 5:59 PM, Thøger Emil Rivera-Thorsen wrote:<br>
<br>
> On 20-06-2013 21:20, Adrian Price-Whelan wrote:<br>
>> I'm totally lost on what thread I'm responding to, but +100 to what<br>
>> Perry said about GUIs! IMHO there is plenty to keep us busy working on<br>
>> the modeling and backend, and we should focus our efforts on making<br>
>> that code super slick and useable *first*, then worry about a GUI<br>
>> (which, also IMO, are overrated! why do you want to click on your<br>
>> absorption lines anyways??).<br>
> Most of our work doesn't require a GUI, but a few tasks can be helped<br>
> immensely by a good one.<br>
> One of these, but not the only one, is the case of having to give a good<br>
> initial guess to a fitting package, if you have many lines and many<br>
> components and many tied, frozen or thawed parameters.<br>
><br>
> Something that is vitally important for writing a good GUI, IMO, is<br>
> reproducibility, which means that pretty much all settings that one<br>
> creates should be possible to write into a script or into the model or<br>
> something, so one doesn't have to rely on one's shaky and<br>
> coffee-trembling hands to find the same settings multiple times.<br>
><br>
> /Emil<br>
<br>
</div>Yes, I've long felt that was a critical element to a good GUI. They are great to play with the data, and how to view the data. But at some point, one wants to be able to repeat that easily, either to do batch processing, replicate the results (perhaps to tweak a bit more), or be consistent in the processing of other similar data. It would be even better if the GUI could save a script that effectively recreates what was done without requiring any interaction (rather than a lot of hidden machinery to recreate the state).<br>
<div class="HOEnZb"><div class="h5"><br>
Perry<br>
<br>
<br>
_______________________________________________<br>
AstroPy mailing list<br>
<a href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/astropy" target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>************************************<br>Chris Beaumont<br>Graduate Student<br>Institute for Astronomy<br>University of Hawaii at Manoa<br>2680 Woodlawn Drive<br>
Honolulu, HI 96822<br><a href="http://www.ifa.hawaii.edu/~beaumont">www.ifa.hawaii.edu/~beaumont</a><br>************************************
</div>