Author: bugman
Date: Tue Nov 11 09:19:53 2014
New Revision: 26502
URL: http://svn.gna.org/viewcvs/relax?rev=26502&view=rev
Log:
Python 3 fixes throughout relax, as identified by the 2to3 script.
The command used was:
2to3 -j 4 -w -f except -f import -f imports -f long -f numliterals -f xrange .
Modified:
trunk/auto_analyses/relax_disp_repeat_cpmg.py
trunk/auto_analyses/relax_fit.py
trunk/lib/structure/internal/object.py
trunk/pipe_control/structure/main.py
trunk/test_suite/shared_data/dispersion/profiling/base.py
trunk/test_suite/shared_data/dispersion/profiling/profiling_matrix_power.py
trunk/test_suite/system_tests/relax_disp.py
trunk/test_suite/system_tests/relax_fit.py
Modified: trunk/auto_analyses/relax_disp_repeat_cpmg.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/auto_analyses/relax_disp_repeat_cpmg.py?rev=26502&r1=26501&r2=26502&view=diff
==============================================================================
--- trunk/auto_analyses/relax_disp_repeat_cpmg.py (original)
+++ trunk/auto_analyses/relax_disp_repeat_cpmg.py Tue Nov 11 09:19:53 2014
@@ -249,7 +249,7 @@
# There should only be one peak file.
for peaks_file in peaks_file_list:
- self.interpreter.spectrum.read_intensities(file=peaks_file,
spectrum_id=spectrum_ids, int_method=self.int_method,
int_col=range(len(spectrum_ids)))
+ self.interpreter.spectrum.read_intensities(file=peaks_file,
spectrum_id=spectrum_ids, int_method=self.int_method,
int_col=list(range(len(spectrum_ids))))
if set_rmsd:
# Get the folder for rmsd files.
@@ -1012,7 +1012,7 @@
"""Method which return a list of tubles, where each tuble is a
spectrum id and a list of spectrum ids which are replicated"""
# Get the dublicates.
- dublicates = map(lambda val: (val, [i for i in xrange(len(cpmg_frqs))
if cpmg_frqs[i] == val]), cpmg_frqs)
+ dublicates = map(lambda val: (val, [i for i in range(len(cpmg_frqs))
if cpmg_frqs[i] == val]), cpmg_frqs)
# Loop over the list of the mapping of cpmg frequency and duplications.
list_dub_mapping = []
Modified: trunk/auto_analyses/relax_fit.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/auto_analyses/relax_fit.py?rev=26502&r1=26501&r2=26502&view=diff
==============================================================================
--- trunk/auto_analyses/relax_fit.py (original)
+++ trunk/auto_analyses/relax_fit.py Tue Nov 11 09:19:53 2014
@@ -213,7 +213,7 @@
all_id.append(s_id)
# Get the dublicates.
- dublicates = map(lambda val: (val, [i for i in
xrange(len(all_times)) if all_times[i] == val]), all_times)
+ dublicates = map(lambda val: (val, [i for i in
range(len(all_times)) if all_times[i] == val]), all_times)
# Loop over the list of the mapping of times and duplications.
list_dub_mapping = []
Modified: trunk/lib/structure/internal/object.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/lib/structure/internal/object.py?rev=26502&r1=26501&r2=26502&view=diff
==============================================================================
--- trunk/lib/structure/internal/object.py (original)
+++ trunk/lib/structure/internal/object.py Tue Nov 11 09:19:53 2014
@@ -2152,7 +2152,7 @@
mean_model.mol[mol_index].z[i] /= num
# Delete all models but the mean.
- for model_index in reversed(range(num)):
+ for model_index in reversed(list(range(num))):
self.delete(model=self.structural_data[model_index].num)
Modified: trunk/pipe_control/structure/main.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/structure/main.py?rev=26502&r1=26501&r2=26502&view=diff
==============================================================================
--- trunk/pipe_control/structure/main.py (original)
+++ trunk/pipe_control/structure/main.py Tue Nov 11 09:19:53 2014
@@ -233,9 +233,9 @@
# The different algorithms.
if method == 'fit to mean':
- T, R, pivot = fit_to_mean(models=range(num), coord=coord,
centre_type=centre_type, elements=elements, centroid=centroid)
+ T, R, pivot = fit_to_mean(models=list(range(num)), coord=coord,
centre_type=centre_type, elements=elements, centroid=centroid)
elif method == 'fit to first':
- T, R, pivot = fit_to_first(models=range(num), coord=coord,
centre_type=centre_type, elements=elements, centroid=centroid)
+ T, R, pivot = fit_to_first(models=list(range(num)), coord=coord,
centre_type=centre_type, elements=elements, centroid=centroid)
# Update to the new coordinates.
i = 0
Modified: trunk/test_suite/shared_data/dispersion/profiling/base.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/dispersion/profiling/base.py?rev=26502&r1=26501&r2=26502&view=diff
==============================================================================
--- trunk/test_suite/shared_data/dispersion/profiling/base.py (original)
+++ trunk/test_suite/shared_data/dispersion/profiling/base.py Tue Nov 11
09:19:53 2014
@@ -230,7 +230,7 @@
if EXP_TYPE_CPMG_SQ in self.exp_type or EXP_TYPE_CPMG_MQ in
self.exp_type:
self.offsets = [0]
else:
- self.offsets = range(10)
+ self.offsets = list(range(10))
# Chemical shift in ppm.
self.chemical_shift = 1.0
Modified:
trunk/test_suite/shared_data/dispersion/profiling/profiling_matrix_power.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/dispersion/profiling/profiling_matrix_power.py?rev=26502&r1=26501&r2=26502&view=diff
==============================================================================
--- trunk/test_suite/shared_data/dispersion/profiling/profiling_matrix_power.py
(original)
+++ trunk/test_suite/shared_data/dispersion/profiling/profiling_matrix_power.py
Tue Nov 11 09:19:53 2014
@@ -458,9 +458,9 @@
power = MC.power
# Loop 100 times for each spin in the clustered analysis (to make the
timing numbers equivalent).
- for spin_index in xrange(100):
+ for spin_index in range(100):
# Repeat the function call, to simulate minimisation.
- for i in xrange(iter):
+ for i in range(iter):
calc = MC.calc_normal(data, power)
@@ -474,9 +474,9 @@
power = MC.power
# Loop 100 times for each spin in the clustered analysis (to make the
timing numbers equivalent).
- for spin_index in xrange(100):
+ for spin_index in range(100):
# Repeat the function call, to simulate minimisation.
- for i in xrange(iter):
+ for i in range(iter):
calc = MC.calc_strided(data, power)
@@ -490,7 +490,7 @@
power = MC.power
# Repeat the function call, to simulate minimisation.
- for i in xrange(iter):
+ for i in range(iter):
calc = MC.calc_normal(data, power)
@@ -504,7 +504,7 @@
power = MC.power
# Repeat the function call, to simulate minimisation.
- for i in xrange(iter):
+ for i in range(iter):
calc = MC.calc_strided(data, power)
Modified: trunk/test_suite/system_tests/relax_disp.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_disp.py?rev=26502&r1=26501&r2=26502&view=diff
==============================================================================
--- trunk/test_suite/system_tests/relax_disp.py (original)
+++ trunk/test_suite/system_tests/relax_disp.py Tue Nov 11 09:19:53 2014
@@ -6453,7 +6453,7 @@
RDR.calc_r2eff(methods=methods, list_glob_ini=[128, 126])
min_methods = [['FT'], ['MDD']]
- min_list_glob_ini = [[128], range(126, 130, 2)[::-1]]
+ min_list_glob_ini = [[128], list(range(126, 130, 2))[::-1]]
#min_methods = [['FT']]
#min_list_glob_ini = [[128]]
@@ -6504,7 +6504,7 @@
# Collect param values.
analysis = 'min_ind'
min_ft_sel = RDR.col_min(method='FT', model=MODEL_CR72,
analysis=analysis, list_glob_ini=[128], selection=selection)
- min_mdd_sel = RDR.col_min(method='MDD', model=MODEL_CR72,
analysis=analysis, list_glob_ini=range(126, 130, 2)[::-1], selection=selection)
+ min_mdd_sel = RDR.col_min(method='MDD', model=MODEL_CR72,
analysis=analysis, list_glob_ini=list(range(126, 130, 2))[::-1],
selection=selection)
fig1 = [[min_ft_sel, min_mdd_sel], ['FT', 'MDD'], [128, 128]]
fig2 = [[min_ft_sel, min_mdd_sel], ['FT', 'MDD'], [128, 126]]
@@ -6542,7 +6542,7 @@
for selection in selections:
analysis = 'min_ind'
min_ft_sel = RDR.col_min(method='FT', model=MODEL_CR72,
analysis=analysis, list_glob_ini=[128], selection=selection)
- min_mdd_sel = RDR.col_min(method='MDD', model=MODEL_CR72,
analysis=analysis, list_glob_ini=range(126, 130, 2)[::-1], selection=selection)
+ min_mdd_sel = RDR.col_min(method='MDD', model=MODEL_CR72,
analysis=analysis, list_glob_ini=list(range(126, 130, 2))[::-1],
selection=selection)
# Get param stats.
min_stat_dic =
RDR.get_min_stat_dic(list_r2eff_dics=[min_ft_sel, min_mdd_sel],
list_glob_ini=[128, 126])
@@ -6572,7 +6572,7 @@
RDR.calc_r2eff(methods=methods, list_glob_ini=[128, 126])
min_methods = [['FT'], ['MDD']]
- min_list_glob_ini = [[128], range(126, 130, 2)[::-1]]
+ min_list_glob_ini = [[128], list(range(126, 130, 2))[::-1]]
#min_methods = [['FT']]
#min_list_glob_ini = [[128]]
@@ -6636,7 +6636,7 @@
# Collect param values.
analysis = 'min'
min_ft_sel = RDR.col_min(method='FT', model=MODEL_CR72,
analysis=analysis, list_glob_ini=[128], selection=selection)
- min_mdd_sel = RDR.col_min(method='MDD', model=MODEL_CR72,
analysis=analysis, list_glob_ini=range(126, 130, 2)[::-1], selection=selection)
+ min_mdd_sel = RDR.col_min(method='MDD', model=MODEL_CR72,
analysis=analysis, list_glob_ini=list(range(126, 130, 2))[::-1],
selection=selection)
fig1 = [[min_ft_sel, min_mdd_sel], ['FT', 'MDD'], [128, 128]]
fig2 = [[min_ft_sel, min_mdd_sel], ['FT', 'MDD'], [128, 126]]
@@ -6673,7 +6673,7 @@
for selection in selections:
analysis = 'min'
min_ft_sel = RDR.col_min(method='FT', model=MODEL_CR72,
analysis=analysis, list_glob_ini=[128], selection=selection)
- min_mdd_sel = RDR.col_min(method='MDD', model=MODEL_CR72,
analysis=analysis, list_glob_ini=range(126, 130, 2)[::-1], selection=selection)
+ min_mdd_sel = RDR.col_min(method='MDD', model=MODEL_CR72,
analysis=analysis, list_glob_ini=list(range(126, 130, 2))[::-1],
selection=selection)
# Get param stats.
min_stat_dic =
RDR.get_min_stat_dic(list_r2eff_dics=[min_ft_sel, min_mdd_sel],
list_glob_ini=[128, 126])
Modified: trunk/test_suite/system_tests/relax_fit.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_fit.py?rev=26502&r1=26501&r2=26502&view=diff
==============================================================================
--- trunk/test_suite/system_tests/relax_fit.py (original)
+++ trunk/test_suite/system_tests/relax_fit.py Tue Nov 11 09:19:53 2014
@@ -304,7 +304,7 @@
all_id.append(s_id)
# Get the dublicates.
- dublicates = map(lambda val: (val, [i for i in
xrange(len(all_times)) if all_times[i] == val]), all_times)
+ dublicates = map(lambda val: (val, [i for i in
range(len(all_times)) if all_times[i] == val]), all_times)
# Loop over the list of the mapping of times and duplications.
list_dub_mapping = []
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
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-commits