helprelax - Support: sr #3117, Functionality to inspect...

 
 
Show feedback again

sr #3117: Functionality to inspect interactively after running script - The equivalence to python -i

Submitted by:  Troels E. Linnet <tlinnet>
Submitted on:  Thu 13 Feb 2014 11:47:57 AM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 1 - WishStatus: Done
Assigned to: Troels E. Linnet <tlinnet>Open/Closed: Closed
Operating System: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Mon 17 Feb 2014 08:25:37 AM UTC, SVN revision 22195:

Merged revisions 22191 via svnmerge from
svn+ssh://bugman@svn.gna.org/svn/relax/trunk

........
r22191 | tlinnet | 2014-02-14 15:19:58 +0100 (Fri, 14 Feb 2014) | 6 lines

Fix for the user function intro flag.

Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i

It should be turned on for the script so you see the "relax>" messages, and then turned off again for the prompt so that
the user function text and "relax>" is not printed out twice.
........

(Browse SVN revision 22195)

Edward d Auvergne <bugman>
Project Administrator
Fri 14 Feb 2014 02:19:58 PM UTC, SVN revision 22191:

Fix for the user function intro flag.

Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i

It should be turned on for the script so you see the "relax>" messages, and then turned off again for the prompt so that
the user function text and "relax>" is not printed out twice.

(Browse SVN revision 22191)

Troels E. Linnet <tlinnet>
Project MemberIn charge of this item.
Fri 14 Feb 2014 01:32:42 PM UTC, SVN revision 22190:

Merged revisions 22181-22189 via svnmerge from
svn+ssh://bugman@svn.gna.org/svn/relax/trunk

........
r22181 | tlinnet | 2014-02-14 10:32:15 +0100 (Fri, 14 Feb 2014) | 3 lines

Shifted the pedantic flag to escalate flag. The option -p would insted be used for the option --prompt.

Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i
........
r22182 | tlinnet | 2014-02-14 10:32:17 +0100 (Fri, 14 Feb 2014) | 3 lines

Added the -p --prompt option for running a relax script and inspect interactively.

Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i
........
r22183 | tlinnet | 2014-02-14 11:22:56 +0100 (Fri, 14 Feb 2014) | 1 line

Second
........
r22184 | tlinnet | 2014-02-14 11:22:57 +0100 (Fri, 14 Feb 2014) | 6 lines

Modified the help text to explain that -p will launch relax in prompt mode after running any optionally supplied scripts.

Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i

This is to allow the -p --prompt option to be given without a script. relax should support this so that a user doesn't get too confused when
trying to start in prompt mode with the --prompt flag and support the --prompt argument without a script being supplied.
........
r22185 | tlinnet | 2014-02-14 11:47:33 +0100 (Fri, 14 Feb 2014) | 22 lines

Manually reverted the temporary change of r22184 and 22183.

The command used was:

svn merge -r22184:r22182 .

.....
r22184 | tlinnet | 2014-02-14 11:22:57 +0100 (Fri, 14 Feb 2014) | 6 lines

Modified the help text to explain that -p will launch relax in prompt mode after running any optionally supplied scripts.

Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i

This is to allow the -p --prompt option to be given without a script. relax should support this so that a user doesn't get too confused when
trying to start in prompt mode with the --prompt flag and support the --prompt argument without a script being supplied.
------------------------------------------------------------------------
r22183 | tlinnet | 2014-02-14 11:22:56 +0100 (Fri, 14 Feb 2014) | 1 line

Second
.....

[...]........

[...] r22186 | tlinnet | 2014-02-14 11:54:44 +0100 (Fri, 14 Feb 2014) | 6 lines

[...]

[...] Modified the help text to explain that -p will launch relax in prompt mode after running any optionally supplied scripts.

[...]

[...] Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i

[...]

[...] This is to allow the -p --prompt option to be given without a script. relax should support this so that a user doesn't get too confused when

[...] trying to start in prompt mode with the --prompt flag and support the --prompt argument without a script being supplied.

[...]........

[...] r22187 | tlinnet | 2014-02-14 12:13:05 +0100 (Fri, 14 Feb 2014) | 6 lines

[...]

[...] Finished implementing the functionality of interacting with variables after executing a script.

[...]

[...] Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i

[...]

[...] For getting access to variables after executing a script, the variable should be saved under: cdp.X, where X define a container.

[...] The name space issue is discussed in: http://thread.gmane.org/gmane.science.nmr.relax.devel/5012

[...]........

[...] r22188 | tlinnet | 2014-02-14 12:28:25 +0100 (Fri, 14 Feb 2014) | 3 lines

[...]

[...] Added Copyright info to modified file.

[...]

[...] Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i

[...]........

[...] r22189 | bugman | 2014-02-14 14:24:25 +0100 (Fri, 14 Feb 2014) | 8 lines

[...]

[...] Organisation of the relax command line options into distinct groups.

[...]

[...] This follows from the message at http://thread.gmane.org/gmane.science.nmr.relax.devel/5024.

[...]

[...] The optparse.OptionGroup object is now used to cluster the arguments. This cleans up the output of

[...] 'relax -h' and explains the options to the user in a clearer way.

[...]........

[...]

[...]

(Browse SVN revision 22190)

Edward d Auvergne <bugman>
Project Administrator
Fri 14 Feb 2014 11:28:25 AM UTC, SVN revision 22188:

Added Copyright info to modified file.

Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i

(Browse SVN revision 22188)

Troels E. Linnet <tlinnet>
Project MemberIn charge of this item.
Fri 14 Feb 2014 11:19:52 AM UTC, comment #8:

This support request has now been implemented.

Note, a relevant namespace issue is discussed here:
http://thread.gmane.org/gmane.science.nmr.relax.devel/5012

