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