File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ improvements
54
54
- Excluding OLS degenerate unit test case that was causing platform specific
55
55
failure (GH #149)
56
56
- Skip blosc-dependent unit tests for PyTables < 2.2 (PR #137)
57
+ - Calling `copy ` on `DateRange ` did not copy over attributes to the new object
58
+ (GH #168)
57
59
58
60
Thanks
59
61
------
Original file line number Diff line number Diff line change @@ -433,6 +433,14 @@ def drop(self, labels):
433
433
raise ValueError ('labels %s not contained in axis' % labels [- mask ])
434
434
return self .delete (indexer )
435
435
436
+ def copy (self , order = 'C' ):
437
+ """
438
+ Overridden ndarray.copy to copy over attributes
439
+ """
440
+ cp = self .view (np .ndarray ).copy (order ).view (type (self ))
441
+ cp .__dict__ .update (self .__dict__ )
442
+ return cp
443
+
436
444
#----------------------------------------------------------------------
437
445
# deprecated stuff
438
446
Original file line number Diff line number Diff line change @@ -83,6 +83,11 @@ def test_comparison(self):
83
83
self .assert_ (comp [11 ])
84
84
self .assert_ (not comp [9 ])
85
85
86
+ def test_copy (self ):
87
+ cp = self .rng .copy ()
88
+ repr (cp )
89
+ self .assert_ (cp .equals (self .rng ))
90
+
86
91
def test_repr (self ):
87
92
# only really care that it works
88
93
repr (self .rng )
You can’t perform that action at this time.
0 commit comments