| | 420 | # |
|---|
| | 421 | def test_append_maskedarray(self): |
|---|
| | 422 | "Test appending to a MaskedTable" |
|---|
| | 423 | table = self.h5file.root.marray |
|---|
| | 424 | data = self.marray |
|---|
| | 425 | newdata = ma.array(zip(np.random.rand(3), np.arange(3)+10), |
|---|
| | 426 | mask=[(0,0),(1,0),(0,1)], |
|---|
| | 427 | dtype=data.dtype) |
|---|
| | 428 | table.append(newdata) |
|---|
| | 429 | test = table.read() |
|---|
| | 430 | assert(isinstance(test, MaskedArray)) |
|---|
| | 431 | assert_equal_records(test, ma.mr_[data,newdata]) |
|---|
| | 432 | # |
|---|
| | 433 | def test_append_timeseries(self): |
|---|
| | 434 | "Test appending to a MaskedTable" |
|---|
| | 435 | table = self.h5file.root.tseries |
|---|
| | 436 | tseries = self.tseries |
|---|
| | 437 | newdata = ts.time_series(zip(np.random.rand(3), np.arange(3)+10), |
|---|
| | 438 | mask=[(0,0),(1,0),(0,1)], |
|---|
| | 439 | dtype=tseries.dtype, |
|---|
| | 440 | start_date=tseries.dates[-1]+1) |
|---|
| | 441 | table.append(newdata) |
|---|
| | 442 | test = table.read() |
|---|
| | 443 | assert(isinstance(test, TimeSeries)) |
|---|
| | 444 | assert_equal_records(test, ts.concatenate((tseries,newdata))) |
|---|
| | 445 | |
|---|