In reference to bug #5977
<http://gna.org/bugs/?func=detailitem&item_id=5977>, see below.
On 5/23/06, Chris MacRaild <NO-REPLY.INVALID-ADDRESS@xxxxxxx> wrote:
...
Details:
There seems to be several problems affecting Monte Carlo sims of diffusion
tensor parameters only. These problems don't seem to affect sims of
residue-specific parameters, or sims of all parameters (diffusion tensor and
residue-specific parameters together).
The first issue surfaces after all the Monte Carlo setup steps, on issuing
minimise():
File "relax_diff_mc.py", line 114, in ?
minimise('newton', run=runName)
File "/home/chris/relax_devel/1.2/prompt/minimisation.py", line 365, in
minimise
File "/home/chris/relax_devel/1.2/generic_fns/minimise.py", line 135, in
minimise
minimise(run=run, min_algor=min_algor, min_options=min_options,
func_tol=func_tol, grad_tol=grad_tol, max_iterations=max_iteratio
ns, constraints=constraints, scaling=scaling,
print_flag=print_flag-1, sim_index=i)
File "/home/chris/relax_devel/1.2/specific_fns/model_free.py", line 2261,
in minimise
r.append(data.r_sim[sim_index])
AttributeError: Element instance has no attribute 'r_sim'
The fix which seems to make most sense to me is in
specific_fns/model_free.py
at line 2257:
change
if sim_index == None:
to
if sim_index == None or self.param_set == 'diff':
That was a tough one to track down. But the fix is exact. As the
bond length and CSA value are never parameters when the parameter set
is 'diff', in this MC case only, the data structures are 'data.r' and
'data.csa' rather than 'data.r_sim' and 'data.csa_sim'. The OR
statement catches it and matches the data structure creation in
self.relax.specific.model_free.sim_init_values().
This prompts the following, again on minimise():
File "/home/chris/relax_devel/1.2_5698_fix/prompt/minimisation.py", line
365, in minimise
File "/home/chris/relax_devel/1.2/generic_fns/minimise.py", line 135, in
minimise
minimise(run=run, min_algor=min_algor, min_options=min_options,
func_tol=func_tol, grad_tol=grad_tol, max_iterations=max_iterations,
constraints=constraints, scaling=scaling, print_flag=print_flag-1,
sim_index=i)
File "/home/chris/relax_devel/1.2/specific_fns/model_free.py", line 2403,
in minimise
self.relax.data.chi2_sim[self.run][sim_index] = self.func
IndexError: list assignment index out of range
At this point self.relax.data.chi2_sim[self.run] is an empty list
This seems to be a simple typo. Again in specific_fns/model_free.py at line
4252 (in sim_init_values()) we have:
# Test if the object has the key self.run.
if not object.has_key(self.relax):
continue
Whoops!
I presume the comment is correct and this should read:
# Test if the object has the key self.run.
if not object.has_key(self.run):
continue
Yep, it was just a typo. Hopefully the future shift of the
'self.relax.data' data structure described at
https://mail.gna.org/public/relax-devel/2006-05/msg00008.html will
eliminate the repetitiveness and hopefully any more of these types of
inconsistencies.
Thanks,
Edward