Changed refereences to iteritems() to items() for Py3 compat

This commit is contained in:
Mike Croucher 2015-03-02 19:50:41 +00:00
parent 46fc08a448
commit 82722305c3
3 changed files with 15 additions and 6 deletions

View file

@ -342,7 +342,7 @@ class ParamConcatenation(object):
import operator
#py3 fix
#self.parents = map(lambda x: x[0], sorted(parents.iteritems(), key=operator.itemgetter(1)))
self.parents = map(lambda x: x[0], sorted(parents.tems(), key=operator.itemgetter(1)))
self.parents = map(lambda x: x[0], sorted(parents.items(), key=operator.itemgetter(1)))
#===========================================================================
# Get/set items, enable broadcasting
#===========================================================================

View file

@ -710,7 +710,7 @@ class OptimizationHandlable(Indexable):
self._highest_parent_.tie.collate_gradient()
#py3 fix
#[np.put(g, i, c.gradfactor_non_natural(self.param_array[i], g[i])) for c, i in self.constraints.iteritems() if c != __fixed__]
[np.put(g, i, c.gradfactor_non_natural(self.param_array[i], g[i])) for c, i in self.constraints.iteritems() if c != __fixed__]
[np.put(g, i, c.gradfactor_non_natural(self.param_array[i], g[i])) for c, i in self.constraints.items() if c != __fixed__]
if self._has_fixes(): return g[self._fixes_]
return g