function registry with fixed container order
This commit is contained in:
@ -159,7 +159,32 @@ class FunctionRegister:
|
||||
#print "FR: ",self.registry
|
||||
|
||||
def get_registered_functions( self ):
|
||||
return self.registry
|
||||
# returns functions, peaks sorted by tau
|
||||
|
||||
sorted_functions = list()
|
||||
tau_comp = 0
|
||||
for i_fcn, fcn in enumerate(self.registry):
|
||||
if fcn.id_string == "hn":
|
||||
for i, varname in enumerate(fcn.widget.names):
|
||||
if varname == "tau":
|
||||
if fcn._beta[i] <= tau_comp:
|
||||
sorted_functions.append(fcn)
|
||||
else:
|
||||
sorted_functions.insert(0, fcn)
|
||||
tau_comp = fcn._beta[i]
|
||||
# eps_infty to the front
|
||||
elif fcn.id_string == "eps_infty":
|
||||
sorted_functions.insert(0, fcn)
|
||||
# sort the rest lexigraphically
|
||||
elif fcn.id_string == "pwr":
|
||||
sorted_functions.append(fcn)
|
||||
elif fcn.id_string == "cond":
|
||||
sorted_functions.append(fcn)
|
||||
elif fcn.id_string == "yaff":
|
||||
sorted_functions.append(fcn)
|
||||
else:
|
||||
sorted_functions.append(fcn)
|
||||
return sorted_functions
|
||||
|
||||
|
||||
# ############# deprecated #####################
|
||||
|
Reference in New Issue
Block a user