mailRe: [bug #5746] TypeError on dx.map() - Bad call to specific.model_free.model_statistics() ?


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

Header


Content

Posted by Edward d'Auvergne on April 11, 2006 - 09:06:
I've solved the problem to bug #5746 located at
https://gna.org/bugs/?func=detailitem&item_id=5746.  The issue was
simply an incorrect test in the 'self.model_statistics()' function of
the model-free specific code.  The diff of the fix is:

Index: specific_fns/model_free.py
===================================================================
--- specific_fns/model_free.py  (revision 2461)
+++ specific_fns/model_free.py  (working copy)
@@ -2515,7 +2515,7 @@

         # Sequence specific data.
         # Statistics for a single residue.
-        if not global_stats and not combine:
+        if not global_stats or not combine:
             # Skip unselected residues.
             if not self.relax.data.res[self.run][instance].select:
                 return None, None, None


Edward


On 4/11/06, Edward d'Auvergne <edward.dauvergne@xxxxxxxxx> wrote:
I have a feeling this is a failure of the model-free
'self.calculate()' function.  The chi2 value should be a floating
point number, not None.  I have to admit that the 'instance',
'min_instances', and 'num_instances' flags are a bit confusing.

Edward


On 4/10/06, Chris MacRaild <NO-REPLY.INVALID-ADDRESS@xxxxxxx> wrote:

URL:
  <http://gna.org/bugs/?func=detailitem&item_id=5746>

                 Summary: TypeError on dx.map() - Bad call to
specific.model_free.model_statistics() ?
                 Project: relax
            Submitted by: macraild
            Submitted on: Monday 04/10/2006 at 10:44
                Category: None
                Priority: 5 - Normal
                Severity: 4 - Important
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name:
        Originator Email:
             Open/Closed: Open
                 Release: Repository: 1.2 line
        Operating System: None

    _______________________________________________________

Details:

With the attached data and script, the dx.map() call raises a TypeError:

Creating the map.
Opening the file 'dx/map' for writing.
Progress:    0.000%
Traceback (most recent call last):
  File "1.2/relax", line 415, in ?
    Relax()
  File "1.2/relax", line 147, in __init__
    self.interpreter.run()
  File "/home/chris/relax_devel/1.2_5698_fix/prompt/interpreter.py", line
213, in run
  File "/home/chris/relax_devel/1.2_5698_fix/prompt/interpreter.py", line
385, in run_script
  File "/home/chris/relax_devel/1.2_5698_fix/prompt/interpreter.py", line
340, in interact_script
  File "map.py", line 62, in ?
    dx.map(name, params=params, res_num=3, inc=inc, lower=lower, 
upper=upper,
point=point)
  File "/home/chris/relax_devel/1.2_5698_fix/prompt/dx.py", line 279, in 
map
  File "/home/chris/relax_devel/1.2_5698_fix/dx/opendx.py", line 59, in 
map
  File "/home/chris/relax_devel/1.2_5698_fix/dx/base_map.py", line 350, in
map_space
  File "/home/chris/relax_devel/1.2_5698_fix/dx/base_map.py", line 81, in
create_map
  File "/home/chris/relax_devel/1.2/dx/isosurface_3D.py", line 107, in
map_text
    k, n, chi2 = self.model_stats(run=self.run, instance=self.index,
min_instances=1)
  File "/home/chris/relax_devel/1.2/specific_fns/model_free.py", line 
2555,
in model_statistics
    chi2 = chi2 + self.relax.data.res[self.run][i].chi2
TypeError: unsupported operand type(s) for +: 'float' and 'NoneType'


I've tried to trace this one, and I think the problem lies in the call to
specific.model_free.model_statistics(). Removing the min_instances keyword
arg seems to fix in this specific case, but I don't understand the 
intended
purpose of this argument in defining the behaviour of model_statistics().
Perhaps the more general fix lies elsewhere?





    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Monday 04/10/2006 at 10:44  Name: dx.map_script_data.tar.bz2  Size:
8.02KB   By: macraild
Script and data which raise bug
<http://gna.org/bugs/download.php?file_id=793>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?func=detailitem&item_id=5746>

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






Related Messages


Powered by MHonArc, Updated Tue Apr 11 13:40:30 2006