(self)
| 250 | assert test_ret_2["max"].ndim == 1 |
| 251 | |
| 252 | def test_sample_operations(self): |
| 253 | op = SampleOperations() |
| 254 | test_data_np = np.random.rand(10, 10).astype(np.float64) |
| 255 | test_data_mt = MetaTensor(test_data_np, device=device) |
| 256 | test_ret_np = op.evaluate(test_data_np) |
| 257 | test_ret_mt = op.evaluate(test_data_mt) |
| 258 | assert isinstance(test_ret_np["max"], Number) |
| 259 | assert isinstance(test_ret_np["percentile"], list) |
| 260 | assert isinstance(test_ret_mt["max"], Number) |
| 261 | assert isinstance(test_ret_mt["percentile"], list) |
| 262 | |
| 263 | op.update({"sum": np.sum}) |
| 264 | test_ret_np = op.evaluate(test_data_np) |
| 265 | assert "sum" in test_ret_np |
| 266 | |
| 267 | def test_summary_operations(self): |
| 268 | op = SummaryOperations() |
nothing calls this directly
no test coverage detected