For getting access to variables after executing a script, the variable should be saved under: cdp.X, where X define a container.

An example of running relax in interactively mode is the script: test.py which contains:
------------------
pipe.create(pipe_name='test', pipe_type='relax_disp')
cdp.a = 10
print "helo"
state.save("namespace_test")
-------
Then run relax with:
relax -p test.py

Output
---------------------------------
[tlinnet@tomat relax_trunk]$ ./relax -p test.py

[CUTTED INFO TEXT]

Processor fabric: Uni-processor.

script = 'test.py'
----------------------------------------------------------------------------------------------------
pipe.create(pipe_name='test', pipe_type='relax_disp')
cdp.a = 10
print "helo"
state.save("namespace_test")
----------------------------------------------------------------------------------------------------
helo
Opening the file 'namespace_test.bz2' for writing.

relax> print cdp.a
10
-------------------------------------------------------

Afterwards, the state can be loaded, and the variable still be accessed.

Output
----------------------------
[tlinnet@tomat relax_trunk]$ ./relax

[CUTTED INFO TEXT]

Processor fabric: Uni-processor.

relax> state.load("namespace_test")
Opening the file 'namespace_test.bz2' for reading.
relax> print cdp.a
10
relax> print cdp
The data pipe storage object.

Objects:
a: 10
hybrid_pipes: []
interatomic: The interatomic data list (for the storage of the inter-spin system data)
mol: The molecule list (for the storage of the spin system specific data)
pipe_type: u'relax_disp'

relax>

Troels E. Linnet <tlinnet>
Project MemberIn charge of this item.
Fri 14 Feb 2014 11:13:05 AM UTC, SVN revision 22187:

Finished implementing the functionality of interacting with variables after executing a script.

Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i

For getting access to variables after executing a script, the variable should be saved under: cdp.X, where X define a container.
The name space issue is discussed in: http://thread.gmane.org/gmane.science.nmr.relax.devel/5012

(Browse SVN revision 22187)

Troels E. Linnet <tlinnet>
Project MemberIn charge of this item.
Fri 14 Feb 2014 10:54:44 AM UTC, SVN revision 22186:

Modified the help text to explain that -p will launch relax in prompt mode after running any optionally supplied scripts.

Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i

This is to allow the -p --prompt option to be given without a script. relax should support this so that a user doesn't get too confused when
trying to start in prompt mode with the --prompt flag and support the --prompt argument without a script being supplied.

(Browse SVN revision 22186)

Troels E. Linnet <tlinnet>
Project MemberIn charge of this item.
Fri 14 Feb 2014 10:47:34 AM UTC, SVN revision 22185:

Manually reverted the temporary change of r22184 and 22183.

The command used was:

svn merge -r22184:r22182 .

.....
r22184 | tlinnet | 2014-02-14 11:22:57 +0100 (Fri, 14 Feb 2014) | 6 lines

Modified the help text to explain that -p will launch relax in prompt mode after running any optionally supplied scripts.

Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i

This is to allow the -p --prompt option to be given without a script. relax should support this so that a user doesn't get too confused when
trying to start in prompt mode with the --prompt flag and support the --prompt argument without a script being supplied.
------------------------------------------------------------------------
r22183 | tlinnet | 2014-02-14 11:22:56 +0100 (Fri, 14 Feb 2014) | 1 line

Second
.....

(Browse SVN revision 22185)

Troels E. Linnet <tlinnet>
Project MemberIn charge of this item.
Fri 14 Feb 2014 10:22:58 AM UTC, SVN revision 22184:

Modified the help text to explain that -p will launch relax in prompt mode after running any optionally supplied scripts.

Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i

This is to allow the -p --prompt option to be given without a script. relax should support this so that a user doesn't get too confused when
trying to start in prompt mode with the --prompt flag and support the --prompt argument without a script being supplied.

(Browse SVN revision 22184)

Troels E. Linnet <tlinnet>
Project MemberIn charge of this item.
Fri 14 Feb 2014 09:32:17 AM UTC, SVN revision 22182:

Added the -p --prompt option for running a relax script and inspect interactively.

Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i

(Browse SVN revision 22182)

Troels E. Linnet <tlinnet>
Project MemberIn charge of this item.
Fri 14 Feb 2014 09:32:15 AM UTC, SVN revision 22181:

Shifted the pedantic flag to escalate flag. The option -p would insted be used for the option --prompt.

Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i

(Browse SVN revision 22181)

Troels E. Linnet <tlinnet>
Project MemberIn charge of this item.
Thu 13 Feb 2014 04:48:25 PM UTC, comment #1:

This follows the discussion at: http://thread.gmane.org/gmane.science.nmr.relax.devel/5000

The next step would be to figure out to run the code and stay in the interpreter.
Is it necessary to write a new function?

Initial pathc applied.

(file #20034)

Troels E. Linnet <tlinnet>
Project MemberIn charge of this item.
Thu 13 Feb 2014 11:47:57 AM UTC, original submission:

I would be of interest ti have an option: relax -i script.py

It should be the equivalence to the functionality: python -i script.py

At the moment, such a possibility is reached by:
relax
script("script.py")

But here one can only access the relax data containers.
Any defined variables in the script is not reached.

Troels E. Linnet <tlinnet>
Project MemberIn charge of this item.

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #20034:  first.patch added by tlinnet (6kB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by tlinnet (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 14 Feb 2014 11:19:52 AM UTCtlinnetStatusNeed Info=>Done
      Assigned toNone=>tlinnet
      Open/ClosedOpen=>Closed
    Thu 13 Feb 2014 04:48:25 PM UTCtlinnetAttached File-=>Added first.patch, #20034
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup