Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ENH larry.morph() now faster.

  • Loading branch information...
commit cd7e39da27e2a36f7a29de3abc3204a97bd6f74a 1 parent 15f0944
@kwgoodman authored
Showing with 5 additions and 3 deletions.
  1. +1 −1  RELEASE.rst
  2. +3 −1 la/deflarry.py
  3. +1 −1  la/tests/deflarry_test.py
View
2  RELEASE.rst
@@ -19,7 +19,7 @@ la 0.7
- la.union(), la.intersection()
- la.align_axis()
- la.farray.correlation(arr1, arr2, axis) for numpy arrays
-- larry.morph_like()
+- larry.morph(), larry.morph_like()
- larry.merge() when update=True
**Breakage from la 0.6**
View
4 la/deflarry.py
@@ -3194,8 +3194,10 @@ def morph(self, label, axis):
miss = missing_marker(x)
x[index] = miss
lab = self.copylabel()
+ if len(set(label)) != len(label):
+ raise IndexError("`label` contains duplicates")
lab[axis] = list(label)
- return larry(x, lab)
+ return larry(x, lab, validate=False)
def morph_like(self, lar):
"""
View
2  la/tests/deflarry_test.py
@@ -3631,7 +3631,7 @@ def test_morph_6(self):
def test_morph_7(self):
lar = larry([1, 2, 3])
- self.failUnlessRaises(ValueError, lar.morph, [0, 0], 0)
+ self.failUnlessRaises(IndexError, lar.morph, [0, 0], 0)
def test_morph_8(self):
"larry.morph_8"
Please sign in to comment.
Something went wrong with that request. Please try again.