Skip to content

Instantly share code, notes, and snippets.

@bveeramani
Last active September 20, 2022 00:25
Show Gist options
  • Save bveeramani/dc9dec4e3181bc19de3558a7785fe3c6 to your computer and use it in GitHub Desktop.
Save bveeramani/dc9dec4e3181bc19de3558a7785fe3c6 to your computer and use it in GitHub Desktop.
============================= test session starts ==============================
platform darwin -- Python 3.9.12, pytest-7.1.2, pluggy-1.0.0
rootdir: /Users/bveeramani/GitHub/ray/python
plugins: anyio-3.6.1, lazy-fixture-0.6.3
collected 3 items
python/ray/data/tests/test_dataset_formats.py FFF [100%]
=================================== FAILURES ===================================
____________ TestReadImages.test_data_size_estimate[64-RGB-30000-4] ____________
self = <test_dataset_formats.TestReadImages object at 0x160964bb0>
ray_start_regular_shared = RayContext(dashboard_url='127.0.0.1:8265', python_version='3.9.12', ray_version='3.0.0.dev0', ray_commit='{{RAY_COMMIT...1:61349', 'dashboard_agent_listen_port': 52365, 'node_id': '4a0db1e684641c2e0bfc71842a90ae8cd8d365700cad00a7ee4f0eb8'})
image_size = 64, image_mode = 'RGB', expected_size = 30000, expected_ratio = 4
@pytest.mark.parametrize(
"image_size,image_mode,expected_size,expected_ratio",
[(64, "RGB", 30000, 4), (32, "L", 3500, 0.5), (256, "RGBA", 750000, 85)],
)
def test_data_size_estimate(
self,
ray_start_regular_shared,
image_size,
image_mode,
expected_size,
expected_ratio,
):
root = "example://image-datasets/different-sizes"
ds = ray.data.read_images(
root, size=(image_size, image_size), mode=image_mode, parallelism=3
)
data_size = ds.size_bytes()
assert (
data_size >= expected_size and data_size <= expected_size * 1.5
), f"ds: {ds}, ds.size_bytes(): {ds.size_bytes()}, expected_size: {expected_size}"
data_size = ds.fully_executed().size_bytes()
> assert (
data_size >= expected_size and data_size <= expected_size * 1.5
), "actual data size is out of expected bound"
E AssertionError: actual data size is out of expected bound
E assert (192 >= 30000)
python/ray/data/tests/test_dataset_formats.py:3055: AssertionError
---------------------------- Captured stderr setup -----------------------------
2022-09-19 19:25:35,482 INFO worker.py:1508 -- Started a local Ray instance. View the dashboard at 127.0.0.1:8265 
----------------------------- Captured stderr call -----------------------------
0%| | 0/3 [00:00<?, ?it/s]
Read progress: 0%| | 0/3 [00:00<?, ?it/s]
Read progress: 100%|██████████| 3/3 [00:00<00:00, 1211.64it/s]
____________ TestReadImages.test_data_size_estimate[32-L-3500-0.5] _____________
self = <test_dataset_formats.TestReadImages object at 0x160964c40>
ray_start_regular_shared = RayContext(dashboard_url='127.0.0.1:8265', python_version='3.9.12', ray_version='3.0.0.dev0', ray_commit='{{RAY_COMMIT...1:61349', 'dashboard_agent_listen_port': 52365, 'node_id': '4a0db1e684641c2e0bfc71842a90ae8cd8d365700cad00a7ee4f0eb8'})
image_size = 32, image_mode = 'L', expected_size = 3500, expected_ratio = 0.5
@pytest.mark.parametrize(
"image_size,image_mode,expected_size,expected_ratio",
[(64, "RGB", 30000, 4), (32, "L", 3500, 0.5), (256, "RGBA", 750000, 85)],
)
def test_data_size_estimate(
self,
ray_start_regular_shared,
image_size,
image_mode,
expected_size,
expected_ratio,
):
root = "example://image-datasets/different-sizes"
ds = ray.data.read_images(
root, size=(image_size, image_size), mode=image_mode, parallelism=3
)
data_size = ds.size_bytes()
assert (
data_size >= expected_size and data_size <= expected_size * 1.5
), f"ds: {ds}, ds.size_bytes(): {ds.size_bytes()}, expected_size: {expected_size}"
data_size = ds.fully_executed().size_bytes()
> assert (
data_size >= expected_size and data_size <= expected_size * 1.5
), "actual data size is out of expected bound"
E AssertionError: actual data size is out of expected bound
E assert (192 >= 3500)
python/ray/data/tests/test_dataset_formats.py:3055: AssertionError
----------------------------- Captured stderr call -----------------------------
0%| | 0/3 [00:00<?, ?it/s]
Read progress: 0%| | 0/3 [00:00<?, ?it/s]
Read progress: 100%|██████████| 3/3 [00:00<00:00, 405.80it/s]
__________ TestReadImages.test_data_size_estimate[256-RGBA-750000-85] __________
self = <test_dataset_formats.TestReadImages object at 0x160964cd0>
ray_start_regular_shared = RayContext(dashboard_url='127.0.0.1:8265', python_version='3.9.12', ray_version='3.0.0.dev0', ray_commit='{{RAY_COMMIT...1:61349', 'dashboard_agent_listen_port': 52365, 'node_id': '4a0db1e684641c2e0bfc71842a90ae8cd8d365700cad00a7ee4f0eb8'})
image_size = 256, image_mode = 'RGBA', expected_size = 750000
expected_ratio = 85
@pytest.mark.parametrize(
"image_size,image_mode,expected_size,expected_ratio",
[(64, "RGB", 30000, 4), (32, "L", 3500, 0.5), (256, "RGBA", 750000, 85)],
)
def test_data_size_estimate(
self,
ray_start_regular_shared,
image_size,
image_mode,
expected_size,
expected_ratio,
):
root = "example://image-datasets/different-sizes"
ds = ray.data.read_images(
root, size=(image_size, image_size), mode=image_mode, parallelism=3
)
data_size = ds.size_bytes()
> assert (
data_size >= expected_size and data_size <= expected_size * 1.5
), f"ds: {ds}, ds.size_bytes(): {ds.size_bytes()}, expected_size: {expected_size}"
E AssertionError: ds: Dataset(num_blocks=3, num_rows=3, schema=<class 'numpy.ndarray'>), ds.size_bytes(): 717816, expected_size: 750000
E assert (717816 >= 750000)
python/ray/data/tests/test_dataset_formats.py:3051: AssertionError
=========================== short test summary info ============================
FAILED python/ray/data/tests/test_dataset_formats.py::TestReadImages::test_data_size_estimate[64-RGB-30000-4]
FAILED python/ray/data/tests/test_dataset_formats.py::TestReadImages::test_data_size_estimate[32-L-3500-0.5]
FAILED python/ray/data/tests/test_dataset_formats.py::TestReadImages::test_data_size_estimate[256-RGBA-750000-85]
============================== 3 failed in 7.54s ===============================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment