Hi,
I am working with Pavel Kaderavek on 'relax_csa' branch. Since I am not
experienced coder I use existing code as an inspiration and sort of
'template code' for our own changes/features. Just now I am trying to
implement functions for manipulating with chemical shift tensor data
(cs_tensor.read/copy/delete/display()) to generic_fns. As a template for
these functions I've taken generic_fns/relaxation_data.py. When I got to
delete() and display() I found this in code:
def delete(ri_label=None, frq_label=None):
"""Function for deleting relaxation data corresponding to ri_label
and frq_label."""
# Arguments.
self.run = run
self.ri_label = ri_label
self.frq_label = frq_label
... and so on
I kinda got suspicious about this part (e.g. why self.something is
defined here and where do I get 'run'). So I tried to use this function
in relax script and I got an error:
relax> relax_data.delete(ri_label='R1', frq_label='600')
Traceback (most recent call last):
File "<console>", line 1, in ?
File "/home/shaman/relax/prompt/relax_data.py", line 195, in delete
relax_data.delete(ri_label=ri_label, frq_label=frq_label)
File "/home/shaman/relax/generic_fns/relax_data.py", line 410, in delete
self.run = run
NameError: global name 'run' is not defined
My theory about this is:
a) I missed something important in my python self.education :-) (I
deserted from biochemistry field so it is very probable)
b) It could be remnant of an old 'run' philosophy and wasn't fixed yet
because it's not being used at all.
c) There is always some other option :-P :-)
Can you please comment on this ? Btw do you think it should be deleted
from every pipe or just from 'cdp' ( = pipes.get_pipe() ).
Thanks very much
Petr Novak