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


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on February 14, 2014 - 12:26:
Oh, except for the special base 'relax.py' file!

Regards,

Edward

On 14 February 2014 12:23, Edward d'Auvergne <edward@xxxxxxxxxxxxx> wrote:
Hi Troels,

One last point is that you should add your name to the copyright
statements of all the files you have just changed :)

Regards,

Edward



On 14 February 2014 12:19, Troels E. Linnet
<NO-REPLY.INVALID-ADDRESS@xxxxxxx> wrote:
Update of sr #3117 (project relax):

                  Status:               Need Info => Done
             Assigned to:                    None => tlinnet
             Open/Closed:                    Open => Closed

    _______________________________________________________

Follow-up 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>



    _______________________________________________________

Reply to this item at:

  <http://gna.org/support/?3117>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
relax-devel@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel



Related Messages


Powered by MHonArc, Updated Fri Feb 14 14:40:14 2014