ds_.sa.targets = np.hstack(([123], ds_.targets[1:])) ok_(np.any(ds.samples != ds_.samples)) ok_(np.any(ds.targets != ds_.targets)) assert_array_equal(ds.chunks, ds_.chunks) ds_.sa.chunks = np.hstack(([1234], ds_.chunks[1:])) ok_(np.any(ds.samples != ds_.samples)) ok_(np.any(ds.targets != ds_.targets)) ok_(np.any(ds.chunks != ds_.chunks)) # XXX implement me #ok_(np.any(ds.uniquetargets != ds_.uniquetargets)) #ok_(np.any(ds.uniquechunks != ds_.uniquechunks)) @sweepargs(dsp=datasets.items()) def test_ds_array(dsp): # When dataset dsname, ds = dsp if dsname != 'hollow': ok_(np.asarray(ds) is ds.samples, msg="Must have been the same on %s=%s" % dsp) else: ok_(np.asarray(ds) is not ds.samples, msg="Should have not been the same on %s=%s" % dsp) ok_(np.array(ds) is not ds.samples, msg="Copy should have been created on array(), %s=%s" % dsp) def test_mergeds(): data0 = Dataset.from_wizard(np.ones((5, 5)), targets=1)
ds_.sa.targets = np.hstack(([123], ds_.targets[1:])) ok_(np.any(ds.samples != ds_.samples)) ok_(np.any(ds.targets != ds_.targets)) assert_array_equal(ds.chunks, ds_.chunks) ds_.sa.chunks = np.hstack(([1234], ds_.chunks[1:])) ok_(np.any(ds.samples != ds_.samples)) ok_(np.any(ds.targets != ds_.targets)) ok_(np.any(ds.chunks != ds_.chunks)) # XXX implement me #ok_(np.any(ds.uniquetargets != ds_.uniquetargets)) #ok_(np.any(ds.uniquechunks != ds_.uniquechunks)) @sweepargs(dsp=datasets.items()) def test_ds_array(dsp): # When dataset dsname, ds = dsp if dsname != 'hollow': ok_(np.asarray(ds) is ds.samples, msg="Must have been the same on %s=%s" % dsp) else: ok_(np.asarray(ds) is not ds.samples, msg="Should have not been the same on %s=%s" % dsp) ok_(np.array(ds) is not ds.samples, msg="Copy should have been created on array(), %s=%s" % dsp) def test_mergeds(): data0 = Dataset.from_wizard(np.ones((5, 5)), targets=1)
ds_.sa.targets = np.hstack(([123], ds_.targets[1:])) ok_(np.any(ds.samples != ds_.samples)) ok_(np.any(ds.targets != ds_.targets)) assert_array_equal(ds.chunks, ds_.chunks) ds_.sa.chunks = np.hstack(([1234], ds_.chunks[1:])) ok_(np.any(ds.samples != ds_.samples)) ok_(np.any(ds.targets != ds_.targets)) ok_(np.any(ds.chunks != ds_.chunks)) # XXX implement me #ok_(np.any(ds.uniquetargets != ds_.uniquetargets)) #ok_(np.any(ds.uniquechunks != ds_.uniquechunks)) @sweepargs(dsp=list(datasets.items())) def test_ds_array(dsp): # When dataset dsname, ds = dsp if dsname != 'hollow': ok_(np.asarray(ds) is ds.samples, msg="Must have been the same on %s=%s" % dsp) else: ok_(np.asarray(ds) is not ds.samples, msg="Should have not been the same on %s=%s" % dsp) ok_(np.array(ds) is not ds.samples, msg="Copy should have been created on array(), %s=%s" % dsp) def test_mergeds(): data0 = Dataset.from_wizard(np.ones((5, 5)), targets=1)