Skip to content

Commit

Permalink
Re #10532 Change to unit tests caused by changes in properties
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Dec 7, 2014
1 parent 7228c3b commit 4d20e6a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Code/Mantid/scripts/Inelastic/DirectReductionProperties.py
Expand Up @@ -29,7 +29,7 @@ def __set__(self,instance,value):
if isinstance(value,str):
en_list = str.split(value,',');
if len(en_list)>1:
rez = list;
rez = [];
for en_str in en_list:
val = float(en_str);
rez.append(val)
Expand All @@ -53,15 +53,16 @@ def __set__(self,instance,value):
raise KeyError("Incident energy have to be positive number of list of positive numbers. Got None")

#
if isinstance(instance._incident_energy,list):
for en in self._incident_energy:
inc_en=instance._incident_energy
if isinstance(inc_en,list):
for en in inc_en:
if en<= 0:
raise KeyError("Incident energy have to be positive number of list of positive numbers."+
" For input argument {0} got negative value {1}".format(value,en))
else:
if instance._incident_energy<= 0:
if inc_en<= 0:
raise KeyError("Incident energy have to be positive number of list of positive numbers."+
" For value {0} got negative {1}".format(value,instance._incident_energy))
" For value {0} got negative {1}".format(value,inc_en))
# end IncidentEnergy
class EnergyBins(object):
""" Property provides various energy bin possibilities """
Expand All @@ -72,10 +73,10 @@ def __get__(self,instance,owner=None):
def __set__(self,instance,values):
if values != None:
if isinstance(values,str):
list = str.split(values,',');
nBlocks = len(list);
lst = str.split(values,',');
nBlocks = len(lst);
for i in xrange(0,nBlocks,3):
value = [float(list[i]),float(list[i+1]),float(list[i+2])]
value = [float(lst[i]),float(lst[i+1]),float(lst[i+2])]
else:
value = values;
nBlocks = len(value);
Expand Down

0 comments on commit 4d20e6a

Please sign in to comment.