repo_id
stringclasses
409 values
prefix
large_stringlengths
34
36.3k
target
large_stringlengths
1
498
assertion_type
stringclasses
31 values
difficulty
stringclasses
8 values
test_file
stringlengths
10
121
test_function
stringlengths
1
104
test_class
stringlengths
0
51
lineno
int32
2
11.3k
commit_idx
int32
argoverse/av2-api
import numpy as np from av2.rendering.color import GRAY_BGR from av2.structures.ndgrid import BEVGrid, NDGrid from av2.utils.typing import NDArrayFloat, NDArrayInt def test_BEVGrid_non_integer_multiple() -> None: """Unit test with non-integer-multiple resolution.""" min_range_m = (-5.0, -5.0) max_range_m ...
0
assert
numeric_literal
tests/unit/structures/test_ndgrid.py
test_BEVGrid_non_integer_multiple
92
null
argoverse/av2-api
from typing import Any, Callable import cv2 import numpy as np from cv2.typing import MatLike from av2.rendering.ops.draw import ( alpha_blend_kernel, draw_points_kernel, gaussian_kernel, ) from av2.utils.typing import NDArrayByte, NDArrayInt def _draw_points_cv2( img: MatLike, points_xy: NDArray...
(64, 64, 64)
assert
collection
tests/unit/rendering/ops/test_draw.py
test_alpha_blend_kernel
54
null
argoverse/av2-api
from pathlib import Path from typing import Final, List import numpy as np import pandas as pd import torch from kornia.geometry.conversions import euler_from_quaternion from torch.testing._comparison import assert_close from av2.torch import XYZLWH_QWXYZ_COLUMNS from av2.torch.structures.cuboids import CuboidMode, C...
category_expected
assert
variable
tests/unit/torch/structures/test_cuboids.py
test_build_cuboids
46
null
argoverse/av2-api
import math from pathlib import Path from tempfile import NamedTemporaryFile import numpy as np import pytest import av2.utils.io as io_utils from av2.geometry.sim2 import Sim2 from av2.utils.typing import NDArrayFloat _TEST_DATA_ROOT = Path(__file__).resolve().parent.parent / "test_data" def rotmat2d(theta: float)...
ValueError)
pytest.raises
variable
tests/unit/utils/test_sim2.py
test_transform_from_wrong_dims
272
null
argoverse/av2-api
import logging import sys from pathlib import Path from typing import Final, Tuple import click from rich.progress import track import av2.utils.io as io_utils from av2.datasets.sensor.av2_sensor_dataloader import AV2SensorDataLoader from av2.datasets.sensor.constants import RingCameras from av2.datasets.tbv.splits i...
AV2_CITY_NAMES
assert
variable
tests/integration/verify_tbv_download.py
verify_logs_using_dataloader
235
null
argoverse/av2-api
import tempfile from pathlib import Path from typing import Final from zipfile import ZipFile import numpy as np import pandas as pd import av2.evaluation.scene_flow.eval as eval from av2.evaluation.scene_flow.example_submission import example_submission from av2.evaluation.scene_flow.make_annotation_files import mak...
str(e)
assert
func_call
tests/unit/evaluation/scene_flow/test_sf_submission_pipeline.py
test_submission
133
null
argoverse/av2-api
import math from pathlib import Path from tempfile import NamedTemporaryFile import numpy as np import pytest import av2.utils.io as io_utils from av2.geometry.sim2 import Sim2 from av2.utils.typing import NDArrayFloat _TEST_DATA_ROOT = Path(__file__).resolve().parent.parent / "test_data" def test_inverse() -> None...
wSimg.inverse()
assert
func_call
tests/unit/utils/test_sim2.py
test_inverse
138
null
argoverse/av2-api
from pathlib import Path from tempfile import NamedTemporaryFile import numpy as np import av2.rendering.video as video_utils from av2.utils.typing import NDArrayByte, NDArrayFloat def generate_dummy_rgb_video(N: int, H: int, W: int) -> NDArrayByte: """Generate dummy video data (increasing brightness from top-le...
(55, 500, 500, 3)
assert
collection
tests/unit/rendering/test_video.py
test_crop_video_to_even_dims
84
null
argoverse/av2-api
from pathlib import Path import numpy as np import av2.utils.io as io_utils from av2.utils.io import read_ego_SE3_sensor, read_feather def test_read_feather(test_data_root_dir: Path) -> None: """Read an Apache Feather file.""" feather_path = ( test_data_root_dir / "sensor_dataset_logs" ...
None
assert
none_literal
tests/unit/utils/test_io.py
test_read_feather
24
null
argoverse/av2-api
from pathlib import Path from typing import Tuple import numpy as np import pytest from av2.datasets.sensor.constants import RingCameras from av2.geometry.camera.pinhole_camera import Intrinsics, PinholeCamera from av2.geometry.se3 import SE3 from av2.utils.typing import NDArrayFloat, NDArrayInt _TEST_DATA_ROOT = Pa...
(img_w * img_h, 2)
assert
collection
tests/unit/geometry/test_pinhole_camera.py
test_compute_pixel_ray_directions_vectorized_entireimage
549
null
argoverse/av2-api
import math from pathlib import Path from typing import Final, List import numpy as np import pandas as pd from scipy.spatial.transform import Rotation from av2.evaluation.detection.constants import AffinityType, DistanceType from av2.evaluation.detection.eval import evaluate from av2.evaluation.detection.utils impor...
dts_mask_)
assert_*
variable
tests/unit/evaluation/detection/test_eval.py
test_compute_evaluated_dts_mask
388
null
argoverse/av2-api
from typing import Final, Tuple import numpy as np import av2.utils.dense_grid_interpolation as dense_grid_interpolation from av2.utils.typing import NDArrayByte, NDArrayFloat, NDArrayInt RED_RGB: Final[Tuple[int, int, int]] = (255, 0, 0) GREEN_RGB: Final[Tuple[int, int, int]] = (0, 255, 0) BLUE_RGB: Final[Tuple[int...
np.dtype(np.float64)
assert
func_call
tests/unit/utils/test_dense_grid_interpolation.py
test_interp_dense_grid_from_sparse_float
108
null
argoverse/av2-api
from __future__ import annotations import importlib.util from pathlib import Path from types import ModuleType import pytest def _load_module() -> ModuleType: root = Path(__file__).resolve().parents[2] module_path = root / "scripts" / "validate_tag_version.py" spec = importlib.util.spec_from_file_locatio...
ValueError)
pytest.raises
variable
tests/unit/test_validate_tag_version.py
test_cargo_version_missing_raises
70
null
argoverse/av2-api
from pathlib import Path from typing import Any, Callable, Tuple import numpy as np import pytest from scipy.spatial.transform import Rotation import av2.geometry.geometry as geometry_utils from av2.datasets.sensor.constants import AnnotationCategories from av2.geometry.geometry import mat_to_xyz, xyz_to_mat from av2...
tait_bryan_angles_)
assert_*
variable
tests/unit/geometry/test_geometry.py
test_xyz_to_mat_round_trip
487
null
argoverse/av2-api
from pathlib import Path from typing import Final, List import numpy as np import pandas as pd import torch from kornia.geometry.conversions import euler_from_quaternion from torch.testing._comparison import assert_close from av2.torch import XYZLWH_QWXYZ_COLUMNS from av2.torch.structures.cuboids import CuboidMode, C...
cuboids_xyzlwh_qwxyz[:, :6])
assert_*
complex_expr
tests/unit/torch/structures/test_cuboids.py
test_build_cuboids
33
null
argoverse/av2-api
import tempfile from pathlib import Path import numpy as np import av2.evaluation.scene_flow.constants as constants import av2.evaluation.scene_flow.eval as eval from av2.evaluation.scene_flow.make_annotation_files import write_annotation from av2.evaluation.scene_flow.utils import write_output_file gts = np.array( ...
18
assert
numeric_literal
tests/unit/evaluation/scene_flow/test_sf_eval.py
test_average_metrics
320
null
argoverse/av2-api
import math from pathlib import Path from tempfile import NamedTemporaryFile import numpy as np import pytest import av2.utils.io as io_utils from av2.geometry.sim2 import Sim2 from av2.utils.typing import NDArrayFloat _TEST_DATA_ROOT = Path(__file__).resolve().parent.parent / "test_data" def rotmat2d(theta: float)...
[0, 1, 1, 0]
assert
collection
tests/unit/utils/test_sim2.py
test_save_as_json
304
null
argoverse/av2-api
import logging import sys from pathlib import Path from typing import Final, Tuple import click from rich.progress import track import av2.utils.io as io_utils from av2.datasets.sensor.av2_sensor_dataloader import AV2SensorDataLoader from av2.datasets.sensor.constants import RingCameras from av2.datasets.tbv.splits i...
EXPECTED_NUM_TBV_SWEEPS
assert
variable
tests/integration/verify_tbv_download.py
run_verify_all_tbv_logs
283
null
argoverse/av2-api
from typing import Any, Callable import cv2 import numpy as np from cv2.typing import MatLike from av2.rendering.ops.draw import ( alpha_blend_kernel, draw_points_kernel, gaussian_kernel, ) from av2.utils.typing import NDArrayByte, NDArrayInt def _draw_points_cv2( img: MatLike, points_xy: NDArray...
1.0
assert
numeric_literal
tests/unit/rendering/ops/test_draw.py
test_gaussian_kernel
72
null
argoverse/av2-api
import tempfile from pathlib import Path from typing import Final from zipfile import ZipFile import numpy as np import pandas as pd import av2.evaluation.scene_flow.eval as eval from av2.evaluation.scene_flow.example_submission import example_submission from av2.evaluation.scene_flow.make_annotation_files import mak...
0.06
assert
numeric_literal
tests/unit/evaluation/scene_flow/test_sf_submission_pipeline.py
test_submission
70
null
argoverse/av2-api
from enum import Enum from typing import Any, Callable, List, Tuple import numpy as np import pytest from av2.datasets.sensor.constants import AnnotationCategories from av2.geometry.se3 import SE3 from av2.structures.cuboid import Cuboid, CuboidList from av2.utils.typing import NDArrayBool, NDArrayFloat def _get_dum...
width_m_expected
assert
variable
tests/unit/structures/test_cuboid.py
test_cuboid_constructor
162
null
argoverse/av2-api
from pathlib import Path import numpy as np from av2.datasets.sensor.av2_sensor_dataloader import AV2SensorDataLoader from av2.geometry.se3 import SE3 from av2.utils.typing import NDArrayFloat def test_get_subsampled_ego_trajectory(test_data_root_dir: Path) -> None: """Ensure we can sample the poses at a specifi...
(2637, 2)
assert
collection
tests/unit/datasets/sensor/test_av2_sensor_dataloader.py
test_get_subsampled_ego_trajectory
28
null
argoverse/av2-api
import tempfile from pathlib import Path from typing import Final from zipfile import ZipFile import numpy as np import pandas as pd import av2.evaluation.scene_flow.eval as eval from av2.evaluation.scene_flow.example_submission import example_submission from av2.evaluation.scene_flow.make_annotation_files import mak...
1e-4
assert
numeric_literal
tests/unit/evaluation/scene_flow/test_sf_submission_pipeline.py
test_submission
73
null
argoverse/av2-api
import logging import sys from pathlib import Path from typing import Final, Tuple import click from rich.progress import track import av2.utils.io as io_utils from av2.datasets.sensor.av2_sensor_dataloader import AV2SensorDataLoader from av2.datasets.sensor.constants import RingCameras from av2.datasets.tbv.splits i...
MIN_NUM_IMAGES_PER_CAMERA
assert
variable
tests/integration/verify_tbv_download.py
verify_log_contents
62
null
argoverse/av2-api
import unittest from av2.map.lane_segment import LaneMarkType, LaneSegment, LaneType from av2.map.map_primitives import Point, Polyline class TestLaneSegment(unittest.TestCase): def test_from_dict(self) -> None: """Ensure object is generated correctly from a dictionary.""" json_data = { ...
None
assert
none_literal
tests/unit/map/test_lane_segment.py
test_from_dict
TestLaneSegment
58
null
argoverse/av2-api
from pathlib import Path import numpy as np import pytest from av2.map.drivable_area import DrivableArea from av2.map.lane_segment import LaneSegment from av2.map.map_api import ArgoverseStaticMap from av2.map.map_primitives import Point, Polyline from av2.map.pedestrian_crossing import PedestrianCrossing from av2.ut...
93269421
assert
numeric_literal
tests/unit/map/test_map_api.py
test_get_lane_segment_left_neighbor_id
TestArgoverseStaticMap
176
null
argoverse/av2-api
from pathlib import Path from typing import Any, Callable, Tuple import numpy as np import pytest from scipy.spatial.transform import Rotation import av2.geometry.geometry as geometry_utils from av2.datasets.sensor.constants import AnnotationCategories from av2.geometry.geometry import mat_to_xyz, xyz_to_mat from av2...
mask)
assert_*
variable
tests/unit/geometry/test_geometry.py
test_crop_points
272
null
argoverse/av2-api
from __future__ import annotations import importlib.util from pathlib import Path from types import ModuleType def _load_module() -> ModuleType: root = Path(__file__).resolve().parents[2] module_path = root / "scripts" / "resolve_release_version.py" spec = importlib.util.spec_from_file_location( "...
"1.2.3"
assert
string_literal
tests/unit/test_release_version.py
test_resolve_from_tag_ref
26
null
argoverse/av2-api
import math from pathlib import Path from tempfile import NamedTemporaryFile import numpy as np import pytest import av2.utils.io as io_utils from av2.geometry.sim2 import Sim2 from av2.utils.typing import NDArrayFloat _TEST_DATA_ROOT = Path(__file__).resolve().parent.parent / "test_data" def test_compose_2() -> No...
2.0
assert
numeric_literal
tests/unit/utils/test_sim2.py
test_compose_2
111
null
argoverse/av2-api
from pathlib import Path import numpy as np import pytest from av2.map.drivable_area import DrivableArea from av2.map.lane_segment import LaneSegment from av2.map.map_api import ArgoverseStaticMap from av2.map.map_primitives import Point, Polyline from av2.map.pedestrian_crossing import PedestrianCrossing from av2.ut...
93269526
assert
numeric_literal
tests/unit/map/test_map_api.py
test_get_lane_segment_right_neighbor_id
TestArgoverseStaticMap
193
null
argoverse/av2-api
import logging import sys from pathlib import Path from typing import Final, Tuple import click from rich.progress import track import av2.utils.io as io_utils from av2.datasets.sensor.av2_sensor_dataloader import AV2SensorDataLoader from av2.datasets.sensor.constants import RingCameras from av2.datasets.tbv.splits i...
extrinsics_df["sensor_name"].tolist()
assert
func_call
tests/integration/verify_tbv_download.py
verify_log_contents
123
null
argoverse/av2-api
import tempfile from pathlib import Path from typing import Dict, Final, List from av2.datasets.sensor.av2_sensor_dataloader import AV2SensorDataLoader from av2.datasets.sensor.constants import RingCameras from av2.datasets.sensor.sensor_dataloader import SensorDataloader SENSOR_TIMESTAMPS_MS_DICT: Final[Dict[str, Li...
None
assert
none_literal
tests/unit/datasets/sensor/test_sensor_dataloader.py
test_sensor_data_loader_milliseconds
100
null
argoverse/av2-api
from pathlib import Path from typing import List import numpy as np from av2.datasets.motion_forecasting import scenario_serialization from av2.datasets.motion_forecasting.data_schema import ( ArgoverseScenario, ObjectState, ObjectType, Track, TrackCategory, ) _TEST_OBJECT_STATES: List[ObjectStat...
test_scenario_id
assert
variable
tests/unit/datasets/motion_forecasting/test_scenario_serialization.py
test_load_argoverse_scenario_parquet
91
null
argoverse/av2-api
from typing import Any, Callable import cv2 import numpy as np from cv2.typing import MatLike import av2.utils.raster as raster_utils from av2.utils.typing import NDArrayByte, NDArrayFloat def test_get_mask_from_polygon() -> None: """Ensure that a triangle and skinny-column-like rectangle can be correctly raster...
expected_mask.dtype
assert
complex_expr
tests/unit/utils/test_raster.py
test_get_mask_from_polygon
52
null
argoverse/av2-api
import math from pathlib import Path from tempfile import NamedTemporaryFile import numpy as np import pytest import av2.utils.io as io_utils from av2.geometry.sim2 import Sim2 from av2.utils.typing import NDArrayFloat _TEST_DATA_ROOT = Path(__file__).resolve().parent.parent / "test_data" def rotmat2d(theta: float)...
bSc
assert
variable
tests/unit/utils/test_sim2.py
test_round_trip
316
null
argoverse/av2-api
from pathlib import Path import numpy as np import pytest from av2.map.drivable_area import DrivableArea from av2.map.lane_segment import LaneSegment from av2.map.map_api import ArgoverseStaticMap from av2.map.map_primitives import Point, Polyline from av2.map.pedestrian_crossing import PedestrianCrossing from av2.ut...
None
assert
none_literal
tests/unit/map/test_map_api.py
test_get_lane_segment_left_neighbor_id
TestArgoverseStaticMap
164
null
argoverse/av2-api
import math from pathlib import Path from tempfile import NamedTemporaryFile import numpy as np import pytest import av2.utils.io as io_utils from av2.geometry.sim2 import Sim2 from av2.utils.typing import NDArrayFloat _TEST_DATA_ROOT = Path(__file__).resolve().parent.parent / "test_data" def rotmat2d(theta: float)...
[-5, 5]
assert
collection
tests/unit/utils/test_sim2.py
test_save_as_json
305
null
argoverse/av2-api
import numpy as np import pandas as pd import torch from kornia.geometry.liegroup import Se3, So3 from kornia.geometry.quaternion import Quaternion from torch.testing._comparison import assert_close from av2.torch import QWXYZ_COLUMNS, TRANSLATION_COLUMNS from av2.torch.structures.utils import SE3_from_frame, tensor_f...
tensor_expected)
assert_*
variable
tests/unit/torch/structures/test_utils.py
test_tensor_from_frame
45
null
argoverse/av2-api
from typing import Any, Callable import cv2 import numpy as np from cv2.typing import MatLike from av2.rendering.ops.draw import ( alpha_blend_kernel, draw_points_kernel, gaussian_kernel, ) from av2.utils.typing import NDArrayByte, NDArrayInt def _draw_points_cv2( img: MatLike, points_xy: NDArray...
(128, 128, 128)
assert
collection
tests/unit/rendering/ops/test_draw.py
test_alpha_blend_kernel
62
null
argoverse/av2-api
import unittest from av2.map.lane_segment import LaneMarkType, LaneSegment, LaneType from av2.map.map_primitives import Point, Polyline class TestLaneSegment(unittest.TestCase): def test_from_dict(self) -> None: """Ensure object is generated correctly from a dictionary.""" json_data = { ...
93269421
assert
numeric_literal
tests/unit/map/test_lane_segment.py
test_from_dict
TestLaneSegment
40
null
argoverse/av2-api
from pathlib import Path from typing import Any, Callable, Tuple import numpy as np import pytest from scipy.spatial.transform import Rotation import av2.geometry.geometry as geometry_utils from av2.datasets.sensor.constants import AnnotationCategories from av2.geometry.geometry import mat_to_xyz, xyz_to_mat from av2...
cropped_xyz)
assert_*
variable
tests/unit/geometry/test_geometry.py
test_crop_points
271
null
argoverse/av2-api
import tempfile from pathlib import Path import numpy as np import av2.evaluation.scene_flow.constants as constants import av2.evaluation.scene_flow.eval as eval from av2.evaluation.scene_flow.make_annotation_files import write_annotation from av2.evaluation.scene_flow.utils import write_output_file gts = np.array( ...
3
assert
numeric_literal
tests/unit/evaluation/scene_flow/test_sf_eval.py
test_true_negatives
164
null
argoverse/av2-api
from __future__ import annotations import importlib.util from pathlib import Path from types import ModuleType def _load_module() -> ModuleType: root = Path(__file__).resolve().parents[2] module_path = root / "scripts" / "resolve_release_version.py" spec = importlib.util.spec_from_file_location( "...
"1.2.4"
assert
string_literal
tests/unit/test_release_version.py
test_resolve_from_latest_tag_patch_bump
31
null
argoverse/av2-api
from pathlib import Path from typing import Final, List import numpy as np import pandas as pd import torch from kornia.geometry.conversions import euler_from_quaternion from torch.testing._comparison import assert_close from av2.torch import XYZLWH_QWXYZ_COLUMNS from av2.torch.structures.cuboids import CuboidMode, C...
yaw)
assert_*
variable
tests/unit/torch/structures/test_cuboids.py
test_build_cuboids
37
null
argoverse/av2-api
from typing import List import numpy as np import av2.geometry.mesh_grid as mesh_grid_utils from av2.utils.typing import NDArrayFloat def test_get_mesh_grid_as_point_cloud_single_pt() -> None: """Ensure a sampled regular grid returns only 1 point for a range of 0 meters in x and 0 meters in y.""" min_x = -3 ...
(1, 2)
assert
collection
tests/unit/utils/test_mesh_grid.py
test_get_mesh_grid_as_point_cloud_single_pt
82
null
argoverse/av2-api
from pathlib import Path import numpy as np import pandas as pd import av2.torch.data_loaders.scene_flow from av2.evaluation.scene_flow.utils import compute_eval_point_mask, get_eval_subset from av2.torch.structures.flow import Flow from av2.torch.structures.sweep import Sweep from av2.utils.typing import NDArrayBool...
1
assert
numeric_literal
tests/unit/torch/data_loaders/test_scene_flow_dataloader.py
test_scene_flow_dataloader
48
null
argoverse/av2-api
from contextlib import AbstractContextManager from contextlib import nullcontext as does_not_raise from typing import Final import numpy as np import pytest import av2.datasets.motion_forecasting.eval.metrics as metrics from av2.utils.typing import NDArrayFloat test_N: Final[int] = 10 _STATIONARY_GT_TRAJ = np.zeros(...
expected_ade)
assert_*
variable
tests/unit/datasets/motion_forecasting/eval/test_metrics.py
test_compute_ade
76
null
argoverse/av2-api
from typing import List import numpy as np import av2.geometry.mesh_grid as mesh_grid_utils from av2.utils.typing import NDArrayFloat def test_get_mesh_grid_as_point_cloud_downsample() -> None: """Given 3x3 area, ensure a sampled regular grid returns coordinates at 4 corners only.""" min_x = -3 # integer, m...
(4, 2)
assert
collection
tests/unit/utils/test_mesh_grid.py
test_get_mesh_grid_as_point_cloud_downsample
100
null
argoverse/av2-api
from pathlib import Path import numpy as np import av2.utils.io as io_utils from av2.utils.io import read_ego_SE3_sensor, read_feather def test_read_lidar_sweep() -> None: """Read 3d point coordinates from a LiDAR sweep file from an example log.""" log_id = "adcf7d18-0510-35b0-a2fa-b4cea13a6d76" EXAMPLE_...
np.dtype(np.float64)
assert
func_call
tests/unit/utils/test_io.py
test_read_lidar_sweep
51
null
argoverse/av2-api
import logging import sys from pathlib import Path from typing import Final, Tuple import click from rich.progress import track import av2.utils.io as io_utils from av2.datasets.sensor.av2_sensor_dataloader import AV2SensorDataLoader from av2.datasets.sensor.constants import RingCameras from av2.datasets.tbv.splits i...
MIN_NUM_SWEEPS_PER_LOG
assert
variable
tests/integration/verify_tbv_download.py
verify_log_contents
82
null
argoverse/av2-api
import numpy as np import av2.rendering.color as color_utils from av2.rendering.color import GREEN_HEX, RED_HEX def test_create_colormap() -> None: """Ensure we can create a red-to-green RGB colormap with values in [0,1].""" colors_arr_rgb = color_utils.create_colormap( color_list=[RED_HEX, GREEN_HEX]...
(10, 3)
assert
collection
tests/unit/rendering/test_color.py
test_create_colormap
18
null
argoverse/av2-api
import logging import sys from pathlib import Path from typing import Final, Tuple import click from rich.progress import track import av2.utils.io as io_utils from av2.datasets.sensor.av2_sensor_dataloader import AV2SensorDataLoader from av2.datasets.sensor.constants import RingCameras from av2.datasets.tbv.splits i...
1
assert
numeric_literal
tests/integration/verify_tbv_download.py
verify_log_map
166
null
argoverse/av2-api
import math from pathlib import Path from tempfile import NamedTemporaryFile import numpy as np import pytest import av2.utils.io as io_utils from av2.geometry.sim2 import Sim2 from av2.utils.typing import NDArrayFloat _TEST_DATA_ROOT = Path(__file__).resolve().parent.parent / "test_data" def test_compose_1() -> No...
imgSw.compose(wSimg)
assert
func_call
tests/unit/utils/test_sim2.py
test_compose_1
98
null
argoverse/av2-api
from pathlib import Path from typing import Tuple import numpy as np import pytest from av2.datasets.sensor.constants import RingCameras from av2.geometry.camera.pinhole_camera import Intrinsics, PinholeCamera from av2.geometry.se3 import SE3 from av2.utils.typing import NDArrayFloat, NDArrayInt _TEST_DATA_ROOT = Pa...
ValueError)
pytest.raises
variable
tests/unit/geometry/test_pinhole_camera.py
test_compute_pixel_ray_directions_vectorized_invalid_focal_lengths
468
null
argoverse/av2-api
import math from pathlib import Path from typing import Final, List import numpy as np import pandas as pd from scipy.spatial.transform import Rotation from av2.evaluation.detection.constants import AffinityType, DistanceType from av2.evaluation.detection.eval import evaluate from av2.evaluation.detection.utils impor...
expected_result
assert
variable
tests/unit/evaluation/detection/test_eval.py
test_affinity_center
105
null
argoverse/av2-api
import logging import sys from pathlib import Path from typing import Final, Tuple import click from rich.progress import track import av2.utils.io as io_utils from av2.datasets.sensor.av2_sensor_dataloader import AV2SensorDataLoader from av2.datasets.sensor.constants import RingCameras from av2.datasets.tbv.splits i...
[ "pedestrian_crossings", "lane_segments", "drivable_areas", ]
assert
collection
tests/integration/verify_tbv_download.py
verify_log_map
182
null
argoverse/av2-api
import tempfile from pathlib import Path from typing import Final from zipfile import ZipFile import numpy as np import pandas as pd import av2.evaluation.scene_flow.eval as eval from av2.evaluation.scene_flow.example_submission import example_submission from av2.evaluation.scene_flow.make_annotation_files import mak...
0
assert
numeric_literal
tests/unit/evaluation/scene_flow/test_sf_submission_pipeline.py
test_submission
80
null
argoverse/av2-api
import math from pathlib import Path from typing import Final, List import numpy as np import pandas as pd from scipy.spatial.transform import Rotation from av2.evaluation.detection.constants import AffinityType, DistanceType from av2.evaluation.detection.eval import evaluate from av2.evaluation.detection.utils impor...
expected_result_det
assert
variable
tests/unit/evaluation/detection/test_eval.py
test_translation_error
303
null
argoverse/av2-api
import math from pathlib import Path from tempfile import NamedTemporaryFile import numpy as np import pytest import av2.utils.io as io_utils from av2.geometry.sim2 import Sim2 from av2.utils.typing import NDArrayFloat _TEST_DATA_ROOT = Path(__file__).resolve().parent.parent / "test_data" def rotmat2d(theta: float)...
135
assert
numeric_literal
tests/unit/utils/test_sim2.py
test_sim2_theta_deg_2
252
null
argoverse/av2-api
from pathlib import Path from typing import Any, Callable, Tuple import numpy as np import pytest from scipy.spatial.transform import Rotation import av2.geometry.geometry as geometry_utils from av2.datasets.sensor.constants import AnnotationCategories from av2.geometry.geometry import mat_to_xyz, xyz_to_mat from av2...
rotation_matrix_)
assert_*
variable
tests/unit/geometry/test_geometry.py
test_mat_to_xyz_round_trip
501
null
argoverse/av2-api
import logging import sys from pathlib import Path from typing import Final, Tuple import click from rich.progress import track import av2.utils.io as io_utils from av2.datasets.sensor.av2_sensor_dataloader import AV2SensorDataLoader from av2.datasets.sensor.constants import RingCameras from av2.datasets.tbv.splits i...
(775, 1024, 3)
assert
collection
tests/integration/verify_tbv_download.py
verify_log_contents
77
null
argoverse/av2-api
import unittest from av2.map.lane_segment import LaneMarkType, LaneSegment, LaneType from av2.map.map_primitives import Point, Polyline class TestLaneSegment(unittest.TestCase): def test_from_dict(self) -> None: """Ensure object is generated correctly from a dictionary.""" json_data = { ...
93269520
assert
numeric_literal
tests/unit/map/test_lane_segment.py
test_from_dict
TestLaneSegment
57
null
argoverse/av2-api
from pathlib import Path import numpy as np import pandas as pd import av2.torch.data_loaders.scene_flow from av2.evaluation.scene_flow.utils import compute_eval_point_mask, get_eval_subset from av2.torch.structures.flow import Flow from av2.torch.structures.sweep import Sweep from av2.utils.typing import NDArrayBool...
None
assert
none_literal
tests/unit/torch/data_loaders/test_scene_flow_dataloader.py
test_scene_flow_dataloader
26
null
argoverse/av2-api
from pathlib import Path import numpy as np import pytest from av2.map.drivable_area import DrivableArea from av2.map.lane_segment import LaneSegment from av2.map.map_api import ArgoverseStaticMap from av2.map.map_primitives import Point, Polyline from av2.map.pedestrian_crossing import PedestrianCrossing from av2.ut...
vector_da.xyz[171])
assert_*
complex_expr
tests/unit/map/test_map_api.py
test_get_scenario_vector_drivable_areas
TestArgoverseStaticMap
327
null
argoverse/av2-api
import numpy as np import pandas as pd import torch from kornia.geometry.liegroup import Se3, So3 from kornia.geometry.quaternion import Quaternion from torch.testing._comparison import assert_close from av2.torch import QWXYZ_COLUMNS, TRANSLATION_COLUMNS from av2.torch.structures.utils import SE3_from_frame, tensor_f...
city_SE3_ego_expected.translation)
assert_*
complex_expr
tests/unit/torch/structures/test_utils.py
test_SE3_from_frame
63
null
argoverse/av2-api
from pathlib import Path import numpy as np import pytest from av2.map.drivable_area import DrivableArea from av2.map.lane_segment import LaneSegment from av2.map.map_api import ArgoverseStaticMap from av2.map.map_primitives import Point, Polyline from av2.map.pedestrian_crossing import PedestrianCrossing from av2.ut...
4
assert
numeric_literal
tests/unit/map/test_map_api.py
test_from_array
TestPolyline
87
null
argoverse/av2-api
import tempfile from pathlib import Path from typing import Dict, Final, List from av2.datasets.sensor.av2_sensor_dataloader import AV2SensorDataLoader from av2.datasets.sensor.constants import RingCameras from av2.datasets.sensor.sensor_dataloader import SensorDataloader SENSOR_TIMESTAMPS_MS_DICT: Final[Dict[str, Li...
bf_result
assert
variable
tests/unit/datasets/sensor/test_sensor_dataloader.py
test_sensor_data_loader_milliseconds
155
null
argoverse/av2-api
from __future__ import annotations import importlib.util from pathlib import Path from types import ModuleType import pytest def _load_module() -> ModuleType: root = Path(__file__).resolve().parents[2] module_path = root / "scripts" / "validate_tag_version.py" spec = importlib.util.spec_from_file_locatio...
"9.8.7"
assert
string_literal
tests/unit/test_validate_tag_version.py
test_cargo_version_reads_file
63
null
argoverse/av2-api
from pathlib import Path import numpy as np import pytest from av2.map.drivable_area import DrivableArea from av2.map.lane_segment import LaneSegment from av2.map.map_api import ArgoverseStaticMap from av2.map.map_primitives import Point, Polyline from av2.map.pedestrian_crossing import PedestrianCrossing from av2.ut...
93269520
assert
numeric_literal
tests/unit/map/test_map_api.py
test_get_lane_segment_right_neighbor_id
TestArgoverseStaticMap
187
null
argoverse/av2-api
import tempfile from pathlib import Path import numpy as np import av2.evaluation.scene_flow.constants as constants import av2.evaluation.scene_flow.eval as eval from av2.evaluation.scene_flow.make_annotation_files import write_annotation from av2.evaluation.scene_flow.utils import write_output_file gts = np.array( ...
8
assert
numeric_literal
tests/unit/evaluation/scene_flow/test_sf_eval.py
test_metrics
199
null
argoverse/av2-api
from pathlib import Path import numpy as np import pytest from av2.map.drivable_area import DrivableArea from av2.map.lane_segment import LaneSegment from av2.map.map_api import ArgoverseStaticMap from av2.map.map_primitives import Point, Polyline from av2.map.pedestrian_crossing import PedestrianCrossing from av2.ut...
93269458
assert
numeric_literal
tests/unit/map/test_map_api.py
test_get_lane_segment_right_neighbor_id
TestArgoverseStaticMap
199
null
argoverse/av2-api
import math from pathlib import Path from tempfile import NamedTemporaryFile import numpy as np import pytest import av2.utils.io as io_utils from av2.geometry.sim2 import Sim2 from av2.utils.typing import NDArrayFloat _TEST_DATA_ROOT = Path(__file__).resolve().parent.parent / "test_data" def test_is_eq() -> None: ...
bSa_
assert
variable
tests/unit/utils/test_sim2.py
test_is_eq
35
null
argoverse/av2-api
import math from pathlib import Path from typing import Final, List import numpy as np import pandas as pd from scipy.spatial.transform import Rotation from av2.evaluation.detection.constants import AffinityType, DistanceType from av2.evaluation.detection.eval import evaluate from av2.evaluation.detection.utils impor...
gts_mask_)
assert_*
variable
tests/unit/evaluation/detection/test_eval.py
test_compute_evaluated_gts_mask
470
null
argoverse/av2-api
from pathlib import Path import numpy as np import pytest from av2.map.drivable_area import DrivableArea from av2.map.lane_segment import LaneSegment from av2.map.map_api import ArgoverseStaticMap from av2.map.map_primitives import Point, Polyline from av2.map.pedestrian_crossing import PedestrianCrossing from av2.ut...
mf_scenario_id
assert
variable
tests/unit/map/test_map_api.py
test_load_motion_forecasting_map
430
null
argoverse/av2-api
from pathlib import Path from typing import List import numpy as np from av2.datasets.motion_forecasting import scenario_serialization from av2.datasets.motion_forecasting.data_schema import ( ArgoverseScenario, ObjectState, ObjectType, Track, TrackCategory, ) _TEST_OBJECT_STATES: List[ObjectStat...
_TEST_SCENARIO
assert
variable
tests/unit/datasets/motion_forecasting/test_scenario_serialization.py
test_parquet_scenario_serialization_roundtrip
73
null
argoverse/av2-api
from pathlib import Path import numpy as np import pandas as pd import av2.torch.data_loaders.scene_flow from av2.evaluation.scene_flow.utils import compute_eval_point_mask, get_eval_subset from av2.torch.structures.flow import Flow from av2.torch.structures.sweep import Sweep from av2.utils.typing import NDArrayBool...
0
assert
numeric_literal
tests/unit/torch/data_loaders/test_scene_flow_dataloader.py
test_scene_flow_dataloader
85
null
argoverse/av2-api
from pathlib import Path from typing import Final import numpy as np import pandas as pd import torch from torch.testing._comparison import assert_close from av2.torch import LIDAR_COLUMNS from av2.torch.structures.lidar import Lidar TEST_DATA_DIR: Final = Path(__file__).parent.parent.parent.resolve() / "test_data" ...
lidar_tensor)
assert_*
variable
tests/unit/torch/structures/test_lidar.py
test_build_lidar
30
null
argoverse/av2-api
import logging import sys from pathlib import Path from typing import Final, Tuple import click from rich.progress import track import av2.utils.io as io_utils from av2.datasets.sensor.av2_sensor_dataloader import AV2SensorDataLoader from av2.datasets.sensor.constants import RingCameras from av2.datasets.tbv.splits i...
EXPECTED_NUM_TBV_IMAGES
assert
variable
tests/integration/verify_tbv_download.py
run_verify_all_tbv_logs
279
null
argoverse/av2-api
from pathlib import Path import numpy as np import pytest from av2.map.drivable_area import DrivableArea from av2.map.lane_segment import LaneSegment from av2.map.map_api import ArgoverseStaticMap from av2.map.map_primitives import Point, Polyline from av2.map.pedestrian_crossing import PedestrianCrossing from av2.ut...
(172, 3)
assert
collection
tests/unit/map/test_map_api.py
test_get_scenario_vector_drivable_areas
TestArgoverseStaticMap
324
null
argoverse/av2-api
import tempfile from pathlib import Path import numpy as np import av2.evaluation.scene_flow.constants as constants import av2.evaluation.scene_flow.eval as eval from av2.evaluation.scene_flow.make_annotation_files import write_annotation from av2.evaluation.scene_flow.utils import write_output_file gts = np.array( ...
2
assert
numeric_literal
tests/unit/evaluation/scene_flow/test_sf_eval.py
test_true_positives
156
null
argoverse/av2-api
from pathlib import Path import numpy as np import av2.utils.io as io_utils from av2.utils.io import read_ego_SE3_sensor, read_feather def test_read_lidar_sweep() -> None: """Read 3d point coordinates from a LiDAR sweep file from an example log.""" log_id = "adcf7d18-0510-35b0-a2fa-b4cea13a6d76" EXAMPLE_...
(100660, 3)
assert
collection
tests/unit/utils/test_io.py
test_read_lidar_sweep
50
null
argoverse/av2-api
import logging import sys from pathlib import Path from typing import Final, Tuple import click from rich.progress import track import av2.utils.io as io_utils from av2.datasets.sensor.av2_sensor_dataloader import AV2SensorDataLoader from av2.datasets.sensor.constants import RingCameras from av2.datasets.tbv.splits i...
(2048, 1550, 3)
assert
collection
tests/integration/verify_tbv_download.py
verify_log_contents
75
null
argoverse/av2-api
import tempfile from pathlib import Path import numpy as np import av2.evaluation.scene_flow.constants as constants import av2.evaluation.scene_flow.eval as eval from av2.evaluation.scene_flow.make_annotation_files import write_annotation from av2.evaluation.scene_flow.utils import write_output_file gts = np.array( ...
38
assert
numeric_literal
tests/unit/evaluation/scene_flow/test_sf_eval.py
test_average_metrics
335
null
argoverse/av2-api
from typing import List import numpy as np import av2.geometry.mesh_grid as mesh_grid_utils from av2.utils.typing import NDArrayFloat def test_get_mesh_grid_as_point_cloud_3x2rect() -> None: """Ensure a sampled regular grid returns 6 grid points from 1 meter resolution on 1x2 meter area.""" min_x = -3 # int...
(6, 2)
assert
collection
tests/unit/utils/test_mesh_grid.py
test_get_mesh_grid_as_point_cloud_3x2rect
55
null
argoverse/av2-api
from typing import Any, Callable import cv2 import numpy as np from cv2.typing import MatLike from av2.rendering.ops.draw import ( alpha_blend_kernel, draw_points_kernel, gaussian_kernel, ) from av2.utils.typing import NDArrayByte, NDArrayInt def _draw_points_cv2( img: MatLike, points_xy: NDArray...
(96, 96, 96)
assert
collection
tests/unit/rendering/ops/test_draw.py
test_alpha_blend_kernel
58
null
argoverse/av2-api
from pathlib import Path import numpy as np import pytest from av2.map.drivable_area import DrivableArea from av2.map.lane_segment import LaneSegment from av2.map.map_api import ArgoverseStaticMap from av2.map.map_primitives import Point, Polyline from av2.map.pedestrian_crossing import PedestrianCrossing from av2.ut...
point_cloud.shape[0]
assert
complex_expr
tests/unit/map/test_map_api.py
test_get_ground_height_at_xy
TestArgoverseStaticMap
369
null
argoverse/av2-api
from __future__ import annotations import importlib.util from pathlib import Path from types import ModuleType import pytest def _load_module() -> ModuleType: root = Path(__file__).resolve().parents[2] module_path = root / "scripts" / "validate_tag_version.py" spec = importlib.util.spec_from_file_locatio...
"1.2.3"
assert
string_literal
tests/unit/test_validate_tag_version.py
test_tag_version_from_ref_with_v_prefix
26
null
bitsandbytes-foundation/bitsandbytes
import pytest from bitsandbytes.cextension import HIP_ENVIRONMENT, get_cuda_bnb_library_path from bitsandbytes.cuda_specs import CUDASpecs def cuda120_spec() -> CUDASpecs: return CUDASpecs( cuda_version_string="120", highest_compute_capability=(8, 6), cuda_version_tuple=(12, 0), ) @py...
"libbitsandbytes_cuda110"
assert
string_literal
tests/test_cuda_setup_evaluator.py
test_get_cuda_bnb_library_path_override
25
null
bitsandbytes-foundation/bitsandbytes
import copy import os import pathlib import pickle import platform import subprocess import sys from tempfile import TemporaryDirectory import pytest import torch import bitsandbytes as bnb from bitsandbytes.cextension import ROCM_WARP_SIZE_64 from tests.helpers import ( TRUE_FALSE, describe_dtype, get_av...
0
assert
numeric_literal
tests/test_linear4bit.py
test_params4bit_torch_chunk_split
246
null
bitsandbytes-foundation/bitsandbytes
import pytest import torch import torch.nn as nn from bitsandbytes import functional as F from bitsandbytes.cextension import ROCM_WARP_SIZE_64 from bitsandbytes.nn.parametrize import ( Bnb4bitParametrization, replace_parameter_4bit, replace_parameter_4bit_prequantized, ) from tests.helpers import ( TR...
0.5
assert
numeric_literal
tests/test_parametrize.py
test_moe_realistic_forward
233
null
bitsandbytes-foundation/bitsandbytes
from contextlib import nullcontext import copy import os import pickle import platform import sys from tempfile import TemporaryDirectory import pytest import torch import bitsandbytes as bnb from bitsandbytes.cextension import ROCM_WARP_SIZE_64 from bitsandbytes.nn.modules import Linear8bitLt from tests.helpers impo...
ref_output.dtype
assert
complex_expr
tests/test_linear8bitlt.py
test_linear8bitlt_torch_compile
279
null
bitsandbytes-foundation/bitsandbytes
from contextlib import nullcontext import copy import os import pickle import platform import sys from tempfile import TemporaryDirectory import pytest import torch import bitsandbytes as bnb from bitsandbytes.cextension import ROCM_WARP_SIZE_64 from bitsandbytes.nn.modules import Linear8bitLt from tests.helpers impo...
shallow_copy.bias
assert
complex_expr
tests/test_linear8bitlt.py
test_linear8bit_copy_param
199
null
bitsandbytes-foundation/bitsandbytes
import os from os.path import join import shutil import sys import time import uuid from lion_pytorch import Lion import pytest import torch import bitsandbytes as bnb import bitsandbytes.functional as F from bitsandbytes.utils import sync_gpu from tests.helpers import describe_dtype, get_available_devices, id_format...
p2.float())
assert_*
func_call
tests/test_optim.py
test_optimizer32bit
227
null
bitsandbytes-foundation/bitsandbytes
import pytest from bitsandbytes.cextension import HIP_ENVIRONMENT, get_cuda_bnb_library_path from bitsandbytes.cuda_specs import CUDASpecs def cuda120_spec() -> CUDASpecs: return CUDASpecs( cuda_version_string="120", highest_compute_capability=(8, 6), cuda_version_tuple=(12, 0), ) @py...
"libbitsandbytes_cuda120"
assert
string_literal
tests/test_cuda_setup_evaluator.py
test_get_cuda_bnb_library_path
19
null
bitsandbytes-foundation/bitsandbytes
import math import platform import random import time import einops from packaging import version import pytest import torch import bitsandbytes as bnb from bitsandbytes import functional as F from bitsandbytes.cextension import ROCM_WARP_SIZE_64 from tests.helpers import ( BOOLEAN_TUPLES, TRUE_FALSE, des...
0.11
assert
numeric_literal
tests/test_functional.py
test_4bit_compressed_stats
TestQuantize4BitFunctional
946
null
bitsandbytes-foundation/bitsandbytes
import math import platform import random import time import einops from packaging import version import pytest import torch import bitsandbytes as bnb from bitsandbytes import functional as F from bitsandbytes.cextension import ROCM_WARP_SIZE_64 from tests.helpers import ( BOOLEAN_TUPLES, TRUE_FALSE, des...
A2)
assert_*
variable
tests/test_functional.py
test_coo_double_quant
TestLLMInt8Functional
818
null
bitsandbytes-foundation/bitsandbytes
from math import prod import pytest import torch import bitsandbytes from bitsandbytes.cextension import ROCM_WARP_SIZE_64 from tests.helpers import TRUE_FALSE, get_available_devices, id_formatter, is_supported_on_hpu class TestLLMInt8Ops: @pytest.mark.parametrize("device", get_available_devices()) def test_...
A.device
assert
complex_expr
tests/test_ops.py
test_int8_linear_matmul
TestLLMInt8Ops
27
null
bitsandbytes-foundation/bitsandbytes
from math import prod import pytest import torch import bitsandbytes from bitsandbytes.cextension import ROCM_WARP_SIZE_64 from tests.helpers import TRUE_FALSE, get_available_devices, id_formatter, is_supported_on_hpu class TestLLMInt8Ops: @pytest.mark.parametrize("threshold", [0.0, 6.0]) @pytest.mark.param...
(10, 20)
assert
collection
tests/test_ops.py
test_int8_vectorwise_quant
TestLLMInt8Ops
53
null
bitsandbytes-foundation/bitsandbytes
import os from os.path import join import shutil import sys import time import uuid from lion_pytorch import Lion import pytest import torch import bitsandbytes as bnb import bitsandbytes.functional as F from bitsandbytes.utils import sync_gpu from tests.helpers import describe_dtype, get_available_devices, id_format...
torch.float32
assert
complex_expr
tests/test_optim.py
test_override_config_after_register
341
null
bitsandbytes-foundation/bitsandbytes
import pytest import torch import torch.nn as nn from bitsandbytes import functional as F from bitsandbytes.cextension import ROCM_WARP_SIZE_64 from bitsandbytes.nn.parametrize import ( Bnb4bitParametrization, replace_parameter_4bit, replace_parameter_4bit_prequantized, ) from tests.helpers import ( TR...
"nf4"
assert
string_literal
tests/test_parametrize.py
test_quant_state_preservation
279
null