Re: RelaxWarning: comparison to `None` will result in an elementwise object comparison in the future

2015-10-20 Thread Edward d'Auvergne
On 16 October 2015 at 17:42, Sze Chan  wrote:
> Hello Edward,
>
> The problem to load into @N* appears when I use my full data, but using a 
> truncated version does not cause a problem.
>
> I attached, the truncated data, full data, and the PDB I've been using (its a 
> truncated version of a PDB from the RCSB) in the bug report.

Cheers!  I've create a system test and now fixed the problem in relax.
See https://gna.org/bugs/?23933#comment3 .  The problem was introduced
in Nov. 2014.  It might take me a while to release a new version of
minfx, bmrblib, and relax to have all these issues resolved.  Anyway,
you can ignore the comparison to 'None' warnings, as these are
harmless for now.  And they are fixed in minfx, bmrblib, and relax and
so will be part of relax 4.0.1.  With the fixes, the relax log will
look like:


"""
relax> pipe.create(pipe_name='mf', pipe_type='mf', bundle=None)

relax> structure.read_pdb(file='LARA_N_term_no_helixFH_reg.pdb',
dir='/data/relax/relax-trunk/test_suite/shared_data/model_free/bug_23933_relax_data_read_ids',
read_mol=None, set_mol_name=None, read_model=None, set_model_num=None,
alt_loc=None, verbosity=1, merge=False)

Internal relax PDB parser.
Opening the file
'/data/relax/relax-trunk/test_suite/shared_data/model_free/bug_23933_relax_data_read_ids/LARA_N_term_no_helixFH_reg.pdb'
for reading.
Adding molecule 'LARA_N_term_no_helixFH_reg_mol24' (from the original
molecule number 24).

relax> structure.load_spins(spin_id='@N', from_mols=None,
mol_name_target=None, ave_pos=True)
Adding the following spins to the relax data store.

# mol_name  res_numres_namespin_num
spin_name
LARA_N_term_no_helixFH_reg_mol24329GLN 1
N
LARA_N_term_no_helixFH_reg_mol24330GLN 10
N
LARA_N_term_no_helixFH_reg_mol24331SER 19
N

relax> structure.load_spins(spin_id='@H', from_mols=None,
mol_name_target=None, ave_pos=True)
Adding the following spins to the relax data store.

# mol_name  res_numres_namespin_num
spin_name
LARA_N_term_no_helixFH_reg_mol24330GLN 0
H
LARA_N_term_no_helixFH_reg_mol24331SER 0
H

relax> structure.load_spins(spin_id='@NE1', from_mols=None,
mol_name_target=None, ave_pos=True)
Adding the following spins to the relax data store.

RelaxWarning: No spins matching the '@NE1' ID string could be found.

relax> structure.load_spins(spin_id='@HE1', from_mols=None,
mol_name_target=None, ave_pos=True)
Adding the following spins to the relax data store.

RelaxWarning: No spins matching the '@HE1' ID string could be found.

relax> relax_data.read(ri_id='R1_600', ri_type='R1', frq=600402816.0,
file='r1_600.txt',
dir='/data/relax/relax-trunk/test_suite/shared_data/model_free/bug_23933_relax_data_read_ids',
spin_id_col=None, mol_name_col=None, res_num_col=1, res_name_col=None,
spin_num_col=None, spin_name_col=None, data_col=2, error_col=3,
sep=None, spin_id=None)
Opening the file
'/data/relax/relax-trunk/test_suite/shared_data/model_free/bug_23933_relax_data_read_ids/r1_600.txt'
for reading.
Traceback (most recent call last):
  File "/data/relax/relax-trunk/test_suite/system_tests/model_free.py",
line 499, in test_bug_23933_relax_data_read_ids
self.interpreter.relax_data.read(ri_id='R1_600', ri_type='R1',
frq=600402816.0, file='r1_600.txt', dir=path, res_num_col=1,
data_col=2, error_col=3)
  File "/data/relax/relax-trunk/prompt/uf_objects.py", line 225, in __call__
self._backend(*new_args, **uf_kargs)
  File "/data/relax/relax-trunk/pipe_control/relax_data.py", line 925, in read
pack_data(ri_id, ri_type, frq, values, errors,
mol_names=mol_names, res_nums=res_nums, res_names=res_names,
spin_nums=spin_nums, spin_names=spin_names, spin_id=spin_id)
  File "/data/relax/relax-trunk/pipe_control/relax_data.py", line 773,
in pack_data
raise RelaxMultiSpinIDError(spin_ids[i], new_ids)
RelaxMultiSpinIDError: RelaxError: The spin ID
'#LARA_N_term_no_helixFH_reg_mol24:331' corresponds to multiple spins,
including '#LARA_N_term_no_helixFH_reg_mol24:331@N' and
'#LARA_N_term_no_helixFH_reg_mol24:331@H'.
"""


