MCPcopy
hub / github.com/ray-project/ray / test_split_is_not_disruptive

Function test_split_is_not_disruptive

python/ray/data/tests/test_split.py:863–885  ·  view source on GitHub ↗
(ray_start_cluster)

Source from the content-addressed store, hash-verified

861
862
863def test_split_is_not_disruptive(ray_start_cluster):
864 ray.shutdown()
865 ds = ray.data.range(100, override_num_blocks=10).map_batches(lambda x: x)
866
867 def verify_integrity(splits):
868 for dss in splits:
869 for batch in dss.iter_batches():
870 pass
871 for batch in ds.iter_batches():
872 pass
873
874 # No block splitting invovled: split 10 even blocks into 2 groups.
875 verify_integrity(ds.split(2, equal=True))
876 # Block splitting invovled: split 10 even blocks into 3 groups.
877 verify_integrity(ds.split(3, equal=True))
878
879 # Same as above but having tranforms post converting to lazy.
880 verify_integrity(ds.map_batches(lambda x: x).split(2, equal=True))
881 verify_integrity(ds.map_batches(lambda x: x).split(3, equal=True))
882
883 # Same as above but having in-place tranforms post converting to lazy.
884 verify_integrity(ds.randomize_block_order().split(2, equal=True))
885 verify_integrity(ds.randomize_block_order().split(3, equal=True))
886
887
888def test_streaming_train_test_split_hash(ray_start_regular_shared_2_cpus):

Callers

nothing calls this directly

Calls 5

verify_integrityFunction · 0.85
map_batchesMethod · 0.80
randomize_block_orderMethod · 0.80
shutdownMethod · 0.65
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…