The bug that was hidden from you in the GUI will now stop relax and
pop up a RelaxError dialog.  Therefore you don't need the new relax
version or use a checked out copy of the source code repository
(unless you'd like the new code to remove all of the numpy
FutureWarning messages).  You just need to set the spin_id argument to
'@N'.  This allows relax to understand that you have nitrogen and not
proton relaxation data - relax will accept both and it is currently
ambiguous if it is 'N' or 'H' data.  Anyway, thank you for the bug
report and attached files.  This has allowed me to fix both the numpy
FutureWarning and missing 'ids' variable problems.  If you see any
other strange warnings or errors, it would be appreciated if you could
report them so that they can be resolved for future relax 

Re: RelaxWarning: comparison to `None` will result in an elementwise object comparison in the future

2015-10-17 Thread Sze Chan
Hello Edward,

Thank you for the quick reply and great insight. I have uploaded a truncated 
version of the R1 600 MHz data. As I have only residue information in my data 
file, I am trying to load into 15N spins. I appear to only have a problem 
uploading my data if I load into @N* spins, but if I load into @N spins it 
appears fine.

The problem does persist in relax 4.0 for me.

Sam


From: edward.dauver...@gmail.com  on behalf of 
Edward d'Auvergne 
Sent: Friday, October 16, 2015 8:54 AM
To: Sze Chan
Cc: relax-users@gna.org
Subject: Re: RelaxWarning: comparison to `None` will result in an elementwise 
object comparison in the future

On 11 October 2015 at 19:32, Sze Chan  wrote:
> RelaxWarning: comparison to `None` will result in an elementwise object 
> comparison in the future.

Hi Sam,

This warning is due to something called a FutureWarning which was
introduced into numpy >= 1.9.  It looks like the numpy would like to
change how '==' operates on their numpy arrays.  So the previous relax
code was of the form:

if vector == None:

This used to work and was good for checking if we had set a value.
However the numpy people would like us to now instead use:

if vector is None:

I am running the test suite now with Python 3.5 and numpy 1.9.2, using:

$ python3.5 relax -x -d --tee test_suite.log --traceback

That way I can find all such warnings and replace '==' with 'is' and
silence them all.  However as I mentioned in the other email, this is
not the problem you are having with the analysis.  Thanks for pointing
it out though, the fixes I'll make here will allow relax to continue
running with future numpy versions.

Cheers,

Edward

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

This is the relax-users mailing list
relax-users@gna.org

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-users


Re: RelaxWarning: comparison to `None` will result in an elementwise object comparison in the future

2015-10-16 Thread Edward d'Auvergne
On 12 October 2015 at 09:04, Edward d'Auvergne  wrote:
> On 11 October 2015 at 19:32, Sze Chan  wrote:
>> Hello,
>>
>>
>> While I was setting up my modelfree analysis in the GUI automated protocol , 
>> I received the error in the controller:
>>
>>
>> RelaxWarning: comparison to `None` will result in an elementwise object 
>> comparison in the future.
>>
>>
>> After loading my data, setting dipolar interactions, setting CSA relaxations 
>> and setting the isotopes but before execution of the analysis.
>>
>>
>> I'm not sure what happened to cause the warning, but when the modelfree 
>> analysis is running, each successive round of optimization in each model 
>> does not compare to the previous round, instead it would always compare each 
>> optimized chi-square value to 'none' such as in round 21 of the oblate model:
>>
>>
>> Storing the optimisation results for the spin 
>> '#LARA_N_term_no_helixFH_reg_mol24:358@N', the optimised chi-squared value 
>> is lower than the current value (283.50425283 < None).
>>
>>
>> Even though I'm guessing it should refer to a previously optimised value?
>>
>>
>> During the analysis it would go through the default 30 rounds of 
>> optimisation for each global model but not reach convergence.
>>
>>
>> I was wondering how I can remedy this or at least create a log file so I can 
>> make my problem more clear.
>
> Hi Sam,
>
> I would suggest running relax with these options:
>
> $ relax --gui --log relax_warning.log --traceback
>
> This will start the GUI, send all output into a 'relax_warning.log'
> file, and produce highly detailed RelaxError and RelaxWarning messages
> pointing to the exact place in the code where the problem occurred.
> Then exit relax once this warning first occurs (using kill if
> necessary).
>
> Which version of relax are you using by the way?  And which numpy
> version?  The RelaxWarning message you see is either due to Python or
> numpy (specifically using newer versions).  I have seen it many times
> before, and I try to avoid it in the code where possible.  Strangely I
> have never seen this one before.  The relax test suite tests the full
> automated dauvergne_protocol analysis, including multiple rounds of
> optimisation and convergence tests.  And for each relax release I run
> the full test suite on Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2,
> 3.3, and 3.4 (and now 3.5).  Because the test suite has not replicated
> the problem you see, maybe it has something to do with numpy.  Anyway,
> I look forward to seeing the traceback on that RelaxWarning, and maybe
> the output of 'relax -i'.  If you'd like to attach files, then please
> create a bug report and attach the file to the report (
> https://gna.org/bugs/?func=additem=relax ).

Hi Sam,

Thanks for creating the bug report ( https://gna.org/bugs/?23933 ).
From this I can see that the RelaxWarning is not the problem, but
rather this:

"""
relax> relax_data.read(ri_id='R1_600_2', ri_type='R1',
frq=600402816.0, file='C:\\Users\\Sam Chan\\Desktop\\r1_600.txt',
dir=None, spin_id_col=None, mol_name_col=None, res_num_col=1,
res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=2,
error_col=3, sep=None, spin_id='@N*')
Opening the file 'C:\\Users\\Sam Chan\\Desktop\\r1_600.txt' for reading.
Traceback (most recent call last):
  File "C:\relax\gui\wizards\wiz_objects.py", line 166, in _apply
self.exec_status = self.on_execute()
  File "C:\relax\gui\uf_objects.py", line 917, in on_execute
return_status = self.execute(self.name, **kargs)
  File "C:\relax\gui\uf_objects.py", line 839, in execute
return_status = interpreter.apply(uf, *args, **kwds)
  File "C:\relax\gui\interpreter.py", line 109, in apply
fn(*args, **kwds)
  File "C:\relax\pipe_control\relax_data.py", line 920, in read
pack_data(ri_id, ri_type, frq, values, errors,
mol_names=mol_names, res_nums=res_nums, res_names=res_names,
spin_nums=spin_nums, spin_names=spin_names, spin_id=spin_id)
  File "C:\relax\pipe_control\relax_data.py", line 767, in pack_data
if ids:
NameError: global name 'ids' is not defined
"""

Did you see this error in the GUI?  To help debug this, I was
wondering if you could attach a shortened version of the r1_600.txt
file (truncated to 1 or 2 residues, but still enough to trigger the
error).  I could then use this to create a new system or GUI test to
catch the problem.  That will allow me to come up with a fix in
normally a few minutes.  Oh, you may have seen that I just released
relax 4.0.0, the first of the 4 series (
http://wiki.nmr-relax.com/Relax_4.0.0 ).  However this problem you see
will still be present.

Cheers,

Edward

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

This is the relax-users mailing list
relax-users@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at

Re: RelaxWarning: comparison to `None` will result in an elementwise object comparison in the future

2015-10-16 Thread Edward d'Auvergne
On 11 October 2015 at 19:32, Sze Chan  wrote:
> RelaxWarning: comparison to `None` will result in an elementwise object 
> comparison in the future.

Hi Sam,

This warning is due to something called a FutureWarning which was
introduced into numpy >= 1.9.  It looks like the numpy would like to
change how '==' operates on their numpy arrays.  So the previous relax
code was of the form:

if vector == None:

This used to work and was good for checking if we had set a value.
However the numpy people would like us to now instead use:

if vector is None:

I am running the test suite now with Python 3.5 and numpy 1.9.2, using:

$ python3.5 relax -x -d --tee test_suite.log --traceback

That way I can find all such warnings and replace '==' with 'is' and
silence them all.  However as I mentioned in the other email, this is
not the problem you are having with the analysis.  Thanks for pointing
it out though, the fixes I'll make here will allow relax to continue
running with future numpy versions.

Cheers,

Edward

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

This is the relax-users mailing list
relax-users@gna.org

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-users


Re: RelaxWarning: comparison to `None` will result in an elementwise object comparison in the future

2015-10-12 Thread Edward d'Auvergne
On 11 October 2015 at 19:32, Sze Chan  wrote:
> Hello,
>
>
> While I was setting up my modelfree analysis in the GUI automated protocol , 
> I received the error in the controller:
>
>
> RelaxWarning: comparison to `None` will result in an elementwise object 
> comparison in the future.
>
>
> After loading my data, setting dipolar interactions, setting CSA relaxations 
> and setting the isotopes but before execution of the analysis.
>
>
> I'm not sure what happened to cause the warning, but when the modelfree 
> analysis is running, each successive round of optimization in each model does 
> not compare to the previous round, instead it would always compare each 
> optimized chi-square value to 'none' such as in round 21 of the oblate model:
>
>
> Storing the optimisation results for the spin 
> '#LARA_N_term_no_helixFH_reg_mol24:358@N', the optimised chi-squared value is 
> lower than the current value (283.50425283 < None).
>
>
> Even though I'm guessing it should refer to a previously optimised value?
>
>
> During the analysis it would go through the default 30 rounds of optimisation 
> for each global model but not reach convergence.
>
>
> I was wondering how I can remedy this or at least create a log file so I can 
> make my problem more clear.

Hi Sam,

I would suggest running relax with these options:

$ relax --gui --log relax_warning.log --traceback

This will start the GUI, send all output into a 'relax_warning.log'
file, and produce highly detailed RelaxError and RelaxWarning messages
pointing to the exact place in the code where the problem occurred.
Then exit relax once this warning first occurs (using kill if
necessary).

Which version of relax are you using by the way?  And which numpy
version?  The RelaxWarning message you see is either due to Python or
numpy (specifically using newer versions).  I have seen it many times
before, and I try to avoid it in the code where possible.  Strangely I
have never seen this one before.  The relax test suite tests the full
automated dauvergne_protocol analysis, including multiple rounds of
optimisation and convergence tests.  And for each relax release I run
the full test suite on Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2,
3.3, and 3.4 (and now 3.5).  Because the test suite has not replicated
the problem you see, maybe it has something to do with numpy.  Anyway,
I look forward to seeing the traceback on that RelaxWarning, and maybe
the output of 'relax -i'.  If you'd like to attach files, then please
create a bug report and attach the file to the report (
https://gna.org/bugs/?func=additem=relax ).

Cheers,

Edward






>
>
> Sam
> ___
> relax (http://www.nmr-relax.com)
>
> This is the relax-users mailing list
> relax-users@gna.org
>
> 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-users

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

This is the relax-users mailing list
relax-users@gna.org

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-users


RelaxWarning: comparison to `None` will result in an elementwise object comparison in the future

2015-10-11 Thread Sze Chan
Hello,


While I was setting up my modelfree analysis in the GUI automated protocol , I 
received the error in the controller:


RelaxWarning: comparison to `None` will result in an elementwise object 
comparison in the future.


After loading my data, setting dipolar interactions, setting CSA relaxations 
and setting the isotopes but before execution of the analysis.


I'm not sure what happened to cause the warning, but when the modelfree 
analysis is running, each successive round of optimization in each model does 
not compare to the previous round, instead it would always compare each 
optimized chi-square value to 'none' such as in round 21 of the oblate model:


Storing the optimisation results for the spin 
'#LARA_N_term_no_helixFH_reg_mol24:358@N', the optimised chi-squared value is 
lower than the current value (283.50425283 < None).


Even though I'm guessing it should refer to a previously optimised value?


During the analysis it would go through the default 30 rounds of optimisation 
for each global model but not reach convergence.


I was wondering how I can remedy this or at least create a log file so I can 
make my problem more clear.


Sam
___
relax (http://www.nmr-relax.com)

This is the relax-users mailing list
relax-users@gna.org

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-users