diff --git a/crates/build/re_types_builder/src/codegen/python/views.rs b/crates/build/re_types_builder/src/codegen/python/views.rs index d0a1d299616a..7916293d21cf 100644 --- a/crates/build/re_types_builder/src/codegen/python/views.rs +++ b/crates/build/re_types_builder/src/codegen/python/views.rs @@ -58,8 +58,8 @@ fn init_method(reporter: &Reporter, objects: &Objects, obj: &Object) -> String { contents: ViewContentsLike = "$origin/**", name: Utf8Like | None = None, visible: datatypes.BoolLike | None = None, - defaults: list[Union[AsComponents, ComponentBatchLike]] = [], - overrides: dict[EntityPathLike, list[ComponentBatchLike]] = {}, + defaults: list[Union[AsComponents, ComponentBatchLike]] | None = None, + overrides: dict[EntityPathLike, list[ComponentBatchLike]] | None = None, "# .to_owned(); diff --git a/docs/snippets/compare_snippet_output.py b/docs/snippets/compare_snippet_output.py index 744a4dd870c7..688f694869bd 100755 --- a/docs/snippets/compare_snippet_output.py +++ b/docs/snippets/compare_snippet_output.py @@ -205,7 +205,7 @@ def run_example(example: Example, language: str, args: argparse.Namespace) -> No rust_output_path = run_prebuilt_rust(example, args.release, args.target, args.target_dir) check_non_empty_rrd(rust_output_path) else: - assert False, f"Unknown language: {language}" + raise AssertionError(f"Unknown language: {language}") def build_rust_snippets(build_env: dict[str, str], release: bool, target: str | None, target_dir: str | None): diff --git a/examples/python/air_traffic_data/air_traffic_data.py b/examples/python/air_traffic_data/air_traffic_data.py index e2064b78cca1..7c58100de13e 100644 --- a/examples/python/air_traffic_data/air_traffic_data.py +++ b/examples/python/air_traffic_data/air_traffic_data.py @@ -93,7 +93,7 @@ def download_eu_map_data() -> None: # cspell:disable-next-line map_data = gpd.read_file(MAP_DATA_DIR / f"NUTS_RG_01M_2021_4326_LEVL_{level}.json").set_crs("epsg:4326").to_crs(crs) - for i, row in map_data[map_data.CNTR_CODE == country_code].iterrows(): + for _i, row in map_data[map_data.CNTR_CODE == country_code].iterrows(): entity_path = f"region_boundaries/{country_code}/{level}/{row.NUTS_ID}" lines = shapely_geom_to_numpy(row.geometry) rr.log(entity_path + "/2D", rr.LineStrips2D(lines, colors=color), static=True) diff --git a/examples/python/all_examples/all_examples/__init__.py b/examples/python/all_examples/all_examples/__init__.py index e782c3996610..3b45e2bd7745 100644 --- a/examples/python/all_examples/all_examples/__init__.py +++ b/examples/python/all_examples/all_examples/__init__.py @@ -1,9 +1,10 @@ from __future__ import annotations import platform +from collections.abc import Iterable from dataclasses import dataclass, field from pathlib import Path -from typing import Any, Iterable, cast +from typing import Any, cast import tomli from pyproject_metadata import StandardMetadata diff --git a/examples/python/all_examples/hatch_build.py b/examples/python/all_examples/hatch_build.py index 28606c013a41..9eab98770304 100644 --- a/examples/python/all_examples/hatch_build.py +++ b/examples/python/all_examples/hatch_build.py @@ -11,7 +11,7 @@ from all_examples import active_examples -class MetadataHook(MetadataHookInterface): # type: ignore[misc] +class MetadataHook(MetadataHookInterface): def update(self, metadata: dict[str, Any]) -> None: """ Use our very own package to list the examples we depend on. diff --git a/examples/python/arkit_scenes/arkit_scenes/__main__.py b/examples/python/arkit_scenes/arkit_scenes/__main__.py index 1fb2fd9fe8f4..c370f9af9a12 100755 --- a/examples/python/arkit_scenes/arkit_scenes/__main__.py +++ b/examples/python/arkit_scenes/arkit_scenes/__main__.py @@ -5,7 +5,7 @@ import json import os from pathlib import Path -from typing import Any, Tuple +from typing import Any import cv2 import numpy as np @@ -26,7 +26,7 @@ [on GitHub](https://github.com/rerun-io/rerun/blob/latest/examples/python/arkit_scenes). """.strip() -Color = Tuple[float, float, float, float] +Color = tuple[float, float, float, float] # hack for now since dataset does not provide orientation information, only known after initial visual inspection ORIENTATION = { diff --git a/examples/python/controlnet/controlnet.py b/examples/python/controlnet/controlnet.py index 79576f618072..e2b0b59806f1 100755 --- a/examples/python/controlnet/controlnet.py +++ b/examples/python/controlnet/controlnet.py @@ -34,8 +34,8 @@ def controlnet_callback( rr.set_index("timestep", timedelta=timestep) latents = callback_kwargs["latents"] - image = pipe.vae.decode(latents / pipe.vae.config.scaling_factor, return_dict=False)[0] # type: ignore[attr-defined] - image = pipe.image_processor.postprocess(image, output_type="np").squeeze() # type: ignore[attr-defined] + image = pipe.vae.decode(latents / pipe.vae.config.scaling_factor, return_dict=False)[0] + image = pipe.image_processor.postprocess(image, output_type="np").squeeze() rr.log("output", rr.Image(image)) rr.log("latent", rr.Tensor(latents.squeeze(), dim_names=["channel", "height", "width"])) diff --git a/examples/python/detect_and_track_objects/detect_and_track_objects.py b/examples/python/detect_and_track_objects/detect_and_track_objects.py index 7ffc015f15f2..c2bc2280e8b2 100755 --- a/examples/python/detect_and_track_objects/detect_and_track_objects.py +++ b/examples/python/detect_and_track_objects/detect_and_track_objects.py @@ -7,9 +7,10 @@ import json import logging import os +from collections.abc import Sequence from dataclasses import dataclass from pathlib import Path -from typing import Any, Final, Sequence +from typing import Any, Final import cv2 import numpy as np @@ -176,7 +177,7 @@ def __init__(self, tracking_id: int, detection: Detection, bgr: cv2.typing.MatLi self.tracked = detection.scaled_to_fit_image(bgr) self.num_recent_undetected_frames = 0 - self.tracker = cv2.legacy.TrackerCSRT_create() # type: ignore[attr-defined] + self.tracker = cv2.legacy.TrackerCSRT_create() bbox_xywh_rounded = [int(val) for val in self.tracked.bbox_xywh] self.tracker.init(bgr, bbox_xywh_rounded) self.log_tracked() @@ -218,7 +219,7 @@ def log_tracked(self) -> None: def update_with_detection(self, detection: Detection, bgr: cv2.typing.MatLike) -> None: self.num_recent_undetected_frames = 0 self.tracked = detection.scaled_to_fit_image(bgr) - self.tracker = cv2.TrackerCSRT_create() # type: ignore[attr-defined] + self.tracker = cv2.TrackerCSRT_create() bbox_xywh_rounded = [int(val) for val in self.tracked.bbox_xywh] self.tracker.init(bgr, bbox_xywh_rounded) self.log_tracked() diff --git a/examples/python/dicom_mri/dicom_mri.py b/examples/python/dicom_mri/dicom_mri.py index afd552fe8ba7..964709a69cc5 100755 --- a/examples/python/dicom_mri/dicom_mri.py +++ b/examples/python/dicom_mri/dicom_mri.py @@ -7,8 +7,9 @@ import io import os import zipfile +from collections.abc import Iterable from pathlib import Path -from typing import Final, Iterable +from typing import Final import dicom_numpy import numpy as np @@ -37,7 +38,7 @@ def extract_voxel_data( dicom_files: Iterable[Path], ) -> tuple[npt.NDArray[np.int16], npt.NDArray[np.float32]]: - slices = [dicom.read_file(f) for f in dicom_files] # type: ignore[misc] + slices = [dicom.read_file(f) for f in dicom_files] try: voxel_ndarray, ijk_to_xyz = dicom_numpy.combine_slices(slices) except dicom_numpy.DicomImportException: diff --git a/examples/python/face_tracking/face_tracking.py b/examples/python/face_tracking/face_tracking.py index ac079c371392..c5113c708256 100755 --- a/examples/python/face_tracking/face_tracking.py +++ b/examples/python/face_tracking/face_tracking.py @@ -8,8 +8,9 @@ import logging import math import os +from collections.abc import Iterable from pathlib import Path -from typing import Final, Iterable +from typing import Final import cv2 import mediapipe as mp diff --git a/examples/python/gesture_detection/gesture_detection.py b/examples/python/gesture_detection/gesture_detection.py index 531c27eacdcf..b7e20e073d06 100755 --- a/examples/python/gesture_detection/gesture_detection.py +++ b/examples/python/gesture_detection/gesture_detection.py @@ -7,8 +7,9 @@ import itertools import logging import os +from collections.abc import Iterable from pathlib import Path -from typing import Final, Iterable +from typing import Final import cv2 import mediapipe as mp @@ -114,7 +115,7 @@ def detect_and_log(self, image: cv2.typing.MatLike, frame_time_nano: int) -> Non for log_key in ["hand2d/points", "hand2d/connections", "hand3d/points"]: rr.log(log_key, rr.Clear(recursive=True)) - for i, gesture in enumerate(recognition_result.gestures): + for gesture in recognition_result.gestures: # Get the top gesture from the recognition result gesture_category = gesture[0].category_name if recognition_result.gestures else "None" self.present_detected_gesture(gesture_category) # Log the detected gesture diff --git a/examples/python/human_pose_tracking/human_pose_tracking.py b/examples/python/human_pose_tracking/human_pose_tracking.py index 8a57b88d14e2..7041b32fc536 100755 --- a/examples/python/human_pose_tracking/human_pose_tracking.py +++ b/examples/python/human_pose_tracking/human_pose_tracking.py @@ -6,10 +6,11 @@ import argparse import logging import os +from collections.abc import Iterator from contextlib import closing from dataclasses import dataclass from pathlib import Path -from typing import Any, Final, Iterator +from typing import Any, Final import cv2 import mediapipe as mp diff --git a/examples/python/live_depth_sensor/live_depth_sensor.py b/examples/python/live_depth_sensor/live_depth_sensor.py index f8b011fc4e4c..a406b6f6a24f 100755 --- a/examples/python/live_depth_sensor/live_depth_sensor.py +++ b/examples/python/live_depth_sensor/live_depth_sensor.py @@ -73,7 +73,7 @@ def run_realsense(num_frames: int | None) -> None: frame_nr += 1 frames = pipe.wait_for_frames() - for f in frames: + for _f in frames: # Log the depth frame depth_frame = frames.get_depth_frame() depth_units = depth_frame.get_units() diff --git a/examples/python/live_scrolling_plot/live_scrolling_plot.py b/examples/python/live_scrolling_plot/live_scrolling_plot.py index 6a0398150edf..eb37848a41b2 100644 --- a/examples/python/live_scrolling_plot/live_scrolling_plot.py +++ b/examples/python/live_scrolling_plot/live_scrolling_plot.py @@ -5,7 +5,7 @@ import argparse import time -from typing import Iterator +from collections.abc import Iterator import numpy as np import rerun as rr # pip install rerun-sdk diff --git a/examples/python/nuscenes_dataset/nuscenes_dataset/export_gps.py b/examples/python/nuscenes_dataset/nuscenes_dataset/export_gps.py index 500a087b52ef..2383beab3206 100644 --- a/examples/python/nuscenes_dataset/nuscenes_dataset/export_gps.py +++ b/examples/python/nuscenes_dataset/nuscenes_dataset/export_gps.py @@ -6,7 +6,7 @@ from __future__ import annotations import math -from typing import Sequence +from collections.abc import Sequence EARTH_RADIUS_METERS = 6.378137e6 REFERENCE_COORDINATES = { diff --git a/examples/python/objectron/objectron/__main__.py b/examples/python/objectron/objectron/__main__.py index bbcff8b60248..06a3a3d953d3 100755 --- a/examples/python/objectron/objectron/__main__.py +++ b/examples/python/objectron/objectron/__main__.py @@ -9,9 +9,9 @@ import os import sys import time +from collections.abc import Iterable, Iterator from dataclasses import dataclass from pathlib import Path -from typing import Iterable, Iterator import numpy as np import rerun as rr # pip install rerun-sdk diff --git a/examples/python/ocr/ocr.py b/examples/python/ocr/ocr.py index 9b3431a97c74..decb0574937c 100755 --- a/examples/python/ocr/ocr.py +++ b/examples/python/ocr/ocr.py @@ -6,9 +6,10 @@ import argparse import logging import os +from collections.abc import Iterable from enum import Enum from pathlib import Path -from typing import Any, Final, Iterable, Optional +from typing import Any, Final, Optional import cv2 as cv2 import numpy as np @@ -373,7 +374,7 @@ def detect_and_log_layouts(file_path: str) -> None: layouts: list[Layout] = [] page_numbers = [i + 1 for i in range(len(images))] processed_layouts: list[LayoutStructure] = [] - for i, (image, page_number) in enumerate(zip(images, page_numbers)): + for image, page_number in zip(images, page_numbers): layouts.append(detect_and_log_layout(image, page_number)) page_path = f"page_{page_number}" diff --git a/examples/python/raw_mesh/raw_mesh/__main__.py b/examples/python/raw_mesh/raw_mesh/__main__.py index aff8969d82ce..a3021c57d602 100755 --- a/examples/python/raw_mesh/raw_mesh/__main__.py +++ b/examples/python/raw_mesh/raw_mesh/__main__.py @@ -88,7 +88,7 @@ def log_scene(scene: trimesh.Scene, node: str, path: str | None = None) -> None: rr.Mesh3D( vertex_positions=mesh.vertices, vertex_colors=vertex_colors, - vertex_normals=mesh.vertex_normals, # type: ignore[arg-type] + vertex_normals=mesh.vertex_normals, vertex_texcoords=vertex_texcoords, albedo_texture=albedo_texture, triangle_indices=mesh.faces, diff --git a/examples/python/rgbd/rgbd.py b/examples/python/rgbd/rgbd.py index 66118c5d02a8..0fe0e985f7d0 100755 --- a/examples/python/rgbd/rgbd.py +++ b/examples/python/rgbd/rgbd.py @@ -141,13 +141,16 @@ def download_progress(url: str, dst: Path) -> None: total = int(resp.headers.get("content-length", 0)) chunk_size = 1024 * 1024 # Can also replace 'file' with a io.BytesIO object - with open(dst, "wb") as file, tqdm( - desc=dst.name, - total=total, - unit="iB", - unit_scale=True, - unit_divisor=1024, - ) as bar: + with ( + open(dst, "wb") as file, + tqdm( + desc=dst.name, + total=total, + unit="iB", + unit_scale=True, + unit_divisor=1024, + ) as bar, + ): for data in resp.iter_content(chunk_size=chunk_size): size = file.write(data) bar.update(size) diff --git a/examples/python/rrt_star/rrt_star.py b/examples/python/rrt_star/rrt_star.py index 5455176a0684..f1402d7b27bf 100755 --- a/examples/python/rrt_star/rrt_star.py +++ b/examples/python/rrt_star/rrt_star.py @@ -15,7 +15,8 @@ from __future__ import annotations import argparse -from typing import Annotated, Generator, Literal +from collections.abc import Generator +from typing import Annotated, Literal import numpy as np import numpy.typing as npt diff --git a/examples/python/segment_anything_model/segment_anything_model.py b/examples/python/segment_anything_model/segment_anything_model.py index 936d6792f87c..86d738229795 100755 --- a/examples/python/segment_anything_model/segment_anything_model.py +++ b/examples/python/segment_anything_model/segment_anything_model.py @@ -102,7 +102,7 @@ def run_segmentation(mask_generator: SamAutomaticMaskGenerator, image: cv2.typin # TODO(jleibs): we could instead draw each mask as a separate image layer, but the current layer-stacking # does not produce great results. masks_with_ids = list(enumerate(masks, start=1)) - masks_with_ids.sort(key=(lambda x: x[1]["area"]), reverse=True) # type: ignore[no-any-return] + masks_with_ids.sort(key=(lambda x: x[1]["area"]), reverse=True) # Layer all of the masks together, using the id as class-id in the segmentation segmentation_img = np.zeros((image.shape[0], image.shape[1])) diff --git a/examples/python/structure_from_motion/structure_from_motion/__main__.py b/examples/python/structure_from_motion/structure_from_motion/__main__.py index 35200bef0106..84a4b8d9a385 100755 --- a/examples/python/structure_from_motion/structure_from_motion/__main__.py +++ b/examples/python/structure_from_motion/structure_from_motion/__main__.py @@ -103,7 +103,7 @@ def read_and_log_sparse_reconstruction(dataset_path: Path, filter_output: bool, rr.log("plot/avg_reproj_err", rr.SeriesLine(color=[240, 45, 58]), static=True) # Iterate through images (video frames) logging data related to each frame. - for image in sorted(images.values(), key=lambda im: im.name): # type: ignore[no-any-return] + for image in sorted(images.values(), key=lambda im: im.name): image_file = dataset_path / "images" / image.name if not os.path.exists(image_file): diff --git a/pixi.lock b/pixi.lock index 7b89d08e7f42..0e4cf731136e 100644 --- a/pixi.lock +++ b/pixi.lock @@ -227,7 +227,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -454,7 +456,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -669,7 +673,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -885,7 +891,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -1075,7 +1083,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -1295,7 +1305,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -1506,7 +1518,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -1704,7 +1718,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -1903,7 +1919,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -2093,7 +2111,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -4829,7 +4849,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/00/c0/8f5d070730d7836adc9c9b6408dec68c6ced86b304a9b26a14df072a6e8c/traitlets-5.14.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/64/16/956b7b9d2ed3a437a1a06792b2ae2e3c49147296ba2f4d59fcee376ded8f/triton-2.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -5140,7 +5162,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/5c/dc/82b5314ffcffa071440108fdccf59159abcd937b8e4d53f3237914089e60/torch-2.3.1-cp311-cp311-manylinux2014_aarch64.whl - pypi: https://files.pythonhosted.org/packages/00/c0/8f5d070730d7836adc9c9b6408dec68c6ced86b304a9b26a14df072a6e8c/traitlets-5.14.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -5425,7 +5449,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/d0/5f/f41b14a398d484bf218d5167ec9061c1e76f500d9e25166117818c8bacda/torch-2.3.1-cp311-none-macosx_11_0_arm64.whl - pypi: https://files.pythonhosted.org/packages/00/c0/8f5d070730d7836adc9c9b6408dec68c6ced86b304a9b26a14df072a6e8c/traitlets-5.14.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -5704,7 +5730,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/d3/1d/a257913c89572de61316461db91867f87519146e58132cdeace3d9ffbe1f/torch-2.3.1-cp311-cp311-win_amd64.whl - pypi: https://files.pythonhosted.org/packages/00/c0/8f5d070730d7836adc9c9b6408dec68c6ced86b304a9b26a14df072a6e8c/traitlets-5.14.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -5952,7 +5980,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/89/d2/4642eb80e3c5a9a00bf8a2ae5cb9390aadfd2a491f161d26a014afa63c4a/sphobjinv-2.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -6189,7 +6219,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/89/d2/4642eb80e3c5a9a00bf8a2ae5cb9390aadfd2a491f161d26a014afa63c4a/sphobjinv-2.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -6413,7 +6445,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/89/d2/4642eb80e3c5a9a00bf8a2ae5cb9390aadfd2a491f161d26a014afa63c4a/sphobjinv-2.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -6638,7 +6672,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/89/d2/4642eb80e3c5a9a00bf8a2ae5cb9390aadfd2a491f161d26a014afa63c4a/sphobjinv-2.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -6854,7 +6890,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/89/d2/4642eb80e3c5a9a00bf8a2ae5cb9390aadfd2a491f161d26a014afa63c4a/sphobjinv-2.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -7375,8 +7413,10 @@ environments: - pypi: https://files.pythonhosted.org/packages/a8/40/c93b1215980d6d31119f742a5702a569b3abce363d68c731d69f312f292c/trimesh-3.15.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/64/16/956b7b9d2ed3a437a1a06792b2ae2e3c49147296ba2f4d59fcee376ded8f/triton-2.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/35/d6/ba5f61958f358028f2e2ba1b8e225b8e263053bd57d3a79e2d2db64c807b/types_python_dateutil-2.9.0.20241003-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/65/f3/107a22063bf27bdccf2024833d3445f4eea42b2e598abfbd46f6a63b6cb0/typing_inspect-0.9.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/a6/ab/7e5f53c3b9d14972843a647d8d7a853969a58aecc7559cb3267302c94774/tzdata-2024.2-py2.py3-none-any.whl @@ -7856,8 +7896,10 @@ environments: - pypi: https://files.pythonhosted.org/packages/f9/9d/030cc1b3e88172967e22ee1d012e0d5e0384eb70d2a098d1669d549aea29/transformers-4.45.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/a8/40/c93b1215980d6d31119f742a5702a569b3abce363d68c731d69f312f292c/trimesh-3.15.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/35/d6/ba5f61958f358028f2e2ba1b8e225b8e263053bd57d3a79e2d2db64c807b/types_python_dateutil-2.9.0.20241003-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/65/f3/107a22063bf27bdccf2024833d3445f4eea42b2e598abfbd46f6a63b6cb0/typing_inspect-0.9.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/a6/ab/7e5f53c3b9d14972843a647d8d7a853969a58aecc7559cb3267302c94774/tzdata-2024.2-py2.py3-none-any.whl @@ -8318,8 +8360,10 @@ environments: - pypi: https://files.pythonhosted.org/packages/f9/9d/030cc1b3e88172967e22ee1d012e0d5e0384eb70d2a098d1669d549aea29/transformers-4.45.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/a8/40/c93b1215980d6d31119f742a5702a569b3abce363d68c731d69f312f292c/trimesh-3.15.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/35/d6/ba5f61958f358028f2e2ba1b8e225b8e263053bd57d3a79e2d2db64c807b/types_python_dateutil-2.9.0.20241003-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/65/f3/107a22063bf27bdccf2024833d3445f4eea42b2e598abfbd46f6a63b6cb0/typing_inspect-0.9.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/a6/ab/7e5f53c3b9d14972843a647d8d7a853969a58aecc7559cb3267302c94774/tzdata-2024.2-py2.py3-none-any.whl @@ -8757,7 +8801,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/00/c0/8f5d070730d7836adc9c9b6408dec68c6ced86b304a9b26a14df072a6e8c/traitlets-5.14.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/64/16/956b7b9d2ed3a437a1a06792b2ae2e3c49147296ba2f4d59fcee376ded8f/triton-2.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -9088,7 +9134,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/5c/dc/82b5314ffcffa071440108fdccf59159abcd937b8e4d53f3237914089e60/torch-2.3.1-cp311-cp311-manylinux2014_aarch64.whl - pypi: https://files.pythonhosted.org/packages/00/c0/8f5d070730d7836adc9c9b6408dec68c6ced86b304a9b26a14df072a6e8c/traitlets-5.14.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -9394,7 +9442,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/d0/5f/f41b14a398d484bf218d5167ec9061c1e76f500d9e25166117818c8bacda/torch-2.3.1-cp311-none-macosx_11_0_arm64.whl - pypi: https://files.pythonhosted.org/packages/00/c0/8f5d070730d7836adc9c9b6408dec68c6ced86b304a9b26a14df072a6e8c/traitlets-5.14.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -9677,7 +9727,9 @@ environments: - pypi: https://files.pythonhosted.org/packages/d3/1d/a257913c89572de61316461db91867f87519146e58132cdeace3d9ffbe1f/torch-2.3.1-cp311-cp311-win_amd64.whl - pypi: https://files.pythonhosted.org/packages/00/c0/8f5d070730d7836adc9c9b6408dec68c6ced86b304a9b26a14df072a6e8c/traitlets-5.14.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/75/a0/dd773135ca0f7227e8257555fd2f7a0c88672bfd111a400361f10c09face/trove_classifiers-2024.10.16-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/43/99/3ec6335ded5b88c2f7ed25c56ffd952546f7ed007ffb1e1539dc3b57015a/userpath-1.9.2-py3-none-any.whl @@ -19050,8 +19102,6 @@ packages: - libxml2 >=2.13.5,<3.0a0 - libzlib >=1.3.1,<2.0a0 - zstd >=1.5.6,<1.6.0a0 - arch: x86_64 - platform: linux license: Apache-2.0 WITH LLVM-exception license_family: Apache purls: [] @@ -19066,8 +19116,6 @@ packages: - libxml2 >=2.12.1,<3.0.0a0 - libzlib >=1.2.13,<2.0.0a0 - zstd >=1.5.5,<1.6.0a0 - arch: x86_64 - platform: linux license: Apache-2.0 WITH LLVM-exception license_family: Apache purls: [] @@ -19080,8 +19128,6 @@ packages: - libcxx >=16 - libxml2 >=2.12.1,<3.0.0a0 - libzlib >=1.2.13,<2.0.0a0 - arch: arm64 - platform: osx license: Apache-2.0 WITH LLVM-exception license_family: Apache purls: [] @@ -19095,8 +19141,6 @@ packages: - libcxx >=18 - libxml2 >=2.13.5,<3.0a0 - libzlib >=1.3.1,<2.0a0 - arch: arm64 - platform: osx license: Apache-2.0 WITH LLVM-exception license_family: Apache purls: [] @@ -19219,8 +19263,6 @@ packages: depends: - __glibc >=2.17,<3.0.a0 - libgcc >=13 - arch: x86_64 - platform: linux license: 0BSD purls: [] size: 111357 @@ -19230,8 +19272,6 @@ packages: md5: e3fd1f8320a100f2b210e690a57cd615 depends: - __osx >=11.0 - arch: arm64 - platform: osx license: 0BSD purls: [] size: 98945 @@ -21113,8 +21153,6 @@ packages: - libiconv >=1.17,<2.0a0 - liblzma >=5.6.3,<6.0a0 - libzlib >=1.3.1,<2.0a0 - arch: x86_64 - platform: linux license: MIT license_family: MIT purls: [] @@ -21171,8 +21209,6 @@ packages: - libiconv >=1.17,<2.0a0 - liblzma >=5.6.3,<6.0a0 - libzlib >=1.3.1,<2.0a0 - arch: arm64 - platform: osx license: MIT license_family: MIT purls: [] @@ -21324,8 +21360,6 @@ packages: - __osx >=11.0 constrains: - openmp 19.1.7|19.1.7.* - arch: arm64 - platform: osx license: Apache-2.0 WITH LLVM-exception license_family: APACHE purls: [] @@ -21378,8 +21412,6 @@ packages: - libzlib >=1.3.1,<2.0a0 - python >=3.11,<3.12.0a0 - python_abi 3.11.* *_cp311 - arch: x86_64 - platform: linux license: BSD-2-Clause license_family: BSD purls: @@ -21397,8 +21429,6 @@ packages: - python >=3.11,<3.12.0a0 - python >=3.11,<3.12.0a0 *_cpython - python_abi 3.11.* *_cp311 - arch: arm64 - platform: osx license: BSD-2-Clause license_family: BSD purls: @@ -21416,8 +21446,6 @@ packages: - vc >=14.2,<15 - vc14_runtime >=14.29.30139 - vs2015_runtime - arch: x86_64 - platform: win license: BSD-2-Clause license_family: BSD purls: @@ -22904,8 +22932,6 @@ packages: - tbb >=2021.6.0 - cuda-python >=11.6 - scipy >=1.0 - arch: x86_64 - platform: linux license: BSD-2-Clause license_family: BSD purls: @@ -22933,8 +22959,6 @@ packages: - tbb >=2021.6.0 - cuda-version >=11.2 - cuda-python >=11.6 - arch: arm64 - platform: osx license: BSD-2-Clause license_family: BSD purls: @@ -22960,8 +22984,6 @@ packages: - cudatoolkit >=11.2 - libopenblas !=0.3.6 - cuda-version >=11.2 - arch: x86_64 - platform: win license: BSD-2-Clause license_family: BSD purls: @@ -22982,8 +23004,6 @@ packages: - python_abi 3.11.* *_cp311 constrains: - numpy-base <0a0 - arch: x86_64 - platform: linux license: BSD-3-Clause license_family: BSD purls: @@ -23063,8 +23083,6 @@ packages: - python_abi 3.11.* *_cp311 constrains: - numpy-base <0a0 - arch: arm64 - platform: osx license: BSD-3-Clause license_family: BSD purls: @@ -23105,8 +23123,6 @@ packages: - vc14_runtime >=14.29.30139 constrains: - numpy-base <0a0 - arch: x86_64 - platform: win license: BSD-3-Clause license_family: BSD purls: @@ -26184,7 +26200,7 @@ packages: - pypi: rerun_py name: rerun-sdk version: 0.23.0a1+dev - sha256: 9c955da2e3a851835dfa11e2e36df2759e9b848cc8d38b0417843af387afda86 + sha256: be8728e046a6ef6fd7acaaa3d022d723bbe3f195ac947b31c70352930dd78a81 requires_dist: - attrs>=23.1.0 - numpy>=1.23 @@ -26193,7 +26209,7 @@ packages: - typing-extensions>=4.5 - pytest==7.1.2 ; extra == 'tests' - rerun-notebook==0.23.0a1+dev ; extra == 'notebook' - requires_python: '>=3.8' + requires_python: '>=3.9' editable: true - pypi: https://files.pythonhosted.org/packages/7b/44/4e421b96b67b2daff264473f7465db72fbdf36a07e05494f50300cc7b0c6/rfc3339_validator-0.1.4-py2.py3-none-any.whl name: rfc3339-validator @@ -26743,8 +26759,6 @@ packages: - python_abi 3.11.* *_cp311 - scipy - threadpoolctl >=3.1.0 - arch: x86_64 - platform: linux license: BSD-3-Clause license_family: BSD purls: @@ -26765,8 +26779,6 @@ packages: - python_abi 3.11.* *_cp311 - scipy - threadpoolctl >=3.1.0 - arch: arm64 - platform: osx license: BSD-3-Clause license_family: BSD purls: @@ -26786,8 +26798,6 @@ packages: - ucrt >=10.0.20348.0 - vc >=14.2,<15 - vc14_runtime >=14.29.30139 - arch: x86_64 - platform: win license: BSD-3-Clause license_family: BSD purls: @@ -26811,8 +26821,6 @@ packages: - numpy >=1.23.5 - python >=3.11,<3.12.0a0 - python_abi 3.11.* *_cp311 - arch: x86_64 - platform: linux license: BSD-3-Clause license_family: BSD purls: @@ -26836,8 +26844,6 @@ packages: - python >=3.11,<3.12.0a0 - python >=3.11,<3.12.0a0 *_cpython - python_abi 3.11.* *_cp311 - arch: arm64 - platform: osx license: BSD-3-Clause license_family: BSD purls: @@ -26859,8 +26865,6 @@ packages: - ucrt >=10.0.20348.0 - vc >=14.2,<15 - vc14_runtime >=14.29.30139 - arch: x86_64 - platform: win license: BSD-3-Clause license_family: BSD purls: @@ -28364,6 +28368,11 @@ packages: name: trove-classifiers version: 2024.10.16 sha256: 9b02a4cb49bd2e85c13e728ee461f4f332d6334736b18d61254c964643687144 +- pypi: https://files.pythonhosted.org/packages/ab/f1/f9321ca2b4c3949b7c45611663bf35e394ac300a0bc5b2995b48e40ff28b/types_decorator-5.2.0.20250224-py3-none-any.whl + name: types-decorator + version: 5.2.0.20250224 + sha256: baa205eddcacd380512d10e70f1bdf9b8effde90367bc137bcba5db08ec240d1 + requires_python: '>=3.9' - pypi: https://files.pythonhosted.org/packages/fc/3a/4950e3701e27f2157814f7ddb41553513ebd9f4864cca78f47e2a68c897c/types_Deprecated-1.2.9.2-py3-none-any.whl name: types-deprecated version: 1.2.9.2 @@ -28373,6 +28382,11 @@ packages: version: 2.9.0.20241003 sha256: 250e1d8e80e7bbc3a6c99b907762711d1a1cdd00e978ad39cb5940f6f0a87f3d requires_python: '>=3.8' +- pypi: https://files.pythonhosted.org/packages/be/50/65ffad73746f1d8b15992c030e0fd22965fd5ae2c0206dc28873343b3230/types_pytz-2025.1.0.20250204-py3-none-any.whl + name: types-pytz + version: 2025.1.0.20250204 + sha256: 32ca4a35430e8b94f6603b35beb7f56c32260ddddd4f4bb305fdf8f92358b87e + requires_python: '>=3.9' - pypi: https://files.pythonhosted.org/packages/d7/01/485b3026ff90e5190b5e24f1711522e06c79f4a56c8f4b95848ac072e20f/types_requests-2.32.0.20241016-py3-none-any.whl name: types-requests version: 2.32.0.20241016 @@ -28500,8 +28514,6 @@ packages: - setuptools - tbb >=2019.0 - tqdm - arch: x86_64 - platform: linux license: BSD-2-Clause license_family: BSD purls: @@ -28523,8 +28535,6 @@ packages: - setuptools - tbb >=2019.0 - tqdm - arch: arm64 - platform: osx license: BSD-2-Clause license_family: BSD purls: @@ -28545,8 +28555,6 @@ packages: - setuptools - tbb >=2019.0 - tqdm - arch: x86_64 - platform: win license: BSD-2-Clause license_family: BSD purls: diff --git a/pixi.toml b/pixi.toml index 54a3a4c9af1e..509e164c0722 100644 --- a/pixi.toml +++ b/pixi.toml @@ -492,6 +492,8 @@ pygithub = "==1.59.0" # Among others for `sync_release_assets.py`. requests = ">=2.31,<3" # For `thumbnails.py` & `upload_image.py` types-Deprecated = "==1.2.9.2" # Type hint stubs types-requests = ">=2.31,<3" # Type hint stubs +types-decorator = "*" # Type hint stubs +types-pytz = "*" # Type hint stubs parso = ">=0.8.4, <0.9" [feature.wheel-build.dependencies] diff --git a/rerun_notebook/src/rerun_notebook/__init__.py b/rerun_notebook/src/rerun_notebook/__init__.py index 9dfe5d724040..0bd07df34e6c 100644 --- a/rerun_notebook/src/rerun_notebook/__init__.py +++ b/rerun_notebook/src/rerun_notebook/__init__.py @@ -5,7 +5,8 @@ import os import pathlib import time -from typing import Any, Literal, Mapping +from collections.abc import Mapping +from typing import Any, Literal import anywidget import jupyter_ui_poll diff --git a/rerun_py/pyproject.toml b/rerun_py/pyproject.toml index 3b0572bf31ac..a0799316afa0 100644 --- a/rerun_py/pyproject.toml +++ b/rerun_py/pyproject.toml @@ -22,7 +22,7 @@ dependencies = [ description = "The Rerun Logging SDK" keywords = ["computer-vision", "logging", "rerun"] name = "rerun-sdk" -requires-python = ">=3.8" +requires-python = ">=3.9" dynamic = ["version"] [[project.authors]] @@ -109,12 +109,11 @@ lint.ignore = [ # allow relative imports "TID252", - - "UP007", # We need this, or `ruff format` will convert `Union[X, Y]` to `X | Y` which break on Python 3.8 ] line-length = 120 lint.select = [ + "B", # flake8-bugbear lints "D", # pydocstyle codes https://www.pydocstyle.org/en/latest/error_codes.html "E", # pycodestyle error codes: https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes "F", # Flake8 error codes https://flake8.pycqa.org/en/latest/user/error-codes.html diff --git a/rerun_py/rerun_bindings/rerun_bindings.pyi b/rerun_py/rerun_bindings/rerun_bindings.pyi index 4033e6aa99aa..6cbd78f1738a 100644 --- a/rerun_py/rerun_bindings/rerun_bindings.pyi +++ b/rerun_py/rerun_bindings/rerun_bindings.pyi @@ -1,6 +1,7 @@ import os +from collections.abc import Iterator, Sequence from enum import Enum -from typing import Iterator, Optional, Sequence, Union +from typing import Optional import pyarrow as pa @@ -161,7 +162,7 @@ class Schema: [`RecordingView.schema()`][rerun.dataframe.RecordingView.schema]. """ - def __iter__(self) -> Iterator[Union[IndexColumnDescriptor, ComponentColumnDescriptor]]: + def __iter__(self) -> Iterator[IndexColumnDescriptor | ComponentColumnDescriptor]: """Iterate over all the column descriptors in the schema.""" ... diff --git a/rerun_py/rerun_bindings/types.py b/rerun_py/rerun_bindings/types.py index 8b55ad3ca63a..ebf7d061156d 100644 --- a/rerun_py/rerun_bindings/types.py +++ b/rerun_py/rerun_bindings/types.py @@ -1,6 +1,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Dict, Literal, Sequence, Type, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Literal, Union import numpy as np import numpy.typing as npt @@ -35,7 +36,7 @@ ] """A type alias for any component-column-like object.""" -ComponentLike: TypeAlias = Union[str, Type["ComponentMixin"]] +ComponentLike: TypeAlias = Union[str, type["ComponentMixin"]] """ A type alias for a component-like object used for content-expressions and column selectors. @@ -52,7 +53,7 @@ ViewContentsLike: TypeAlias = Union[ str, - Dict[str, Union[AnyColumn, Sequence[ComponentLike]]], + dict[str, Union[AnyColumn, Sequence[ComponentLike]]], ] """ A type alias for specifying the contents of a view. diff --git a/rerun_py/rerun_sdk/rerun/__init__.py b/rerun_py/rerun_sdk/rerun/__init__.py index 2005a2468733..a43d1ebede1d 100644 --- a/rerun_py/rerun_sdk/rerun/__init__.py +++ b/rerun_py/rerun_sdk/rerun/__init__.py @@ -3,7 +3,6 @@ import functools import random import sys -import warnings from typing import Any, Callable, TypeVar, cast from uuid import UUID @@ -12,18 +11,17 @@ __version__ = "0.23.0-alpha.1+dev" __version_info__ = (0, 23, 0, "alpha.1") -if sys.version_info < (3, 9): - warnings.warn( - "Python 3.8 is past EOL (https://devguide.python.org/versions/). Rerun version 0.21 will drop support/testing of Python 3.8.", - DeprecationWarning, - ) + +if sys.version_info < (3, 9): # noqa: UP036 + raise RuntimeError("Rerun SDK requires Python 3.9 or later.") + # ===================================== # API RE-EXPORTS # Important: always us the `import _ as _` format to make it explicit to type-checkers that these are public APIs. # Background: https://github.com/microsoft/pyright/blob/1.1.365/docs/typed-libraries.md#library-interface # -import rerun_bindings as bindings # type: ignore[attr-defined] +import rerun_bindings as bindings from . import ( blueprint as blueprint, @@ -204,51 +202,12 @@ """ -def _init_recording_stream() -> None: - # Inject all relevant methods into the `RecordingStream` class. - # We need to do this from here to avoid circular import issues. - - import sys - from inspect import getmembers, isfunction - - from rerun.recording_stream import _patch as recording_stream_patch - - recording_stream_patch( - [ - binary_stream, - connect, - connect_grpc, - save, - stdout, - disconnect, - memory_recording, - serve, - spawn, - send_blueprint, - notebook_show, - ] - + [ - set_index, - set_time_sequence, - set_time_seconds, - set_time_nanos, - disable_timeline, - reset_time, - log, - ] - + [fn for name, fn in getmembers(sys.modules[__name__], isfunction) if name.startswith("log_")] - ) - - -_init_recording_stream() - - # TODO(#3793): defaulting recording_id to authkey should be opt-in def init( application_id: str, *, recording_id: str | UUID | None = None, - spawn: bool = False, + spawn: bool = False, # noqa: F811 init_logging: bool = True, default_enabled: bool = True, strict: bool | None = None, @@ -398,7 +357,7 @@ def _register_on_fork() -> None: try: import os - os.register_at_fork(after_in_child=cleanup_if_forked_child) # type: ignore[attr-defined] + os.register_at_fork(after_in_child=cleanup_if_forked_child) except AttributeError: # not defined on all OSes pass diff --git a/rerun_py/rerun_sdk/rerun/_baseclasses.py b/rerun_py/rerun_sdk/rerun/_baseclasses.py index 7706888b4853..5bbb0660ff50 100644 --- a/rerun_py/rerun_sdk/rerun/_baseclasses.py +++ b/rerun_py/rerun_sdk/rerun/_baseclasses.py @@ -1,6 +1,7 @@ from __future__ import annotations -from typing import Generic, Iterable, Iterator, Protocol, TypeVar +from collections.abc import Iterable, Iterator +from typing import Generic, Protocol, TypeVar, runtime_checkable import numpy as np import numpy.typing as npt @@ -165,6 +166,7 @@ def partition(self, lengths: npt.ArrayLike | None = None) -> ComponentColumn: return ComponentColumn(self, lengths=lengths) +@runtime_checkable class ComponentBatchLike(Protocol): """Describes interface for objects that can be converted to batch of rerun Components.""" @@ -177,6 +179,7 @@ def as_arrow_array(self) -> pa.Array: ... +@runtime_checkable class AsComponents(Protocol): """Describes interface for interpreting an object as a bundle of Components.""" @@ -586,7 +589,7 @@ def arrow_type(cls) -> pa.DataType: Part of the `ComponentBatchLike` logging interface. """ - return cls._BATCH_TYPE._ARROW_DATATYPE # type: ignore[attr-defined, no-any-return] + return cls._BATCH_TYPE._ARROW_DATATYPE # type: ignore[attr-defined] def component_descriptor(self) -> ComponentDescriptor: """ @@ -602,7 +605,7 @@ def as_arrow_array(self) -> pa.Array: Part of the `ComponentBatchLike` logging interface. """ - return self._BATCH_TYPE([self]).as_arrow_array() # type: ignore[attr-defined, no-any-return] + return self._BATCH_TYPE([self]).as_arrow_array() # type: ignore[attr-defined] @catch_and_log_exceptions(context="creating empty array") diff --git a/rerun_py/rerun_sdk/rerun/_converters.py b/rerun_py/rerun_sdk/rerun/_converters.py index 7917a22e3e83..0fa9a913a1a4 100644 --- a/rerun_py/rerun_sdk/rerun/_converters.py +++ b/rerun_py/rerun_sdk/rerun/_converters.py @@ -22,7 +22,8 @@ class ClassA: from __future__ import annotations -from typing import Sequence, SupportsFloat, SupportsInt, cast, overload +from collections.abc import Sequence +from typing import SupportsFloat, SupportsInt, cast, overload import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/_image_encoded.py b/rerun_py/rerun_sdk/rerun/_image_encoded.py index 433f4b496ca8..b912dfcdeb97 100644 --- a/rerun_py/rerun_sdk/rerun/_image_encoded.py +++ b/rerun_py/rerun_sdk/rerun/_image_encoded.py @@ -162,6 +162,7 @@ def ImageEncoded( "`ImageEncoded` is deprecated. Use `Image` (for NV12 and YUY2) or `EncodedImage` (for PNG, JPEG, …) instead." ), category=DeprecationWarning, + stacklevel=2, ) if (path is None) == (contents is None): diff --git a/rerun_py/rerun_sdk/rerun/_log.py b/rerun_py/rerun_sdk/rerun/_log.py index 60304fe54d15..93951c83c149 100644 --- a/rerun_py/rerun_sdk/rerun/_log.py +++ b/rerun_py/rerun_sdk/rerun/_log.py @@ -1,7 +1,8 @@ from __future__ import annotations +from collections.abc import Iterable from pathlib import Path -from typing import Any, Iterable +from typing import Any import pyarrow as pa import rerun_bindings as bindings diff --git a/rerun_py/rerun_sdk/rerun/_send_columns.py b/rerun_py/rerun_sdk/rerun/_send_columns.py index 4962c47ce1ab..5e920151d4d4 100644 --- a/rerun_py/rerun_sdk/rerun/_send_columns.py +++ b/rerun_py/rerun_sdk/rerun/_send_columns.py @@ -1,7 +1,8 @@ from __future__ import annotations +from collections.abc import Iterable from datetime import datetime, timedelta -from typing import Iterable, Protocol, TypeVar, overload +from typing import Protocol, TypeVar, overload import numpy as np import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/_unions.py b/rerun_py/rerun_sdk/rerun/_unions.py index c1f6b4dd55ab..0af89ff5e2ac 100644 --- a/rerun_py/rerun_sdk/rerun/_unions.py +++ b/rerun_py/rerun_sdk/rerun/_unions.py @@ -14,25 +14,22 @@ def build_dense_union(data_type: pa.DenseUnionType, discriminant: str, child: pa If the discriminant string doesn't match any possible value, a `ValueError` is raised. """ + + idx = [f.name for f in list(data_type)].index(discriminant) + type_ids = pa.array([idx] * len(child), type=pa.int8()) + value_offsets = pa.array(range(len(child)), type=pa.int32()) + + children = [pa.nulls(0, type=f.type) for f in list(data_type)] try: - idx = [f.name for f in list(data_type)].index(discriminant) - type_ids = pa.array([idx] * len(child), type=pa.int8()) - value_offsets = pa.array(range(len(child)), type=pa.int32()) - - children = [pa.nulls(0, type=f.type) for f in list(data_type)] - try: - children[idx] = child.cast(data_type[idx].type, safe=False) - except pa.ArrowInvalid: - # Since we're having issues with nullability in union types, - # the cast sometimes fails but can be skipped. - children[idx] = child - - return pa.Array.from_buffers( - type=data_type, - length=len(child), - buffers=[None, type_ids.buffers()[1], value_offsets.buffers()[1]], - children=children, - ) - - except ValueError as e: - raise ValueError(e.args) + children[idx] = child.cast(data_type[idx].type, safe=False) + except pa.ArrowInvalid: + # Since we're having issues with nullability in union types, + # the cast sometimes fails but can be skipped. + children[idx] = child + + return pa.Array.from_buffers( + type=data_type, + length=len(child), + buffers=[None, type_ids.buffers()[1], value_offsets.buffers()[1]], + children=children, + ) diff --git a/rerun_py/rerun_sdk/rerun/archetypes/depth_image_ext.py b/rerun_py/rerun_sdk/rerun/archetypes/depth_image_ext.py index 886ccde6c80e..a2ba3f7c0bfa 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/depth_image_ext.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/depth_image_ext.py @@ -33,7 +33,7 @@ def _to_numpy(tensor: ImageLike) -> npt.NDArray[Any]: try: # Make available to the cpu - return tensor.numpy(force=True) # type: ignore[union-attr] + return tensor.numpy(force=True) except AttributeError: return np.asarray(tensor) @@ -115,7 +115,7 @@ def __init__( try: datatype = ChannelDatatype.from_np_dtype(image.dtype) except KeyError: - raise ValueError(f"Unsupported dtype {image.dtype} for DepthImage") + raise ValueError(f"Unsupported dtype {image.dtype} for DepthImage") from None self.__attrs_init__( buffer=image.tobytes(), diff --git a/rerun_py/rerun_sdk/rerun/archetypes/mesh3d_ext.py b/rerun_py/rerun_sdk/rerun/archetypes/mesh3d_ext.py index 1576d44a2dde..f6691b3c42ef 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/mesh3d_ext.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/mesh3d_ext.py @@ -35,7 +35,7 @@ def _to_numpy(tensor: ImageLike) -> npt.NDArray[Any]: try: # Make available to the cpu - return tensor.numpy(force=True) # type: ignore[union-attr] + return tensor.numpy(force=True) except AttributeError: return np.asarray(tensor) diff --git a/rerun_py/rerun_sdk/rerun/archetypes/pinhole_ext.py b/rerun_py/rerun_sdk/rerun/archetypes/pinhole_ext.py index 424552b8fbc6..23e78991c171 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/pinhole_ext.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/pinhole_ext.py @@ -133,13 +133,13 @@ def __init__( fl_x = focal_length[0] # type: ignore[index] fl_y = focal_length[1] # type: ignore[index] except Exception: - raise ValueError("Expected focal_length to be one or two floats") + raise ValueError("Expected focal_length to be one or two floats") from None try: u_cen = principal_point[0] # type: ignore[index] v_cen = principal_point[1] # type: ignore[index] except Exception: - raise ValueError("Expected principal_point to be one or two floats") + raise ValueError("Expected principal_point to be one or two floats") from None image_from_camera = [[fl_x, 0, u_cen], [0, fl_y, v_cen], [0, 0, 1]] # type: ignore[assignment] else: diff --git a/rerun_py/rerun_sdk/rerun/archetypes/segmentation_image_ext.py b/rerun_py/rerun_sdk/rerun/archetypes/segmentation_image_ext.py index bd331d15ee22..6624436b5a41 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/segmentation_image_ext.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/segmentation_image_ext.py @@ -62,7 +62,7 @@ def __init__( try: datatype = ChannelDatatype.from_np_dtype(image.dtype) except KeyError: - raise ValueError(f"Unsupported dtype {image.dtype} for SegmentationImage") + raise ValueError(f"Unsupported dtype {image.dtype} for SegmentationImage") from None self.__attrs_init__( buffer=image.tobytes(), diff --git a/rerun_py/rerun_sdk/rerun/archetypes/tensor_ext.py b/rerun_py/rerun_sdk/rerun/archetypes/tensor_ext.py index 14531279ff6c..22962cc6da4e 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/tensor_ext.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/tensor_ext.py @@ -1,6 +1,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any from rerun.datatypes.range1d import Range1DLike diff --git a/rerun_py/rerun_sdk/rerun/archetypes/transform3d_ext.py b/rerun_py/rerun_sdk/rerun/archetypes/transform3d_ext.py index feddf6276ae2..d97c1a85ae25 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/transform3d_ext.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/transform3d_ext.py @@ -120,6 +120,7 @@ def __init__( "`from_parent` is deprecated as an argument to `Transform3D`; prefer `relation=rerun.TransformRelation.ChildFromParent` instead" ), category=DeprecationWarning, + stacklevel=2, ) if relation is not None: diff --git a/rerun_py/rerun_sdk/rerun/blueprint/api.py b/rerun_py/rerun_sdk/rerun/blueprint/api.py index cfe4b17bc952..3dce41c525ed 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/api.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/api.py @@ -1,7 +1,8 @@ from __future__ import annotations import uuid -from typing import Iterable, Optional, Union +from collections.abc import Iterable +from typing import Optional, Union import rerun_bindings as bindings from typing_extensions import deprecated # type: ignore[misc, unused-ignore] @@ -43,9 +44,9 @@ def __init__( contents: ViewContentsLike, name: Utf8Like | None, visible: BoolLike | None = None, - properties: dict[str, AsComponents] = {}, - defaults: list[Union[AsComponents, ComponentBatchLike]] = [], - overrides: dict[EntityPathLike, list[ComponentBatchLike]] = {}, + properties: dict[str, AsComponents] | None = None, + defaults: list[AsComponents | ComponentBatchLike] | None = None, + overrides: dict[EntityPathLike, list[ComponentBatchLike]] | None = None, ): """ Construct a blueprint for a new view. @@ -88,9 +89,9 @@ def __init__( self.origin = origin self.contents = contents self.visible = visible - self.properties = properties - self.defaults = defaults - self.overrides = overrides + self.properties = properties if properties is not None else {} + self.defaults = defaults if defaults is not None else [] + self.overrides = overrides if overrides is not None else {} def blueprint_path(self) -> str: """ @@ -118,9 +119,9 @@ def _log_to_stream(self, stream: RecordingStream) -> None: contents = self.contents else: # Otherwise we delegate to the ViewContents constructor - contents = ViewContents(query=self.contents) # type: ignore[arg-type] + contents = ViewContents(query=self.contents) - stream.log(self.blueprint_path() + "/ViewContents", contents) # type: ignore[attr-defined] + stream.log(self.blueprint_path() + "/ViewContents", contents) arch = ViewBlueprint( class_identifier=self.class_identifier, @@ -129,22 +130,23 @@ def _log_to_stream(self, stream: RecordingStream) -> None: visible=self.visible, ) - stream.log(self.blueprint_path(), arch, recording=stream) # type: ignore[attr-defined] + stream.log(self.blueprint_path(), arch) for prop_name, prop in self.properties.items(): - stream.log(f"{self.blueprint_path()}/{prop_name}", prop, recording=stream) # type: ignore[attr-defined] + stream.log(f"{self.blueprint_path()}/{prop_name}", prop) for default in self.defaults: - if hasattr(default, "as_component_batches"): - stream.log(f"{self.blueprint_path()}/defaults", default, recording=stream) # type: ignore[attr-defined] - elif hasattr(default, "component_descriptor"): - stream.log(f"{self.blueprint_path()}/defaults", [default], recording=stream) # type: ignore[attr-defined] + if isinstance(default, AsComponents): + stream.log(f"{self.blueprint_path()}/defaults", default) + elif isinstance(default, ComponentBatchLike): + stream.log(f"{self.blueprint_path()}/defaults", [default]) # type: ignore[list-item] else: raise ValueError(f"Provided default: {default} is neither a component nor a component batch.") for path, components in self.overrides.items(): - stream.log( # type: ignore[attr-defined] - f"{self.blueprint_path()}/ViewContents/individual_overrides/{path}", components, recording=stream + stream.log( + f"{self.blueprint_path()}/ViewContents/individual_overrides/{path}", + components, # type: ignore[arg-type] ) def _ipython_display_(self) -> None: @@ -264,7 +266,7 @@ def _log_to_stream(self, stream: RecordingStream) -> None: display_name=self.name, ) - stream.log(self.blueprint_path(), arch) # type: ignore[attr-defined] + stream.log(self.blueprint_path(), arch) def _ipython_display_(self) -> None: from rerun.notebook import Viewer @@ -535,7 +537,7 @@ def _log_to_stream(self, stream: RecordingStream) -> None: auto_views=self.auto_views, ) - stream.log("viewport", viewport_arch) # type: ignore[attr-defined] + stream.log("viewport", viewport_arch) if hasattr(self, "top_panel"): self.top_panel._log_to_stream(stream) @@ -634,7 +636,7 @@ def connect_grpc( default_enabled=True, ) ) - blueprint_stream.set_index("blueprint", sequence=0) # type: ignore[attr-defined] + blueprint_stream.set_index("blueprint", sequence=0) self._log_to_stream(blueprint_stream) bindings.connect_grpc_blueprint(url, make_active, make_default, blueprint_stream.to_native()) @@ -664,7 +666,7 @@ def save(self, application_id: str, path: str | None = None) -> None: default_enabled=True, ) ) - blueprint_stream.set_index("blueprint", sequence=0) # type: ignore[attr-defined] + blueprint_stream.set_index("blueprint", sequence=0) self._log_to_stream(blueprint_stream) bindings.save_blueprint(path, blueprint_stream.to_native()) @@ -721,7 +723,7 @@ def create_in_memory_blueprint(*, application_id: str, blueprint: BlueprintLike) ) ) - blueprint_stream.set_index("blueprint", sequence=0) # type: ignore[attr-defined] + blueprint_stream.set_index("blueprint", sequence=0) blueprint._log_to_stream(blueprint_stream) diff --git a/rerun_py/rerun_sdk/rerun/blueprint/components/background_kind.py b/rerun_py/rerun_sdk/rerun/blueprint/components/background_kind.py index 3158a80fc094..f0ed1f6db41f 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/components/background_kind.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/components/background_kind.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/blueprint/components/container_kind.py b/rerun_py/rerun_sdk/rerun/blueprint/components/container_kind.py index 3cb1f63ddc9d..2c016f14b288 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/components/container_kind.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/components/container_kind.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/blueprint/components/corner2d.py b/rerun_py/rerun_sdk/rerun/blueprint/components/corner2d.py index f7ff0513675b..e15ff18cd5ef 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/components/corner2d.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/components/corner2d.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/blueprint/components/map_provider.py b/rerun_py/rerun_sdk/rerun/blueprint/components/map_provider.py index dbb9a97f6d05..064bf6ccb875 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/components/map_provider.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/components/map_provider.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/blueprint/components/panel_state.py b/rerun_py/rerun_sdk/rerun/blueprint/components/panel_state.py index 61f873b446cc..58f8c5e393a7 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/components/panel_state.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/components/panel_state.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/blueprint/components/view_fit.py b/rerun_py/rerun_sdk/rerun/blueprint/components/view_fit.py index 09ff25a03c7e..90e4532612d0 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/components/view_fit.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/components/view_fit.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/blueprint/containers.py b/rerun_py/rerun_sdk/rerun/blueprint/containers.py index 06f88c00cb1a..39d880445bab 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/containers.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/containers.py @@ -1,6 +1,7 @@ from __future__ import annotations -from typing import Iterable, Optional +from collections.abc import Iterable +from typing import Optional from ..datatypes import Float32ArrayLike, Utf8Like from .api import Container, View diff --git a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/component_column_selector.py b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/component_column_selector.py index 8040d3deab6f..4372beceb66e 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/component_column_selector.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/component_column_selector.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/component_column_selector_ext.py b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/component_column_selector_ext.py index d10490ac53b0..dff22c9a9e77 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/component_column_selector_ext.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/component_column_selector_ext.py @@ -1,6 +1,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any import pyarrow as pa @@ -65,8 +66,8 @@ def native_to_pa_array_override(input_data: ComponentColumnSelectorArrayLike, da return pa.StructArray.from_arrays( [ - EntityPathBatch([x.entity_path for x in data]).as_arrow_array(), # type: ignore[misc, arg-type] - Utf8Batch([x.component for x in data]).as_arrow_array(), # type: ignore[misc, arg-type] + EntityPathBatch([x.entity_path for x in data]).as_arrow_array(), + Utf8Batch([x.component for x in data]).as_arrow_array(), ], fields=list(data_type), ) diff --git a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/filter_by_range.py b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/filter_by_range.py index eb3f2b5de3de..b3417f1716d1 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/filter_by_range.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/filter_by_range.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/filter_is_not_null.py b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/filter_is_not_null.py index cc39b13d0de1..7fbd28118415 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/filter_is_not_null.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/filter_is_not_null.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/filter_is_not_null_ext.py b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/filter_is_not_null_ext.py index 2a9e0c3aeac7..7be11dfb08e5 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/filter_is_not_null_ext.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/filter_is_not_null_ext.py @@ -28,14 +28,14 @@ def native_to_pa_array_override(input_data: FilterIsNotNullArrayLike, data_type: try: data = [_to_filter_by_event(d) for d in input_data] # type: ignore[union-attr] except _NotAFilterByEventLike: - raise ValueError(f"Unexpected input value: {input_data}") + raise ValueError(f"Unexpected input value: {input_data}") from None return pa.StructArray.from_arrays( [ - BoolBatch([x.active for x in data]).as_arrow_array(), # type: ignore[misc, arg-type] + BoolBatch([x.active for x in data]).as_arrow_array(), ComponentColumnSelectorBatch( [x.column for x in data], - ).as_arrow_array(), # type: ignore[misc, arg-type] + ).as_arrow_array(), ], fields=list(data_type), ) diff --git a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/selected_columns.py b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/selected_columns.py index 30d8f3d228f7..ecfe99e3ba28 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/selected_columns.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/selected_columns.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/selected_columns_ext.py b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/selected_columns_ext.py index 02f61a01eddb..26dba2cb60c8 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/selected_columns_ext.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/selected_columns_ext.py @@ -1,7 +1,8 @@ from __future__ import annotations import itertools -from typing import TYPE_CHECKING, Any, Iterable, Sequence +from collections.abc import Iterable, Sequence +from typing import TYPE_CHECKING, Any import pyarrow as pa @@ -84,7 +85,7 @@ def native_to_pa_array_override(input_data: SelectedColumnsArrayLike, data_type: offsets=_compute_offsets(d.component_columns for d in data), values=ComponentColumnSelectorBatch( list(itertools.chain.from_iterable(d.component_columns for d in data)), - ).as_arrow_array(), # type: ignore[misc, arg-type] + ).as_arrow_array(), type=data_type.field(1).type, ) diff --git a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/tensor_dimension_index_slider.py b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/tensor_dimension_index_slider.py index 6af74d20abdb..31db14b1864f 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/tensor_dimension_index_slider.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/tensor_dimension_index_slider.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/tensor_dimension_index_slider_ext.py b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/tensor_dimension_index_slider_ext.py index dec11cc0d3c4..1918b35d5b09 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/tensor_dimension_index_slider_ext.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/tensor_dimension_index_slider_ext.py @@ -1,6 +1,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Sequence, cast +from collections.abc import Sequence +from typing import TYPE_CHECKING, cast import numpy as np import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/utf8list.py b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/utf8list.py index 9b12ee37402b..5e1e358836b1 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/utf8list.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/utf8list.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/utf8list_ext.py b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/utf8list_ext.py index 29c73c113b26..09f5270e5a4a 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/datatypes/utf8list_ext.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/datatypes/utf8list_ext.py @@ -1,6 +1,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Sequence +from collections.abc import Sequence +from typing import TYPE_CHECKING import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/blueprint/views/bar_chart_view.py b/rerun_py/rerun_sdk/rerun/blueprint/views/bar_chart_view.py index 43fef388fed3..9128b806225f 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/views/bar_chart_view.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/views/bar_chart_view.py @@ -3,8 +3,6 @@ from __future__ import annotations -from typing import Union - __all__ = ["BarChartView"] @@ -55,8 +53,8 @@ def __init__( contents: ViewContentsLike = "$origin/**", name: Utf8Like | None = None, visible: datatypes.BoolLike | None = None, - defaults: list[Union[AsComponents, ComponentBatchLike]] = [], - overrides: dict[EntityPathLike, list[ComponentBatchLike]] = {}, + defaults: list[AsComponents | ComponentBatchLike] | None = None, + overrides: dict[EntityPathLike, list[ComponentBatchLike]] | None = None, plot_legend: blueprint_archetypes.PlotLegend | blueprint_components.Corner2D | None = None, ) -> None: """ diff --git a/rerun_py/rerun_sdk/rerun/blueprint/views/dataframe_view.py b/rerun_py/rerun_sdk/rerun/blueprint/views/dataframe_view.py index b733b3114227..61467083a4ca 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/views/dataframe_view.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/views/dataframe_view.py @@ -3,8 +3,6 @@ from __future__ import annotations -from typing import Union - __all__ = ["DataframeView"] @@ -76,8 +74,8 @@ def __init__( contents: ViewContentsLike = "$origin/**", name: Utf8Like | None = None, visible: datatypes.BoolLike | None = None, - defaults: list[Union[AsComponents, ComponentBatchLike]] = [], - overrides: dict[EntityPathLike, list[ComponentBatchLike]] = {}, + defaults: list[AsComponents | ComponentBatchLike] | None = None, + overrides: dict[EntityPathLike, list[ComponentBatchLike]] | None = None, query: blueprint_archetypes.DataframeQuery | None = None, ) -> None: """ diff --git a/rerun_py/rerun_sdk/rerun/blueprint/views/graph_view.py b/rerun_py/rerun_sdk/rerun/blueprint/views/graph_view.py index ea1d6c022aca..cfbea8411f4c 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/views/graph_view.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/views/graph_view.py @@ -3,8 +3,6 @@ from __future__ import annotations -from typing import Union - __all__ = ["GraphView"] @@ -67,8 +65,8 @@ def __init__( contents: ViewContentsLike = "$origin/**", name: Utf8Like | None = None, visible: datatypes.BoolLike | None = None, - defaults: list[Union[AsComponents, ComponentBatchLike]] = [], - overrides: dict[EntityPathLike, list[ComponentBatchLike]] = {}, + defaults: list[AsComponents | ComponentBatchLike] | None = None, + overrides: dict[EntityPathLike, list[ComponentBatchLike]] | None = None, visual_bounds: blueprint_archetypes.VisualBounds2D | None = None, force_link: blueprint_archetypes.ForceLink | None = None, force_many_body: blueprint_archetypes.ForceManyBody | None = None, diff --git a/rerun_py/rerun_sdk/rerun/blueprint/views/map_view.py b/rerun_py/rerun_sdk/rerun/blueprint/views/map_view.py index 9e0270003eb3..2c8a2f2f487a 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/views/map_view.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/views/map_view.py @@ -3,8 +3,6 @@ from __future__ import annotations -from typing import Union - __all__ = ["MapView"] @@ -62,8 +60,8 @@ def __init__( contents: ViewContentsLike = "$origin/**", name: Utf8Like | None = None, visible: datatypes.BoolLike | None = None, - defaults: list[Union[AsComponents, ComponentBatchLike]] = [], - overrides: dict[EntityPathLike, list[ComponentBatchLike]] = {}, + defaults: list[AsComponents | ComponentBatchLike] | None = None, + overrides: dict[EntityPathLike, list[ComponentBatchLike]] | None = None, zoom: blueprint_archetypes.MapZoom | datatypes.Float64Like | None = None, background: blueprint_archetypes.MapBackground | blueprint_components.MapProviderLike | None = None, ) -> None: diff --git a/rerun_py/rerun_sdk/rerun/blueprint/views/spatial2d_view.py b/rerun_py/rerun_sdk/rerun/blueprint/views/spatial2d_view.py index 0cf006b4c4bc..08c69ad54575 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/views/spatial2d_view.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/views/spatial2d_view.py @@ -3,7 +3,7 @@ from __future__ import annotations -from typing import Sequence, Union +from collections.abc import Sequence __all__ = ["Spatial2DView"] @@ -74,8 +74,8 @@ def __init__( contents: ViewContentsLike = "$origin/**", name: Utf8Like | None = None, visible: datatypes.BoolLike | None = None, - defaults: list[Union[AsComponents, ComponentBatchLike]] = [], - overrides: dict[EntityPathLike, list[ComponentBatchLike]] = {}, + defaults: list[AsComponents | ComponentBatchLike] | None = None, + overrides: dict[EntityPathLike, list[ComponentBatchLike]] | None = None, background: blueprint_archetypes.Background | datatypes.Rgba32Like | blueprint_components.BackgroundKindLike diff --git a/rerun_py/rerun_sdk/rerun/blueprint/views/spatial3d_view.py b/rerun_py/rerun_sdk/rerun/blueprint/views/spatial3d_view.py index 555bbb734b28..e2baa6809d2f 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/views/spatial3d_view.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/views/spatial3d_view.py @@ -3,7 +3,7 @@ from __future__ import annotations -from typing import Sequence, Union +from collections.abc import Sequence __all__ = ["Spatial3DView"] @@ -79,8 +79,8 @@ def __init__( contents: ViewContentsLike = "$origin/**", name: Utf8Like | None = None, visible: datatypes.BoolLike | None = None, - defaults: list[Union[AsComponents, ComponentBatchLike]] = [], - overrides: dict[EntityPathLike, list[ComponentBatchLike]] = {}, + defaults: list[AsComponents | ComponentBatchLike] | None = None, + overrides: dict[EntityPathLike, list[ComponentBatchLike]] | None = None, background: blueprint_archetypes.Background | datatypes.Rgba32Like | blueprint_components.BackgroundKindLike diff --git a/rerun_py/rerun_sdk/rerun/blueprint/views/tensor_view.py b/rerun_py/rerun_sdk/rerun/blueprint/views/tensor_view.py index 203da0d114cf..c9d586ee9fb8 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/views/tensor_view.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/views/tensor_view.py @@ -3,8 +3,6 @@ from __future__ import annotations -from typing import Union - __all__ = ["TensorView"] @@ -78,8 +76,8 @@ def __init__( contents: ViewContentsLike = "$origin/**", name: Utf8Like | None = None, visible: datatypes.BoolLike | None = None, - defaults: list[Union[AsComponents, ComponentBatchLike]] = [], - overrides: dict[EntityPathLike, list[ComponentBatchLike]] = {}, + defaults: list[AsComponents | ComponentBatchLike] | None = None, + overrides: dict[EntityPathLike, list[ComponentBatchLike]] | None = None, slice_selection: blueprint_archetypes.TensorSliceSelection | None = None, scalar_mapping: blueprint_archetypes.TensorScalarMapping | None = None, view_fit: blueprint_archetypes.TensorViewFit | blueprint_components.ViewFitLike | None = None, diff --git a/rerun_py/rerun_sdk/rerun/blueprint/views/text_document_view.py b/rerun_py/rerun_sdk/rerun/blueprint/views/text_document_view.py index 095eac37395f..85e84d070aba 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/views/text_document_view.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/views/text_document_view.py @@ -3,8 +3,6 @@ from __future__ import annotations -from typing import Union - __all__ = ["TextDocumentView"] @@ -93,8 +91,8 @@ def __init__( contents: ViewContentsLike = "$origin/**", name: Utf8Like | None = None, visible: datatypes.BoolLike | None = None, - defaults: list[Union[AsComponents, ComponentBatchLike]] = [], - overrides: dict[EntityPathLike, list[ComponentBatchLike]] = {}, + defaults: list[AsComponents | ComponentBatchLike] | None = None, + overrides: dict[EntityPathLike, list[ComponentBatchLike]] | None = None, ) -> None: """ Construct a blueprint for a new TextDocumentView view. diff --git a/rerun_py/rerun_sdk/rerun/blueprint/views/text_log_view.py b/rerun_py/rerun_sdk/rerun/blueprint/views/text_log_view.py index 4ec36faeeb00..926b02fef269 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/views/text_log_view.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/views/text_log_view.py @@ -3,8 +3,6 @@ from __future__ import annotations -from typing import Union - __all__ = ["TextLogView"] @@ -59,8 +57,8 @@ def __init__( contents: ViewContentsLike = "$origin/**", name: Utf8Like | None = None, visible: datatypes.BoolLike | None = None, - defaults: list[Union[AsComponents, ComponentBatchLike]] = [], - overrides: dict[EntityPathLike, list[ComponentBatchLike]] = {}, + defaults: list[AsComponents | ComponentBatchLike] | None = None, + overrides: dict[EntityPathLike, list[ComponentBatchLike]] | None = None, ) -> None: """ Construct a blueprint for a new TextLogView view. diff --git a/rerun_py/rerun_sdk/rerun/blueprint/views/time_series_view.py b/rerun_py/rerun_sdk/rerun/blueprint/views/time_series_view.py index 7406b54eec43..ce9d28c895ef 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/views/time_series_view.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/views/time_series_view.py @@ -3,7 +3,7 @@ from __future__ import annotations -from typing import Sequence, Union +from collections.abc import Sequence __all__ = ["TimeSeriesView"] @@ -89,8 +89,8 @@ def __init__( contents: ViewContentsLike = "$origin/**", name: Utf8Like | None = None, visible: datatypes.BoolLike | None = None, - defaults: list[Union[AsComponents, ComponentBatchLike]] = [], - overrides: dict[EntityPathLike, list[ComponentBatchLike]] = {}, + defaults: list[AsComponents | ComponentBatchLike] | None = None, + overrides: dict[EntityPathLike, list[ComponentBatchLike]] | None = None, axis_y: blueprint_archetypes.ScalarAxis | None = None, plot_legend: blueprint_archetypes.PlotLegend | blueprint_components.Corner2D | None = None, time_ranges: blueprint_archetypes.VisibleTimeRanges diff --git a/rerun_py/rerun_sdk/rerun/components/aggregation_policy.py b/rerun_py/rerun_sdk/rerun/components/aggregation_policy.py index ff112d569a86..128c086bf182 100644 --- a/rerun_py/rerun_sdk/rerun/components/aggregation_policy.py +++ b/rerun_py/rerun_sdk/rerun/components/aggregation_policy.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/components/annotation_context.py b/rerun_py/rerun_sdk/rerun/components/annotation_context.py index b1080b661d1e..89202310fcf5 100644 --- a/rerun_py/rerun_sdk/rerun/components/annotation_context.py +++ b/rerun_py/rerun_sdk/rerun/components/annotation_context.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/rerun_sdk/rerun/components/annotation_context_ext.py b/rerun_py/rerun_sdk/rerun/components/annotation_context_ext.py index 3ae5eefc62df..05e16573e8aa 100644 --- a/rerun_py/rerun_sdk/rerun/components/annotation_context_ext.py +++ b/rerun_py/rerun_sdk/rerun/components/annotation_context_ext.py @@ -1,6 +1,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Sequence +from collections.abc import Sequence +from typing import TYPE_CHECKING import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/components/colormap.py b/rerun_py/rerun_sdk/rerun/components/colormap.py index ad3b57c9183c..e1868a17194e 100644 --- a/rerun_py/rerun_sdk/rerun/components/colormap.py +++ b/rerun_py/rerun_sdk/rerun/components/colormap.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/components/fill_mode.py b/rerun_py/rerun_sdk/rerun/components/fill_mode.py index 8b4d664a6ec4..24bca3227266 100644 --- a/rerun_py/rerun_sdk/rerun/components/fill_mode.py +++ b/rerun_py/rerun_sdk/rerun/components/fill_mode.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/components/geo_line_string.py b/rerun_py/rerun_sdk/rerun/components/geo_line_string.py index 9d7598bc14c7..664608d5fc19 100644 --- a/rerun_py/rerun_sdk/rerun/components/geo_line_string.py +++ b/rerun_py/rerun_sdk/rerun/components/geo_line_string.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/components/geo_line_string_ext.py b/rerun_py/rerun_sdk/rerun/components/geo_line_string_ext.py index 3bacb98e467f..18bfa8f6beac 100644 --- a/rerun_py/rerun_sdk/rerun/components/geo_line_string_ext.py +++ b/rerun_py/rerun_sdk/rerun/components/geo_line_string_ext.py @@ -1,8 +1,8 @@ from __future__ import annotations import numbers -from collections.abc import Sized -from typing import TYPE_CHECKING, Any, Sequence +from collections.abc import Sequence, Sized +from typing import TYPE_CHECKING, Any import numpy as np import pyarrow as pa @@ -54,7 +54,7 @@ def native_to_pa_array_override(data: GeoLineStringArrayLike, data_type: pa.Data # Is it a single strip or several? # It could be a sequence of the style `[[0, 0], [1, 1]]` which is a single strip. if isinstance(data[0], Sequence) and len(data[0]) > 0 and isinstance(data[0][0], numbers.Number): - if len(data[0]) == 2: # type: ignore[arg-type] + if len(data[0]) == 2: # If any of the following elements are not sequence of length 2, DVec2DBatch should raise an error. inners = [DVec2DBatch(data).as_arrow_array()] # type: ignore[arg-type] else: diff --git a/rerun_py/rerun_sdk/rerun/components/graph_type.py b/rerun_py/rerun_sdk/rerun/components/graph_type.py index a66e8188b3ab..bacd10f2ed7d 100644 --- a/rerun_py/rerun_sdk/rerun/components/graph_type.py +++ b/rerun_py/rerun_sdk/rerun/components/graph_type.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/components/line_strip2d.py b/rerun_py/rerun_sdk/rerun/components/line_strip2d.py index 330ab8b40f1b..27941e25cbfb 100644 --- a/rerun_py/rerun_sdk/rerun/components/line_strip2d.py +++ b/rerun_py/rerun_sdk/rerun/components/line_strip2d.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/components/line_strip2d_ext.py b/rerun_py/rerun_sdk/rerun/components/line_strip2d_ext.py index e0791fa8c0bf..3082ed3be00b 100644 --- a/rerun_py/rerun_sdk/rerun/components/line_strip2d_ext.py +++ b/rerun_py/rerun_sdk/rerun/components/line_strip2d_ext.py @@ -1,8 +1,8 @@ from __future__ import annotations import numbers -from collections.abc import Sized -from typing import TYPE_CHECKING, Any, Sequence +from collections.abc import Sequence, Sized +from typing import TYPE_CHECKING, Any import numpy as np import pyarrow as pa @@ -47,7 +47,7 @@ def native_to_pa_array_override(data: LineStrip2DArrayLike, data_type: pa.DataTy # Is it a single strip or several? # It could be a sequence of the style `[[0, 0], [1, 1]]` which is a single strip. if isinstance(data[0], Sequence) and len(data[0]) > 0 and isinstance(data[0][0], numbers.Number): - if len(data[0]) == 2: # type: ignore[arg-type] + if len(data[0]) == 2: # If any of the following elements are not sequence of length 2, Vec2DBatch should raise an error. inners = [Vec2DBatch(data).as_arrow_array()] # type: ignore[arg-type] else: diff --git a/rerun_py/rerun_sdk/rerun/components/line_strip3d.py b/rerun_py/rerun_sdk/rerun/components/line_strip3d.py index a9d3b4a8e76b..88f3fcbc8c21 100644 --- a/rerun_py/rerun_sdk/rerun/components/line_strip3d.py +++ b/rerun_py/rerun_sdk/rerun/components/line_strip3d.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/components/line_strip3d_ext.py b/rerun_py/rerun_sdk/rerun/components/line_strip3d_ext.py index dd38cc3d5e9b..f835789208e6 100644 --- a/rerun_py/rerun_sdk/rerun/components/line_strip3d_ext.py +++ b/rerun_py/rerun_sdk/rerun/components/line_strip3d_ext.py @@ -1,8 +1,8 @@ from __future__ import annotations import numbers -from collections.abc import Sized -from typing import TYPE_CHECKING, Any, Sequence +from collections.abc import Sequence, Sized +from typing import TYPE_CHECKING, Any import numpy as np import pyarrow as pa @@ -47,7 +47,7 @@ def native_to_pa_array_override(data: LineStrip3DArrayLike, data_type: pa.DataTy # Is it a single strip or several? # It could be a sequence of the style `[[0, 0, 0], [1, 1, 1]]` which is a single strip. if isinstance(data[0], Sequence) and len(data[0]) > 0 and isinstance(data[0][0], numbers.Number): - if len(data[0]) == 3: # type: ignore[arg-type] + if len(data[0]) == 3: # If any of the following elements are not sequence of length 2, Vec2DBatch should raise an error. inners = [Vec3DBatch(data).as_arrow_array()] # type: ignore[arg-type] else: diff --git a/rerun_py/rerun_sdk/rerun/components/magnification_filter.py b/rerun_py/rerun_sdk/rerun/components/magnification_filter.py index 8396125bc47a..a2f7132beef3 100644 --- a/rerun_py/rerun_sdk/rerun/components/magnification_filter.py +++ b/rerun_py/rerun_sdk/rerun/components/magnification_filter.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/components/marker_shape.py b/rerun_py/rerun_sdk/rerun/components/marker_shape.py index 9ecd8406240f..15bd845caebd 100644 --- a/rerun_py/rerun_sdk/rerun/components/marker_shape.py +++ b/rerun_py/rerun_sdk/rerun/components/marker_shape.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/components/pose_scale3d_ext.py b/rerun_py/rerun_sdk/rerun/components/pose_scale3d_ext.py index a1b662fa0913..d392c6651db0 100644 --- a/rerun_py/rerun_sdk/rerun/components/pose_scale3d_ext.py +++ b/rerun_py/rerun_sdk/rerun/components/pose_scale3d_ext.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Union +from typing import TYPE_CHECKING, Any if TYPE_CHECKING: from rerun.datatypes import Float32Like, Vec3DLike @@ -11,7 +11,7 @@ class PoseScale3DExt: def __init__( self: Any, - uniform_or_per_axis: Union[Vec3DLike, Float32Like] = True, + uniform_or_per_axis: Vec3DLike | Float32Like = True, ): """ 3D scaling factor. diff --git a/rerun_py/rerun_sdk/rerun/components/scale3d_ext.py b/rerun_py/rerun_sdk/rerun/components/scale3d_ext.py index 706f33bd4672..c83b0cd14a58 100644 --- a/rerun_py/rerun_sdk/rerun/components/scale3d_ext.py +++ b/rerun_py/rerun_sdk/rerun/components/scale3d_ext.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Union +from typing import TYPE_CHECKING, Any if TYPE_CHECKING: from rerun.datatypes import Float32Like, Vec3DLike @@ -11,7 +11,7 @@ class Scale3DExt: def __init__( self: Any, - uniform_or_per_axis: Union[Vec3DLike, Float32Like] = True, + uniform_or_per_axis: Vec3DLike | Float32Like = True, ): """ 3D scaling factor. diff --git a/rerun_py/rerun_sdk/rerun/components/transform_relation.py b/rerun_py/rerun_sdk/rerun/components/transform_relation.py index 393e4dd44b8a..7df7d09536c2 100644 --- a/rerun_py/rerun_sdk/rerun/components/transform_relation.py +++ b/rerun_py/rerun_sdk/rerun/components/transform_relation.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/components/video_timestamp_ext.py b/rerun_py/rerun_sdk/rerun/components/video_timestamp_ext.py index f64ac5338a99..9260b6a43167 100644 --- a/rerun_py/rerun_sdk/rerun/components/video_timestamp_ext.py +++ b/rerun_py/rerun_sdk/rerun/components/video_timestamp_ext.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Any, Union +from typing import Any import numpy as np import numpy.typing as npt @@ -16,8 +16,8 @@ class VideoTimestampExt: def __init__( self: Any, *, - nanoseconds: Union[int, None] = None, - seconds: Union[float, None] = None, + nanoseconds: int | None = None, + seconds: float | None = None, ): """ Create a new instance of the VideoTimestamp component. diff --git a/rerun_py/rerun_sdk/rerun/datatypes/angle.py b/rerun_py/rerun_sdk/rerun/datatypes/angle.py index 9e75f9cb5b97..77df50fb2ce4 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/angle.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/angle.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/annotation_info.py b/rerun_py/rerun_sdk/rerun/datatypes/annotation_info.py index b81e887a09eb..42387db41ba4 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/annotation_info.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/annotation_info.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Tuple, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import pyarrow as pa from attrs import define, field @@ -89,7 +90,7 @@ def __init__( if TYPE_CHECKING: - AnnotationInfoLike = Union[AnnotationInfo, int, Tuple[int, str], Tuple[int, str, datatypes.Rgba32Like]] + AnnotationInfoLike = Union[AnnotationInfo, int, tuple[int, str], tuple[int, str, datatypes.Rgba32Like]] else: AnnotationInfoLike = Any diff --git a/rerun_py/rerun_sdk/rerun/datatypes/blob.py b/rerun_py/rerun_sdk/rerun/datatypes/blob.py index 1493f8800d57..4c06e49df5c3 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/blob.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/blob.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/blob_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/blob_ext.py index 286dddafc762..8390cb0768d0 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/blob_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/blob_ext.py @@ -1,7 +1,7 @@ from __future__ import annotations -from collections.abc import Sized -from typing import TYPE_CHECKING, Sequence +from collections.abc import Sequence, Sized +from typing import TYPE_CHECKING import numpy as np import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/datatypes/bool.py b/rerun_py/rerun_sdk/rerun/datatypes/bool.py index 5430f4418b0d..69aa1361e08b 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/bool.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/bool.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/datatypes/channel_datatype.py b/rerun_py/rerun_sdk/rerun/datatypes/channel_datatype.py index e4477992646e..337c20d6d76c 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/channel_datatype.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/channel_datatype.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/datatypes/class_description.py b/rerun_py/rerun_sdk/rerun/datatypes/class_description.py index 5a7d421a2799..fa2ca6de1528 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/class_description.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/class_description.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/rerun_sdk/rerun/datatypes/class_description_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/class_description_ext.py index 0a0bbdcf759a..f6234a36dc85 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/class_description_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/class_description_ext.py @@ -1,7 +1,8 @@ from __future__ import annotations import itertools -from typing import TYPE_CHECKING, Any, Sequence, cast +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, cast import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/datatypes/class_description_map_elem.py b/rerun_py/rerun_sdk/rerun/datatypes/class_description_map_elem.py index 93a2c056e16f..92ffd9a1b48e 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/class_description_map_elem.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/class_description_map_elem.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/rerun_sdk/rerun/datatypes/class_id.py b/rerun_py/rerun_sdk/rerun/datatypes/class_id.py index bb92757821ff..c9736e92e979 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/class_id.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/class_id.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/color_model.py b/rerun_py/rerun_sdk/rerun/datatypes/color_model.py index d3a1e8098ca9..d3523d8b8cd8 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/color_model.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/color_model.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/datatypes/dvec2d.py b/rerun_py/rerun_sdk/rerun/datatypes/dvec2d.py index b2a5a34ca4db..441409355349 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/dvec2d.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/dvec2d.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/dvec2d_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/dvec2d_ext.py index e92d9cf60e97..79b99ea11bbe 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/dvec2d_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/dvec2d_ext.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Sequence +from typing import TYPE_CHECKING import numpy as np import pyarrow as pa @@ -18,14 +18,5 @@ class DVec2DExt: @staticmethod def native_to_pa_array_override(data: DVec2DArrayLike, data_type: pa.DataType) -> pa.Array: - # TODO(ab): get rid of this once we drop support for Python 3.8. Make sure to pin numpy>=1.25. - if NUMPY_VERSION < (1, 25): - # Older numpy doesn't seem to support `data` in the form of [Point3D(1, 2), Point3D(3, 4)] - # this happens for python 3.8 (1.25 supports 3.9+) - from . import DVec2D - - if isinstance(data, Sequence): - data = [np.array(p.xy) if isinstance(p, DVec2D) else p for p in data] - points = flat_np_float64_array_from_array_like(data, 2) return pa.FixedSizeListArray.from_arrays(points, type=data_type) diff --git a/rerun_py/rerun_sdk/rerun/datatypes/entity_path.py b/rerun_py/rerun_sdk/rerun/datatypes/entity_path.py index f9654d312336..3d14bc5ada36 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/entity_path.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/entity_path.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt @@ -52,7 +53,7 @@ class EntityPathBatch(BaseBatch[EntityPathArrayLike]): @staticmethod def _native_to_pa_array(data: EntityPathArrayLike, data_type: pa.DataType) -> pa.Array: if isinstance(data, str): - array: Union[list[str], npt.ArrayLike] = [data] + array: list[str] | npt.ArrayLike = [data] elif isinstance(data, Sequence): array = [str(datum) for datum in data] elif isinstance(data, np.ndarray): diff --git a/rerun_py/rerun_sdk/rerun/datatypes/float32.py b/rerun_py/rerun_sdk/rerun/datatypes/float32.py index 27793c321c85..c1b27a1185d7 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/float32.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/float32.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/float64.py b/rerun_py/rerun_sdk/rerun/datatypes/float64.py index 0fb5d691d96d..c01422e4231a 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/float64.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/float64.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/image_format.py b/rerun_py/rerun_sdk/rerun/datatypes/image_format.py index ce94f3cf66e5..0f79e8f6c183 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/image_format.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/image_format.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/datatypes/keypoint_id.py b/rerun_py/rerun_sdk/rerun/datatypes/keypoint_id.py index 92e197d212d3..0fb0ff718d25 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/keypoint_id.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/keypoint_id.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/keypoint_pair.py b/rerun_py/rerun_sdk/rerun/datatypes/keypoint_pair.py index 0ec5c538f1fe..cecf429f431d 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/keypoint_pair.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/keypoint_pair.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/rerun_sdk/rerun/datatypes/mat3x3.py b/rerun_py/rerun_sdk/rerun/datatypes/mat3x3.py index 468330d6e202..926013ff1f9e 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/mat3x3.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/mat3x3.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/mat4x4.py b/rerun_py/rerun_sdk/rerun/datatypes/mat4x4.py index ce30c2e442e9..44d66e193751 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/mat4x4.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/mat4x4.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/pixel_format.py b/rerun_py/rerun_sdk/rerun/datatypes/pixel_format.py index 5728c69895c0..8e909655c1c7 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/pixel_format.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/pixel_format.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/datatypes/plane3d.py b/rerun_py/rerun_sdk/rerun/datatypes/plane3d.py index 67dc9c5fe9cc..932412571890 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/plane3d.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/plane3d.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/plane3d_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/plane3d_ext.py index 11c4859c11ba..0b88718f8ef3 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/plane3d_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/plane3d_ext.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Union, cast +from typing import TYPE_CHECKING, Any, cast import numpy as np import numpy.typing as npt @@ -30,7 +30,7 @@ def deferred_patch_class(cls: Any) -> None: cls.ZX = cls([0.0, 1.0, 0.0]) cls.XY = cls([0.0, 0.0, 1.0]) - def __init__(self: Any, normal: Vec3DLike, distance: Union[float, int, None] = None) -> None: + def __init__(self: Any, normal: Vec3DLike, distance: float | int | None = None) -> None: """ Create a new instance of the Plane3D datatype. diff --git a/rerun_py/rerun_sdk/rerun/datatypes/quaternion.py b/rerun_py/rerun_sdk/rerun/datatypes/quaternion.py index 6b134be770e4..067413f5fe46 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/quaternion.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/quaternion.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/quaternion_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/quaternion_ext.py index 4027612c1dca..75eb31260b0a 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/quaternion_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/quaternion_ext.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence +from typing import TYPE_CHECKING, Any import numpy as np import numpy.typing as npt @@ -35,14 +35,5 @@ def invalid() -> Quaternion: @staticmethod def native_to_pa_array_override(data: QuaternionArrayLike, data_type: pa.DataType) -> pa.Array: - # TODO(ab): get rid of this once we drop support for Python 3.8. Make sure to pin numpy>=1.25. - if NUMPY_VERSION < (1, 25): - # Older numpy doesn't seem to support `data` in the form of [Point3D(1, 2), Point3D(3, 4)] - # this happens for python 3.8 (1.25 supports 3.9+) - from . import Quaternion - - if isinstance(data, Sequence): - data = [np.array(p.xyzw) if isinstance(p, Quaternion) else p for p in data] # type: ignore[assignment] - quaternions = flat_np_float32_array_from_array_like(data, 4) return pa.FixedSizeListArray.from_arrays(quaternions, type=data_type) diff --git a/rerun_py/rerun_sdk/rerun/datatypes/range1d.py b/rerun_py/rerun_sdk/rerun/datatypes/range1d.py index 4ca3da080d9b..eebfa938e64c 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/range1d.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/range1d.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/range2d.py b/rerun_py/rerun_sdk/rerun/datatypes/range2d.py index e708f2f36e59..db5f3e3f5b4a 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/range2d.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/range2d.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/rerun_sdk/rerun/datatypes/rgba32.py b/rerun_py/rerun_sdk/rerun/datatypes/rgba32.py index d278b9f59357..79acdb38540a 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/rgba32.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/rgba32.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/rgba32_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/rgba32_ext.py index 4493f53848ca..3eb2d28a82f7 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/rgba32_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/rgba32_ext.py @@ -1,7 +1,8 @@ from __future__ import annotations import warnings -from typing import TYPE_CHECKING, Sequence +from collections.abc import Sequence +from typing import TYPE_CHECKING import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/rotation_axis_angle.py b/rerun_py/rerun_sdk/rerun/datatypes/rotation_axis_angle.py index 40fb79b0bcf6..3d4757782d16 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/rotation_axis_angle.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/rotation_axis_angle.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Sequence, Union +from collections.abc import Sequence +from typing import Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/rerun_sdk/rerun/datatypes/tensor_buffer.py b/rerun_py/rerun_sdk/rerun/datatypes/tensor_buffer.py index ce93d95ae921..d17dda5393a0 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/tensor_buffer.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/tensor_buffer.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt @@ -30,19 +31,19 @@ class TensorBuffer(TensorBufferExt): # You can define your own __init__ function as a member of TensorBufferExt in tensor_buffer_ext.py - inner: Union[ - npt.NDArray[np.float16], - npt.NDArray[np.float32], - npt.NDArray[np.float64], - npt.NDArray[np.int16], - npt.NDArray[np.int32], - npt.NDArray[np.int64], - npt.NDArray[np.int8], - npt.NDArray[np.uint16], - npt.NDArray[np.uint32], - npt.NDArray[np.uint64], - npt.NDArray[np.uint8], - ] = field( + inner: ( + npt.NDArray[np.float16] + | npt.NDArray[np.float32] + | npt.NDArray[np.float64] + | npt.NDArray[np.int16] + | npt.NDArray[np.int32] + | npt.NDArray[np.int64] + | npt.NDArray[np.int8] + | npt.NDArray[np.uint16] + | npt.NDArray[np.uint32] + | npt.NDArray[np.uint64] + | npt.NDArray[np.uint8] + ) = field( converter=TensorBufferExt.inner__field_converter_override # type: ignore[misc] ) """ diff --git a/rerun_py/rerun_sdk/rerun/datatypes/tensor_data.py b/rerun_py/rerun_sdk/rerun/datatypes/tensor_data.py index 28e3f52c428f..88479cf76931 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/tensor_data.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/tensor_data.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/tensor_data_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/tensor_data_ext.py index c6fc414d0acc..14faa7525a85 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/tensor_data_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/tensor_data_ext.py @@ -1,8 +1,9 @@ from __future__ import annotations import collections +from collections.abc import Sequence from math import prod -from typing import TYPE_CHECKING, Any, Final, Protocol, Sequence, Union +from typing import TYPE_CHECKING, Any, Final, Protocol, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension_index_selection.py b/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension_index_selection.py index e663fcc43666..e3cad7f6a3b6 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension_index_selection.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension_index_selection.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension_selection.py b/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension_selection.py index fcb96a8bfb6a..7ce5c79a1d4b 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension_selection.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension_selection.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy.typing as npt import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension_selection_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension_selection_ext.py index 5aa2701344b8..132246c6330b 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension_selection_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension_selection_ext.py @@ -1,6 +1,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, cast +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, cast import numpy as np import pyarrow as pa diff --git a/rerun_py/rerun_sdk/rerun/datatypes/time_int.py b/rerun_py/rerun_sdk/rerun/datatypes/time_int.py index 5a4a7692b0d3..3307aa12a9e2 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/time_int.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/time_int.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/time_range.py b/rerun_py/rerun_sdk/rerun/datatypes/time_range.py index f7193ad98c8d..bfcab27c02cf 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/time_range.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/time_range.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/rerun_sdk/rerun/datatypes/time_range_boundary.py b/rerun_py/rerun_sdk/rerun/datatypes/time_range_boundary.py index 0384d79f8f41..489433d6359d 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/time_range_boundary.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/time_range_boundary.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Literal, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Literal, Union import pyarrow as pa from attrs import define, field @@ -25,7 +26,7 @@ class TimeRangeBoundary(TimeRangeBoundaryExt): # You can define your own __init__ function as a member of TimeRangeBoundaryExt in time_range_boundary_ext.py - inner: Union[None, datatypes.TimeInt] = field() + inner: None | datatypes.TimeInt = field() """ Must be one of: diff --git a/rerun_py/rerun_sdk/rerun/datatypes/uint16.py b/rerun_py/rerun_sdk/rerun/datatypes/uint16.py index 1f9706394f70..a4c992c97196 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/uint16.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/uint16.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/uint32.py b/rerun_py/rerun_sdk/rerun/datatypes/uint32.py index 4c6d94beaa29..fd7ec8eaa081 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/uint32.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/uint32.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/uint64.py b/rerun_py/rerun_sdk/rerun/datatypes/uint64.py index cf79cfa0f503..70b19f51ebe6 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/uint64.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/uint64.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/utf8.py b/rerun_py/rerun_sdk/rerun/datatypes/utf8.py index 638ea98579e4..37426c49b0d5 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/utf8.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/utf8.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt @@ -52,7 +53,7 @@ class Utf8Batch(BaseBatch[Utf8ArrayLike]): @staticmethod def _native_to_pa_array(data: Utf8ArrayLike, data_type: pa.DataType) -> pa.Array: if isinstance(data, str): - array: Union[list[str], npt.ArrayLike] = [data] + array: list[str] | npt.ArrayLike = [data] elif isinstance(data, Sequence): array = [str(datum) for datum in data] elif isinstance(data, np.ndarray): diff --git a/rerun_py/rerun_sdk/rerun/datatypes/utf8pair.py b/rerun_py/rerun_sdk/rerun/datatypes/utf8pair.py index ac1170c90195..415a5384bd34 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/utf8pair.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/utf8pair.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Tuple, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt @@ -67,7 +68,7 @@ def __init__(self: Any, first: datatypes.Utf8Like, second: datatypes.Utf8Like): if TYPE_CHECKING: - Utf8PairLike = Union[Utf8Pair, Tuple[datatypes.Utf8Like, datatypes.Utf8Like]] + Utf8PairLike = Union[Utf8Pair, tuple[datatypes.Utf8Like, datatypes.Utf8Like]] else: Utf8PairLike = Any diff --git a/rerun_py/rerun_sdk/rerun/datatypes/uuid.py b/rerun_py/rerun_sdk/rerun/datatypes/uuid.py index ac8d5db71450..8d623799b9da 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/uuid.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/uuid.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/uuid_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/uuid_ext.py index 7b65228d39f1..0f56b186a779 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/uuid_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/uuid_ext.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Sequence +from typing import TYPE_CHECKING import numpy as np import pyarrow as pa @@ -19,15 +19,6 @@ class UuidExt: @staticmethod def native_to_pa_array_override(data: UuidArrayLike, data_type: pa.DataType) -> pa.Array: - # TODO(ab): get rid of this once we drop support for Python 3.8. Make sure to pin numpy>=1.25. - if NUMPY_VERSION < (1, 25): - # Older numpy doesn't seem to support `data` in the form of [Point3D(1, 2), Point3D(3, 4)] - # this happens for python 3.8 (1.25 supports 3.9+) - from . import Uuid - - if isinstance(data, Sequence): - data = [np.array(p.bytes) if isinstance(p, Uuid) else p for p in data] - uuids = to_np_uint8(data) # type: ignore[arg-type] # Any array like works and Uuid has an __array__ method. uuids = flat_np_array_from_array_like(uuids, 16) return pa.FixedSizeListArray.from_arrays(uuids, type=data_type) diff --git a/rerun_py/rerun_sdk/rerun/datatypes/uvec2d.py b/rerun_py/rerun_sdk/rerun/datatypes/uvec2d.py index f5e00add4625..251813fa8140 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/uvec2d.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/uvec2d.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/uvec2d_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/uvec2d_ext.py index 20b85bcded23..8e2d4ee38152 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/uvec2d_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/uvec2d_ext.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Sequence +from typing import TYPE_CHECKING import numpy as np import pyarrow as pa @@ -19,14 +19,5 @@ class UVec2DExt: @staticmethod def native_to_pa_array_override(data: UVec2DArrayLike, data_type: pa.DataType) -> pa.Array: - # TODO(ab): get rid of this once we drop support for Python 3.8. Make sure to pin numpy>=1.25. - if NUMPY_VERSION < (1, 25): - # Older numpy doesn't seem to support `data` in the form of [Point3D(1, 2), Point3D(3, 4)] - # this happens for python 3.8 (1.25 supports 3.9+) - from . import UVec2D - - if isinstance(data, Sequence): - data = [np.array(p.xy) if isinstance(p, UVec2D) else p for p in data] - points = flat_np_uint32_array_from_array_like(data, 2) return pa.FixedSizeListArray.from_arrays(points, type=data_type) diff --git a/rerun_py/rerun_sdk/rerun/datatypes/uvec3d.py b/rerun_py/rerun_sdk/rerun/datatypes/uvec3d.py index 3301c5344d8d..3b4a605b9604 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/uvec3d.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/uvec3d.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/uvec3d_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/uvec3d_ext.py index 231a2d50eae1..d84a13d921ed 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/uvec3d_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/uvec3d_ext.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Sequence +from typing import TYPE_CHECKING import numpy as np import pyarrow as pa @@ -19,14 +19,5 @@ class UVec3DExt: @staticmethod def native_to_pa_array_override(data: UVec3DArrayLike, data_type: pa.DataType) -> pa.Array: - # TODO(ab): get rid of this once we drop support for Python 3.8. Make sure to pin numpy>=1.25. - if NUMPY_VERSION < (1, 25): - # Older numpy doesn't seem to support `data` in the form of [Point3D(1, 2), Point3D(3, 4)] - # this happens for python 3.8 (1.25 supports 3.9+) - from . import UVec3D - - if isinstance(data, Sequence): - data = [np.array(p.xyz) if isinstance(p, UVec3D) else p for p in data] - points = flat_np_uint32_array_from_array_like(data, 3) return pa.FixedSizeListArray.from_arrays(points, type=data_type) diff --git a/rerun_py/rerun_sdk/rerun/datatypes/uvec4d.py b/rerun_py/rerun_sdk/rerun/datatypes/uvec4d.py index 672930f1cb12..53bab7686b22 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/uvec4d.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/uvec4d.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/vec2d.py b/rerun_py/rerun_sdk/rerun/datatypes/vec2d.py index 5fffbcc54a13..d9b992becccd 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/vec2d.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/vec2d.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/vec2d_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/vec2d_ext.py index 76bf3eae22b1..98e0b465a24f 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/vec2d_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/vec2d_ext.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Sequence +from typing import TYPE_CHECKING import numpy as np import pyarrow as pa @@ -19,14 +19,5 @@ class Vec2DExt: @staticmethod def native_to_pa_array_override(data: Vec2DArrayLike, data_type: pa.DataType) -> pa.Array: - # TODO(ab): get rid of this once we drop support for Python 3.8. Make sure to pin numpy>=1.25. - if NUMPY_VERSION < (1, 25): - # Older numpy doesn't seem to support `data` in the form of [Point3D(1, 2), Point3D(3, 4)] - # this happens for python 3.8 (1.25 supports 3.9+) - from . import Vec2D - - if isinstance(data, Sequence): - data = [np.array(p.xy) if isinstance(p, Vec2D) else p for p in data] - points = flat_np_float32_array_from_array_like(data, 2) return pa.FixedSizeListArray.from_arrays(points, type=data_type) diff --git a/rerun_py/rerun_sdk/rerun/datatypes/vec3d.py b/rerun_py/rerun_sdk/rerun/datatypes/vec3d.py index a8b13150ecdf..c970f59574ac 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/vec3d.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/vec3d.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/vec3d_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/vec3d_ext.py index 9dfffbebfaf1..8b638245bd76 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/vec3d_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/vec3d_ext.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Sequence +from typing import TYPE_CHECKING import numpy as np import pyarrow as pa @@ -19,14 +19,5 @@ class Vec3DExt: @staticmethod def native_to_pa_array_override(data: Vec3DArrayLike, data_type: pa.DataType) -> pa.Array: - # TODO(ab): get rid of this once we drop support for Python 3.8. Make sure to pin numpy>=1.25. - if NUMPY_VERSION < (1, 25): - # Older numpy doesn't seem to support `data` in the form of [Point3D(1, 2), Point3D(3, 4)] - # this happens for python 3.8 (1.25 supports 3.9+) - from . import Vec3D - - if isinstance(data, Sequence): - data = [np.array(p.xyz) if isinstance(p, Vec3D) else p for p in data] - points = flat_np_float32_array_from_array_like(data, 3) return pa.FixedSizeListArray.from_arrays(points, type=data_type) diff --git a/rerun_py/rerun_sdk/rerun/datatypes/vec4d.py b/rerun_py/rerun_sdk/rerun/datatypes/vec4d.py index a03a3c6b59db..b39c6fdc4e85 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/vec4d.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/vec4d.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/vec4d_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/vec4d_ext.py index 846439b9dd9f..2e5831fcd2bb 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/vec4d_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/vec4d_ext.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Sequence +from typing import TYPE_CHECKING import numpy as np import pyarrow as pa @@ -19,14 +19,5 @@ class Vec4DExt: @staticmethod def native_to_pa_array_override(data: Vec4DArrayLike, data_type: pa.DataType) -> pa.Array: - # TODO(ab): get rid of this once we drop support for Python 3.8. Make sure to pin numpy>=1.25. - if NUMPY_VERSION < (1, 25): - # Older numpy doesn't seem to support `data` in the form of [Point3D(1, 2), Point3D(3, 4)] - # this happens for python 3.8 (1.25 supports 3.9+) - from . import Vec4D - - if isinstance(data, Sequence): - data = [np.array(p.xyzw) if isinstance(p, Vec4D) else p for p in data] - points = flat_np_float32_array_from_array_like(data, 4) return pa.FixedSizeListArray.from_arrays(points, type=data_type) diff --git a/rerun_py/rerun_sdk/rerun/datatypes/video_timestamp.py b/rerun_py/rerun_sdk/rerun/datatypes/video_timestamp.py index 34be1f073194..c9f6e8256290 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/video_timestamp.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/video_timestamp.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/view_coordinates.py b/rerun_py/rerun_sdk/rerun/datatypes/view_coordinates.py index 8faf0d4e6799..a727669fc50f 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/view_coordinates.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/view_coordinates.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/rerun_sdk/rerun/datatypes/visible_time_range.py b/rerun_py/rerun_sdk/rerun/datatypes/visible_time_range.py index ef8e4fa756cb..cc1b2ada9f29 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/visible_time_range.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/visible_time_range.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Sequence, Union +from collections.abc import Sequence +from typing import Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/rerun_sdk/rerun/legacy_notebook.py b/rerun_py/rerun_sdk/rerun/legacy_notebook.py index 730ffb992a14..69d92e6f2db0 100644 --- a/rerun_py/rerun_sdk/rerun/legacy_notebook.py +++ b/rerun_py/rerun_sdk/rerun/legacy_notebook.py @@ -100,10 +100,10 @@ def as_html( ) if app_url is None: - app_url = bindings.get_app_url() # type: ignore[attr-defined] + app_url = bindings.get_app_url() output_stream = RecordingStream( - bindings.new_recording( # type: ignore[attr-defined] + bindings.new_recording( application_id=application_id, make_default=False, make_thread_default=False, @@ -111,16 +111,16 @@ def as_html( ) ) if blueprint is not None: - output_stream.send_blueprint(blueprint, make_active=True) # type: ignore[attr-defined] + output_stream.send_blueprint(blueprint, make_active=True) data_memory = memory_recording(recording=recording) # NOLINT - output_memory = output_stream.memory_recording() # type: ignore[attr-defined] + output_memory = output_stream.memory_recording() base64_data = base64.b64encode(output_memory.storage.concat_as_bytes(data_memory.storage)).decode("utf-8") return render_html_template( base64_data=base64_data, - app_url=app_url, # type: ignore[arg-type] + app_url=app_url, timeout_ms=timeout_ms, width=width, height=height, @@ -175,7 +175,7 @@ def legacy_notebook_show( try: from IPython.core.display import HTML - return HTML(html) # type: ignore[no-untyped-call] + return HTML(html) except ImportError: logging.warning("Could not import IPython.core.display. Returning raw HTML string instead.") return html diff --git a/rerun_py/rerun_sdk/rerun/memory.py b/rerun_py/rerun_sdk/rerun/memory.py index 613322504f0a..608523135a72 100644 --- a/rerun_py/rerun_sdk/rerun/memory.py +++ b/rerun_py/rerun_sdk/rerun/memory.py @@ -2,9 +2,12 @@ from __future__ import annotations +from typing import TYPE_CHECKING + from rerun import bindings -from .recording_stream import RecordingStream +if TYPE_CHECKING: + from .recording_stream import RecordingStream def memory_recording(recording: RecordingStream | None = None) -> MemoryRecording: diff --git a/rerun_py/rerun_sdk/rerun/notebook.py b/rerun_py/rerun_sdk/rerun/notebook.py index a57ed9561d37..01aaa5a4b162 100644 --- a/rerun_py/rerun_sdk/rerun/notebook.py +++ b/rerun_py/rerun_sdk/rerun/notebook.py @@ -103,6 +103,7 @@ def __init__( warnings.warn( f"rerun-notebook version mismatch: rerun-sdk {rerun_version}, rerun-notebook {rerun_notebook_version}", category=ImportWarning, + stacklevel=2, ) _version_mismatch_checked = True @@ -128,7 +129,7 @@ def __init__( ) if blueprint is not None: - recording.send_blueprint(blueprint) # type: ignore[attr-defined] + recording.send_blueprint(blueprint) def add_recording( self, @@ -167,7 +168,7 @@ def add_recording( ) if blueprint is not None: - recording.send_blueprint(blueprint) # type: ignore[attr-defined] + recording.send_blueprint(blueprint) def display(self, block_until_ready: bool = True) -> None: """ diff --git a/rerun_py/rerun_sdk/rerun/recording_stream.py b/rerun_py/rerun_sdk/rerun/recording_stream.py index 91672ba816e6..cfe8ea880faf 100644 --- a/rerun_py/rerun_sdk/rerun/recording_stream.py +++ b/rerun_py/rerun_sdk/rerun/recording_stream.py @@ -4,9 +4,23 @@ import functools import inspect import uuid -from typing import Any, Callable, TypeVar +from collections.abc import Iterable +from datetime import datetime, timedelta +from pathlib import Path +from types import TracebackType +from typing import TYPE_CHECKING, Any, Callable, TypeVar, overload + +import numpy as np +from typing_extensions import deprecated from rerun import bindings +from rerun.memory import MemoryRecording +from rerun.time import reset_time + +if TYPE_CHECKING: + from rerun import AsComponents, BlueprintLike, ComponentColumn, DescribedComponentBatch + + from ._send_columns import TimeColumnLike # --- @@ -167,6 +181,113 @@ def new_recording( """ +def binary_stream(recording: RecordingStream | None = None) -> BinaryStream: + """ + Sends all log-data to a [`rerun.BinaryStream`] object that can be read from. + + The contents of this stream are encoded in the Rerun Record Data format (rrd). + + This stream has no mechanism of limiting memory or creating back-pressure. If you do not + read from it, it will buffer all messages that you have logged. + + Example + ------- + ```python + stream = rr.binary_stream() + + rr.log("stream", rr.TextLog("Hello world")) + + with open("output.rrd", "wb") as f: + f.write(stream.read()) + ``` + + Parameters + ---------- + recording: + Specifies the [`rerun.RecordingStream`][] to use. + If left unspecified, defaults to the current active data recording, if there is one. + See also: [`rerun.init`][], [`rerun.set_global_data_recording`][]. + + Returns + ------- + BinaryStream + An object that can be used to flush or read the data. + + """ + return BinaryStream(bindings.binary_stream(recording=recording.to_native() if recording is not None else None)) + + +def is_enabled( + recording: RecordingStream | None = None, +) -> bool: + """ + Is this Rerun recording enabled. + + If false, all calls to the recording are ignored. + + The default can be set in [`rerun.init`][], but is otherwise `True`. + + This can be controlled with the environment variable `RERUN` (e.g. `RERUN=on` or `RERUN=off`). + + """ + return bindings.is_enabled(recording=recording.to_native() if recording is not None else None) # type: ignore[no-any-return] + + +def get_application_id( + recording: RecordingStream | None = None, +) -> str | None: + """ + Get the application ID that this recording is associated with, if any. + + Parameters + ---------- + recording: + Specifies the [`rerun.RecordingStream`][] to use. + If left unspecified, defaults to the current active data recording, if there is one. + See also: [`rerun.init`][], [`rerun.set_global_data_recording`][]. + + Returns + ------- + str + The application ID that this recording is associated with. + + """ + app_id = bindings.get_application_id(recording=recording.to_native() if recording is not None else None) + return str(app_id) if app_id is not None else None + + +def get_recording_id( + recording: RecordingStream | None = None, +) -> str | None: + """ + Get the recording ID that this recording is logging to, as a UUIDv4, if any. + + The default recording_id is based on `multiprocessing.current_process().authkey` + which means that all processes spawned with `multiprocessing` + will have the same default recording_id. + + If you are not using `multiprocessing` and still want several different Python + processes to log to the same Rerun instance (and be part of the same recording), + you will need to manually assign them all the same recording_id. + Any random UUIDv4 will work, or copy the recording id for the parent process. + + Parameters + ---------- + recording: + Specifies the [`rerun.RecordingStream`][] to use. + If left unspecified, defaults to the current active data recording, if there is one. + See also: [`rerun.init`][], [`rerun.set_global_data_recording`][]. + + Returns + ------- + str + The recording ID that this recording is logging to. + + """ + rec_id = bindings.get_recording_id(recording=recording.to_native() if recording is not None else None) + return str(rec_id) if rec_id is not None else None + + class RecordingStream: """ A RecordingStream is used to send data to Rerun. @@ -240,12 +361,14 @@ def __init__(self, inner: bindings.PyRecordingStream) -> None: self._prev: RecordingStream | None = None self.context_token: contextvars.Token[RecordingStream] | None = None - def __enter__(self): # type: ignore[no-untyped-def] + def __enter__(self) -> RecordingStream: self.context_token = active_recording_stream.set(self) self._prev = set_thread_local_data_recording(self) return self - def __exit__(self, type, value, traceback): # type: ignore[no-untyped-def] + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: self.flush(blocking=True) current_recording = active_recording_stream.get(None) @@ -255,7 +378,7 @@ def __exit__(self, type, value, traceback): # type: ignore[no-untyped-def] active_recording_stream.reset(self.context_token) # Restore the recording stream state - set_thread_local_data_recording(self._prev) # type: ignore[arg-type] + set_thread_local_data_recording(self._prev) self._prev = None # Sanity check: we set this context-var on enter. If it's not still set, something weird @@ -291,172 +414,745 @@ def __del__(self): # type: ignore[no-untyped-def] if recording is not None and not recording.is_forked_child(): bindings.flush(blocking=False, recording=recording) # NOLINT + # any free function taking a `RecordingStream` as the first argument can also be a method + binary_stream = binary_stream + get_application_id = get_application_id + get_recording_id = get_recording_id + is_enabled = is_enabled + + def connect_grpc( + self, + url: str | None = None, + *, + flush_timeout_sec: float | None = 2.0, + default_blueprint: BlueprintLike | None = None, + ) -> None: + """ + Connect to a remote Rerun Viewer on the given HTTP(S) URL. -def binary_stream(recording: RecordingStream | None = None) -> BinaryStream: - """ - Sends all log-data to a [`rerun.BinaryStream`] object that can be read from. + This function returns immediately. - The contents of this stream are encoded in the Rerun Record Data format (rrd). + Parameters + ---------- + url: + The HTTP(S) URL to connect to + flush_timeout_sec: + The minimum time the SDK will wait during a flush before potentially + dropping data if progress is not being made. Passing `None` indicates no timeout, + and can cause a call to `flush` to block indefinitely. + default_blueprint + Optionally set a default blueprint to use for this application. If the application + already has an active blueprint, the new blueprint won't become active until the user + clicks the "reset blueprint" button. If you want to activate the new blueprint + immediately, instead use the [`rerun.send_blueprint`][] API. - This stream has no mechanism of limiting memory or creating back-pressure. If you do not - read from it, it will buffer all messages that you have logged. + """ - Example - ------- - ```python - stream = rr.binary_stream() + from .sinks import connect_grpc - rr.log("stream", rr.TextLog("Hello world")) + connect_grpc(url, flush_timeout_sec=flush_timeout_sec, default_blueprint=default_blueprint, recording=self) - with open("output.rrd", "wb") as f: - f.write(stream.read()) - ``` + def save(self, path: str | Path, default_blueprint: BlueprintLike | None = None) -> None: + """ + Stream all log-data to a file. - Parameters - ---------- - recording: - Specifies the [`rerun.RecordingStream`][] to use. - If left unspecified, defaults to the current active data recording, if there is one. - See also: [`rerun.init`][], [`rerun.set_global_data_recording`][]. + Call this _before_ you log any data! - Returns - ------- - BinaryStream - An object that can be used to flush or read the data. + The Rerun Viewer is able to read continuously from the resulting rrd file while it is being written. + However, depending on your OS and configuration, changes may not be immediately visible due to file caching. + This is a common issue on Windows and (to a lesser extent) on MacOS. - """ - return BinaryStream(bindings.binary_stream(recording=recording.to_native() if recording is not None else None)) + Parameters + ---------- + path: + The path to save the data to. + default_blueprint + Optionally set a default blueprint to use for this application. If the application + already has an active blueprint, the new blueprint won't become active until the user + clicks the "reset blueprint" button. If you want to activate the new blueprint + immediately, instead use the [`rerun.send_blueprint`][] API. + """ -class BinaryStream: - """An encoded stream of bytes that can be saved as an rrd or sent to the viewer.""" + from .sinks import save - def __init__(self, storage: bindings.PyMemorySinkStorage) -> None: - self.storage = storage + save(path, default_blueprint, recording=self) - def read(self, *, flush: bool = True) -> bytes: + def stdout(self, default_blueprint: BlueprintLike | None = None) -> None: """ - Reads the available bytes from the stream. + Stream all log-data to stdout. - If using `flush`, the read call will first block until the flush is complete. + Pipe it into a Rerun Viewer to visualize it. + + Call this _before_ you log any data! + + If there isn't any listener at the other end of the pipe, the `RecordingStream` will + default back to `buffered` mode, in order not to break the user's terminal. Parameters ---------- - flush: - If true (default), the stream will be flushed before reading. + default_blueprint + Optionally set a default blueprint to use for this application. If the application + already has an active blueprint, the new blueprint won't become active until the user + clicks the "reset blueprint" button. If you want to activate the new blueprint + immediately, instead use the [`rerun.send_blueprint`][] API. """ - return self.storage.read(flush=flush) # type: ignore[no-any-return] - def flush(self) -> None: + from .sinks import stdout + + stdout(default_blueprint, recording=self) + + def memory_recording(self) -> MemoryRecording: """ - Flushes the recording stream and ensures that all logged messages have been encoded into the stream. + Streams all log-data to a memory buffer. + + This can be used to display the RRD to alternative formats such as html. + See: [rerun.notebook_show][]. + + Returns + ------- + MemoryRecording + A memory recording object that can be used to read the data. - This will block until the flush is complete. """ - self.storage.flush() + from .memory import memory_recording -def _patch(funcs): # type: ignore[no-untyped-def] - """Adds the given functions as methods to the `RecordingStream` class; injects `recording=self` in passing.""" - import functools - import os + return memory_recording(self) - # If this is a special RERUN_APP_ONLY context (launched via .spawn), we - # can bypass everything else, which keeps us from monkey patching methods - # that never get used. - if os.environ.get("RERUN_APP_ONLY"): - return + def disconnect(self) -> None: + """ + Closes all TCP connections, servers, and files. - # NOTE: Python's closures capture by reference… make sure to copy `fn` early. - def eager_wrap(fn): # type: ignore[no-untyped-def] - @functools.wraps(fn) - def wrapper(self, *args: Any, **kwargs: Any) -> Any: # type: ignore[no-untyped-def] - kwargs["recording"] = self - return fn(*args, **kwargs) + Closes all TCP connections, servers, and files that have been opened with + [`rerun.connect`], [`rerun.serve`], [`rerun.save`] or [`rerun.spawn`]. + """ - return wrapper + from .sinks import disconnect - for fn in funcs: - wrapper = eager_wrap(fn) # type: ignore[no-untyped-call] - setattr(RecordingStream, fn.__name__, wrapper) + disconnect(recording=self) + def serve_web( + self, + *, + open_browser: bool = True, + web_port: int | None = None, + grpc_port: int | None = None, + default_blueprint: BlueprintLike | None = None, + server_memory_limit: str = "25%", + ) -> None: + """ + Serve log-data over WebSockets and serve a Rerun web viewer over HTTP. -# --- + You can also connect to this server with the native viewer using `rerun localhost:9090`. + The WebSocket server will buffer all log data in memorsy so that late connecting viewers will get all the data. + You can limit the amount of data buffered by the WebSocket server with the `server_memory_limit` argument. + Once reached, the earliest logged data will be dropped. + Note that this means that static data may be dropped if logged early (see ). -def is_enabled( - recording: RecordingStream | None = None, -) -> bool: - """ - Is this Rerun recording enabled. + This function returns immediately. - If false, all calls to the recording are ignored. + Parameters + ---------- + open_browser: + Open the default browser to the viewer. + web_port: + The port to serve the web viewer on (defaults to 9090). + grpc_port: + The port to serve the gRPC server on (defaults to 9876) + default_blueprint: + Optionally set a default blueprint to use for this application. If the application + already has an active blueprint, the new blueprint won't become active until the user + clicks the "reset blueprint" button. If you want to activate the new blueprint + immediately, instead use the [`rerun.send_blueprint`][] API. + server_memory_limit: + Maximum amount of memory to use for buffering log data for clients that connect late. + This can be a percentage of the total ram (e.g. "50%") or an absolute value (e.g. "4GB"). - The default can be set in [`rerun.init`][], but is otherwise `True`. + """ - This can be controlled with the environment variable `RERUN` (e.g. `RERUN=on` or `RERUN=off`). + from .sinks import serve_web - """ - return bindings.is_enabled(recording=recording.to_native() if recording is not None else None) # type: ignore[no-any-return] + serve_web( + open_browser=open_browser, + web_port=web_port, + grpc_port=grpc_port, + default_blueprint=default_blueprint, + server_memory_limit=server_memory_limit, + recording=self, + ) + def send_blueprint( + self, + blueprint: BlueprintLike, + *, + make_active: bool = True, + make_default: bool = True, + ) -> None: + """ + Create a blueprint from a `BlueprintLike` and send it to the `RecordingStream`. -def get_application_id( - recording: RecordingStream | None = None, -) -> str | None: - """ - Get the application ID that this recording is associated with, if any. + Parameters + ---------- + blueprint: + A blueprint object to send to the viewer. + make_active: + Immediately make this the active blueprint for the associated `app_id`. + Note that setting this to `false` does not mean the blueprint may not still end + up becoming active. In particular, if `make_default` is true and there is no other + currently active blueprint. + make_default: + Make this the default blueprint for the `app_id`. + The default blueprint will be used as the template when the user resets the + blueprint for the app. It will also become the active blueprint if no other + blueprint is currently active. - Parameters - ---------- - recording: - Specifies the [`rerun.RecordingStream`][] to use. - If left unspecified, defaults to the current active data recording, if there is one. - See also: [`rerun.init`][], [`rerun.set_global_data_recording`][]. + """ - Returns - ------- - str - The application ID that this recording is associated with. + from .sinks import send_blueprint - """ - app_id = bindings.get_application_id(recording=recording.to_native() if recording is not None else None) - return str(app_id) if app_id is not None else None + send_blueprint(blueprint=blueprint, make_active=make_active, make_default=make_default, recording=self) + def spawn( + self, + *, + port: int = 9876, + connect: bool = True, + memory_limit: str = "75%", + hide_welcome_screen: bool = False, + default_blueprint: BlueprintLike | None = None, + ) -> None: + """ + Spawn a Rerun Viewer, listening on the given port. -def get_recording_id( - recording: RecordingStream | None = None, -) -> str | None: - """ - Get the recording ID that this recording is logging to, as a UUIDv4, if any. + This is often the easiest and best way to use Rerun. + Just call this once at the start of your program. - The default recording_id is based on `multiprocessing.current_process().authkey` - which means that all processes spawned with `multiprocessing` - will have the same default recording_id. + You can also call [rerun.init][] with a `spawn=True` argument. - If you are not using `multiprocessing` and still want several different Python - processes to log to the same Rerun instance (and be part of the same recording), - you will need to manually assign them all the same recording_id. - Any random UUIDv4 will work, or copy the recording id for the parent process. + Parameters + ---------- + port: + The port to listen on. + connect: + also connect to the viewer and stream logging data to it. + memory_limit: + An upper limit on how much memory the Rerun Viewer should use. + When this limit is reached, Rerun will drop the oldest data. + Example: `16GB` or `50%` (of system total). + hide_welcome_screen: + Hide the normal Rerun welcome screen. + default_blueprint + Optionally set a default blueprint to use for this application. If the application + already has an active blueprint, the new blueprint won't become active until the user + clicks the "reset blueprint" button. If you want to activate the new blueprint + immediately, instead use the [`rerun.send_blueprint`][] API. - Parameters - ---------- - recording: - Specifies the [`rerun.RecordingStream`][] to use. - If left unspecified, defaults to the current active data recording, if there is one. - See also: [`rerun.init`][], [`rerun.set_global_data_recording`][]. + """ - Returns - ------- - str - The recording ID that this recording is logging to. + from .sinks import spawn - """ - rec_id = bindings.get_recording_id(recording=recording.to_native() if recording is not None else None) - return str(rec_id) if rec_id is not None else None + spawn( + port=port, + connect=connect, + memory_limit=memory_limit, + hide_welcome_screen=hide_welcome_screen, + default_blueprint=default_blueprint, + recording=self, + ) + + def notebook_show( + self, + *, + width: int | None = None, + height: int | None = None, + blueprint: BlueprintLike | None = None, + ) -> None: + """ + Output the Rerun viewer in a notebook using IPython [IPython.core.display.HTML][]. + + Any data logged to the recording after initialization will be sent directly to the viewer. + + Note that this can be called at any point during cell execution. The call will block until the embedded + viewer is initialized and ready to receive data. Thereafter any log calls will immediately send data + to the viewer. + + Parameters + ---------- + width : int + The width of the viewer in pixels. + height : int + The height of the viewer in pixels. + blueprint : BlueprintLike + A blueprint object to send to the viewer. + It will be made active and set as the default blueprint in the recording. + + Setting this is equivalent to calling [`rerun.send_blueprint`][] before initializing the viewer. + + """ + + from .notebook import notebook_show + + notebook_show( + width=width, + height=height, + blueprint=blueprint, + recording=self, + ) + + @overload + def set_index(self, timeline: str, *, sequence: int) -> None: ... + + @overload + def set_index(self, timeline: str, *, timedelta: int | float | timedelta | np.timedelta64) -> None: ... + + @overload + def set_index(self, timeline: str, *, datetime: int | float | datetime | np.datetime64) -> None: ... + + def set_index( + self, + timeline: str, + *, + sequence: int | None = None, + timedelta: int | float | timedelta | np.timedelta64 | None = None, + datetime: int | float | datetime | np.datetime64 | None = None, + ) -> None: + """ + Set the current time of a timeline for this thread. + + Used for all subsequent logging on the same thread, until the next call to + [`rerun.set_index`][], [`rerun.reset_time`][] or [`rerun.disable_timeline`][]. + + For example: `set_index("frame_nr", sequence=frame_nr)`. + + There is no requirement of monotonicity. You can move the time backwards if you like. + + You are expected to set exactly ONE of the arguments `sequence`, `timedelta`, or `datetime`. + You may NOT change the type of a timeline, so if you use `timedelta` for a specific timeline, + you must only use `timedelta` for that timeline going forward. + + The columnar equivalent to this function is [`rerun.IndexColumn`][]. + + Parameters + ---------- + timeline : str + The name of the timeline to set the time for. + sequence: + Used for sequential indices, like `frame_nr`. + Must be an integer. + timedelta: + Used for relative times, like `time_since_start`. + Must either be in seconds, a [`datetime.timedelta`][], or [`numpy.timedelta64`][]. + For nanosecond precision, use `numpy.timedelta64(nanoseconds, 'ns')`. + datetime: + Used for absolute time indices, like `capture_time`. + Must either be in seconds since Unix epoch, a [`datetime.datetime`][], or [`numpy.datetime64`][]. + For nanosecond precision, use `numpy.datetime64(nanoseconds, 'ns')`. + + """ + + from .time import set_index + + # mypy appears to not be smart enough to understand how the above @overload make the following call valid. + set_index( # type: ignore[call-overload] + timeline=timeline, + timedelta=timedelta, + sequence=sequence, + datetime=datetime, + recording=self, + ) + + @deprecated( + """Use `set_index(sequence=…)` instead. + See: https://www.rerun.io/docs/reference/migration/migration-0-23?speculative-link for more details.""" + ) + def set_time_sequence(self, timeline: str, sequence: int) -> None: + """ + Set the current time for this thread as an integer sequence. + + Used for all subsequent logging on the same thread, + until the next call to `set_time_sequence`. + + For example: `set_time_sequence("frame_nr", frame_nr)`. + + You can remove a timeline again using `disable_timeline("frame_nr")`. + + There is no requirement of monotonicity. You can move the time backwards if you like. + + This function marks the timeline as being of a _squential_ type. + You should not use the temporal functions ([`rerun.set_time_seconds`][], [`rerun.set_time_nanos`][]) + on the same timeline, as that will produce undefined behavior. + + Parameters + ---------- + timeline : str + The name of the timeline to set the time for. + sequence : int + The current time on the timeline in integer units. + + """ + + from .time import set_time_sequence + + set_time_sequence(timeline=timeline, sequence=sequence, recording=self) + + @deprecated( + """Use `set_index(datetime=seconds)` or set_index(timedelta=seconds)` instead. + See: https://www.rerun.io/docs/reference/migration/migration-0-23?speculative-link for more details.""" + ) + def set_time_seconds(self, timeline: str, seconds: float) -> None: + """ + Set the current time for this thread in seconds. + + Used for all subsequent logging on the same thread, + until the next call to [`rerun.set_time_seconds`][] or [`rerun.set_time_nanos`][]. + + For example: `set_time_seconds("capture_time", seconds_since_unix_epoch)`. + + You can remove a timeline again using `disable_timeline("capture_time")`. + + Very large values will automatically be interpreted as seconds since unix epoch (1970-01-01). + Small values (less than a few years) will be interpreted as relative + some unknown point in time, and will be shown as e.g. `+3.132s`. + + The bindings has a built-in time which is `log_time`, and is logged as seconds + since unix epoch. + + There is no requirement of monotonicity. You can move the time backwards if you like. + + This function marks the timeline as being of a _temporal_ type. + You should not use the sequential function [`rerun.set_time_sequence`][] + on the same timeline, as that will produce undefined behavior. + + Parameters + ---------- + timeline : str + The name of the timeline to set the time for. + seconds : float + The current time on the timeline in seconds. + + """ + + from .time import set_time_seconds + + set_time_seconds(timeline=timeline, seconds=seconds, recording=self) + + @deprecated( + """Use `set_index(datetime=1e-9 * nanos)` or set_index(timedelta=1e-9 * nanos)` instead. + See: https://www.rerun.io/docs/reference/migration/migration-0-23?speculative-link for more details.""" + ) + def set_time_nanos(self, timeline: str, nanos: int) -> None: + """ + Set the current time for this thread. + + Used for all subsequent logging on the same thread, + until the next call to [`rerun.set_time_nanos`][] or [`rerun.set_time_seconds`][]. + + For example: `set_time_nanos("capture_time", nanos_since_unix_epoch)`. + + You can remove a timeline again using `disable_timeline("capture_time")`. + + Very large values will automatically be interpreted as nanoseconds since unix epoch (1970-01-01). + Small values (less than a few years) will be interpreted as relative + some unknown point in time, and will be shown as e.g. `+3.132s`. + + The bindings has a built-in time which is `log_time`, and is logged as nanos since + unix epoch. + + There is no requirement of monotonicity. You can move the time backwards if you like. + + This function marks the timeline as being of a _temporal_ type. + You should not use the sequential function [`rerun.set_time_sequence`][] + on the same timeline, as that will produce undefined behavior. + + Parameters + ---------- + timeline : str + The name of the timeline to set the time for. + nanos : int + The current time on the timeline in nanoseconds. + + """ + + from .time import set_time_nanos + + set_time_nanos(timeline=timeline, nanos=nanos, recording=self) + + def disable_timeline(self, timeline: str) -> None: + """ + Clear time information for the specified timeline on this thread. + + Parameters + ---------- + timeline : str + The name of the timeline to clear the time for. + + """ + + from .time import disable_timeline + + disable_timeline(timeline=timeline, recording=self) + + reset_time = reset_time + + def log( + self, + entity_path: str | list[str], + entity: AsComponents | Iterable[DescribedComponentBatch], + *extra: AsComponents | Iterable[DescribedComponentBatch], + static: bool = False, + strict: bool | None = None, + ) -> None: + r""" + Log data to Rerun. + + This is the main entry point for logging data to rerun. It can be used to log anything + that implements the [`rerun.AsComponents`][] interface, or a collection of `ComponentBatchLike` + + + + objects. + + When logging data, you must always provide an [entity_path](https://www.rerun.io/docs/concepts/entity-path) + for identifying the data. Note that the path prefix "rerun/" is considered reserved for use by the Rerun SDK + itself and should not be used for logging user data. This is where Rerun will log additional information + such as warnings. + + The most common way to log is with one of the rerun archetypes, all of which implement + the `AsComponents` interface. + + For example, to log a 3D point: + ```py + rr.log("my/point", rr.Points3D(position=[1.0, 2.0, 3.0])) + ``` + + The `log` function can flexibly accept an arbitrary number of additional objects which will + be merged into the first entity so long as they don't expose conflicting components, for instance: + ```py + # Log three points with arrows sticking out of them, + # and a custom "confidence" component. + rr.log( + "my/points", + rr.Points3D([[0.2, 0.5, 0.3], [0.9, 1.2, 0.1], [1.0, 4.2, 0.3]], radii=[0.1, 0.2, 0.3]), + rr.Arrows3D(vectors=[[0.3, 2.1, 0.2], [0.9, -1.1, 2.3], [-0.4, 0.5, 2.9]]), + rr.AnyValues(confidence=[0.3, 0.4, 0.9]), + ) + ``` + + Parameters + ---------- + entity_path: + Path to the entity in the space hierarchy. + + The entity path can either be a string + (with special characters escaped, split on unescaped slashes) + or a list of unescaped strings. + This means that logging to `"world/my\ image\!"` is the same as logging + to ["world", "my image!"]. + + See for more on entity paths. + + entity: + Anything that implements the [`rerun.AsComponents`][] interface, usually an archetype. + + *extra: + An arbitrary number of additional component bundles implementing the [`rerun.AsComponents`][] + interface, that are logged to the same entity path. + + static: + If true, the components will be logged as static data. + + Static data has no time associated with it, exists on all timelines, and unconditionally shadows + any temporal data of the same type. + + Otherwise, the data will be timestamped automatically with `log_time` and `log_tick`. + Additional timelines set by [`rerun.set_time_sequence`][], [`rerun.set_time_seconds`][] or + [`rerun.set_time_nanos`][] will also be included. + + strict: + If True, raise exceptions on non-loggable data. + If False, warn on non-loggable data. + if None, use the global default from `rerun.strict_mode()` + + """ + + from ._log import log + + log(entity_path, entity, *extra, static=static, strict=strict, recording=self) + + def log_file_from_contents( + self, + file_path: str | Path, + file_contents: bytes, + *, + entity_path_prefix: str | None = None, + static: bool = False, + ) -> None: + r""" + Logs the given `file_contents` using all `DataLoader`s available. + + A single `path` might be handled by more than one loader. + + This method blocks until either at least one `DataLoader` starts + streaming data in or all of them fail. + + See for more information. + + Parameters + ---------- + file_path: + Path to the file that the `file_contents` belong to. + + file_contents: + Contents to be logged. + + entity_path_prefix: + What should the logged entity paths be prefixed with? + + static: + If true, the components will be logged as static data. + + Static data has no time associated with it, exists on all timelines, and unconditionally shadows + any temporal data of the same type. + + Otherwise, the data will be timestamped automatically with `log_time` and `log_tick`. + Additional timelines set by [`rerun.set_time_sequence`][], [`rerun.set_time_seconds`][] or + [`rerun.set_time_nanos`][] will also be included. + + """ + + from ._log import log_file_from_contents + + log_file_from_contents( + file_path=file_path, + file_contents=file_contents, + entity_path_prefix=entity_path_prefix, + static=static, + recording=self, + ) + def log_file_from_path( + self, + file_path: str | Path, + *, + entity_path_prefix: str | None = None, + static: bool = False, + ) -> None: + r""" + Logs the file at the given `path` using all `DataLoader`s available. + + A single `path` might be handled by more than one loader. + + This method blocks until either at least one `DataLoader` starts + streaming data in or all of them fail. + + See for more information. + + Parameters + ---------- + file_path: + Path to the file to be logged. + + entity_path_prefix: + What should the logged entity paths be prefixed with? + + static: + If true, the components will be logged as static data. + + Static data has no time associated with it, exists on all timelines, and unconditionally shadows + any temporal data of the same type. + + Otherwise, the data will be timestamped automatically with `log_time` and `log_tick`. + Additional timelines set by [`rerun.set_time_sequence`][], [`rerun.set_time_seconds`][] or + [`rerun.set_time_nanos`][] will also be included. + + """ + + from ._log import log_file_from_path + + log_file_from_path( + file_path=file_path, + entity_path_prefix=entity_path_prefix, + static=static, + recording=self, + ) + + def send_columns( + self, + entity_path: str, + indexes: Iterable[TimeColumnLike], + columns: Iterable[ComponentColumn], + strict: bool | None = None, + ) -> None: + r""" + Send columnar data to Rerun. + + Unlike the regular `log` API, which is row-oriented, this API lets you submit the data + in a columnar form. Each `TimeColumnLike` and `ComponentColumn` object represents a column + of data that will be sent to Rerun. The lengths of all these columns must match, and all + data that shares the same index across the different columns will act as a single logical row, + equivalent to a single call to `rr.log()`. + + Note that this API ignores any stateful time set on the log stream via the `rerun.set_time_*` APIs. + Furthermore, this will _not_ inject the default timelines `log_tick` and `log_time` timeline columns. + + Parameters + ---------- + entity_path: + Path to the entity in the space hierarchy. + + See for more on entity paths. + indexes: + The time values of this batch of data. Each `TimeColumnLike` object represents a single column + of timestamps. Generally, you should use one of the provided classes: [`TimeSequenceColumn`][rerun.TimeSequenceColumn], + [`TimeSecondsColumn`][rerun.TimeSecondsColumn], or [`TimeNanosColumn`][rerun.TimeNanosColumn]. + columns: + The columns of components to log. Each object represents a single column of data. + + In order to send multiple components per time value, explicitly create a [`ComponentColumn`][rerun.ComponentColumn] + either by constructing it directly, or by calling the `.columns()` method on an `Archetype` type. + strict: + If True, raise exceptions on non-loggable data. + If False, warn on non-loggable data. + If None, use the global default from `rerun.strict_mode()` + + """ + + from ._send_columns import send_columns + + send_columns(entity_path=entity_path, indexes=indexes, columns=columns, strict=strict, recording=self) + + +class BinaryStream: + """An encoded stream of bytes that can be saved as an rrd or sent to the viewer.""" + + def __init__(self, storage: bindings.PyMemorySinkStorage) -> None: + self.storage = storage + + def read(self, *, flush: bool = True) -> bytes: + """ + Reads the available bytes from the stream. + + If using `flush`, the read call will first block until the flush is complete. + + Parameters + ---------- + flush: + If true (default), the stream will be flushed before reading. + + """ + return self.storage.read(flush=flush) # type: ignore[no-any-return] + + def flush(self) -> None: + """ + Flushes the recording stream and ensures that all logged messages have been encoded into the stream. + + This will block until the flush is complete. + """ + self.storage.flush() -_patch([is_enabled, get_application_id, get_recording_id]) # type: ignore[no-untyped-call] # --- diff --git a/rerun_py/rerun_sdk/rerun/script_helpers.py b/rerun_py/rerun_sdk/rerun/script_helpers.py index ef3407f3ead7..40628a0a4c48 100644 --- a/rerun_py/rerun_sdk/rerun/script_helpers.py +++ b/rerun_py/rerun_sdk/rerun/script_helpers.py @@ -104,19 +104,18 @@ def script_setup( rec: RecordingStream = rr.get_global_data_recording() # type: ignore[assignment] - # NOTE: mypy thinks these methods don't exist because they're monkey-patched. if args.stdout: - rec.stdout(default_blueprint=default_blueprint) # type: ignore[attr-defined] + rec.stdout(default_blueprint=default_blueprint) elif args.serve: - rec.serve(default_blueprint=default_blueprint) # type: ignore[attr-defined] + rec.serve_web(default_blueprint=default_blueprint) elif args.connect: # Send logging data to separate `rerun` process. # You can omit the argument to connect to the default URL. - rec.connect_grpc(args.url, default_blueprint=default_blueprint) # type: ignore[attr-defined] + rec.connect_grpc(args.url, default_blueprint=default_blueprint) elif args.save is not None: - rec.save(args.save, default_blueprint=default_blueprint) # type: ignore[attr-defined] + rec.save(args.save, default_blueprint=default_blueprint) elif not args.headless: - rec.spawn(default_blueprint=default_blueprint) # type: ignore[attr-defined] + rec.spawn(default_blueprint=default_blueprint) return rec diff --git a/rerun_py/rerun_sdk/rerun/sinks.py b/rerun_py/rerun_sdk/rerun/sinks.py index 5852e8219471..9d9645161bbb 100644 --- a/rerun_py/rerun_sdk/rerun/sinks.py +++ b/rerun_py/rerun_sdk/rerun/sinks.py @@ -3,15 +3,19 @@ import logging import pathlib import warnings +from typing import TYPE_CHECKING -import rerun_bindings as bindings # type: ignore[attr-defined] +import rerun_bindings as bindings from typing_extensions import deprecated # type: ignore[misc, unused-ignore] from rerun.blueprint.api import BlueprintLike, create_in_memory_blueprint -from rerun.recording_stream import RecordingStream, get_application_id from ._spawn import _spawn_viewer +if TYPE_CHECKING: + from rerun.recording_stream import RecordingStream + + # --- Sinks --- @@ -146,7 +150,9 @@ def connect_grpc( logging.warning("Rerun is disabled - connect() call ignored") return - application_id = get_application_id(recording=recording) # NOLINT + from rerun.recording_stream import get_application_id + + application_id = get_application_id(recording) # NOLINT if application_id is None: raise ValueError( "No application id found. You must call rerun.init before connecting to a viewer, or provide a recording." @@ -199,6 +205,8 @@ def save( logging.warning("Rerun is disabled - save() call ignored. You must call rerun.init before saving a recording.") return + from rerun.recording_stream import get_application_id + application_id = get_application_id(recording=recording) # NOLINT if application_id is None: raise ValueError( @@ -248,6 +256,8 @@ def stdout(default_blueprint: BlueprintLike | None = None, recording: RecordingS logging.warning("Rerun is disabled - save() call ignored. You must call rerun.init before saving a recording.") return + from rerun.recording_stream import get_application_id + application_id = get_application_id(recording=recording) # NOLINT if application_id is None: raise ValueError( @@ -343,6 +353,7 @@ def serve( warnings.warn( message=("`serve` is deprecated. Use `serve_web` instead."), category=DeprecationWarning, + stacklevel=2, ) return serve_web( @@ -403,6 +414,8 @@ def serve_web( logging.warning("Rerun is disabled - serve() call ignored") return + from rerun.recording_stream import get_application_id + application_id = get_application_id(recording=recording) # NOLINT if application_id is None: raise ValueError( @@ -457,6 +470,9 @@ def send_blueprint( See also: [`rerun.init`][], [`rerun.set_global_data_recording`][]. """ + + from rerun.recording_stream import get_application_id + application_id = get_application_id(recording=recording) # NOLINT if application_id is None: diff --git a/rerun_py/rerun_sdk/rerun/time.py b/rerun_py/rerun_sdk/rerun/time.py index 30d08bbff2dc..abd932921662 100644 --- a/rerun_py/rerun_sdk/rerun/time.py +++ b/rerun_py/rerun_sdk/rerun/time.py @@ -1,18 +1,19 @@ from __future__ import annotations from datetime import datetime, timedelta, timezone -from typing import overload +from typing import TYPE_CHECKING, overload import numpy as np -import rerun_bindings as bindings # type: ignore[attr-defined] +import rerun_bindings as bindings from typing_extensions import deprecated # type: ignore[misc, unused-ignore] -from rerun.recording_stream import RecordingStream +if TYPE_CHECKING: + from rerun.recording_stream import RecordingStream # --- Time --- -# These overloads ensures that mypy can catch errors that would otherwise not be caught until runtime. +# These overloads ensure that mypy can catch errors that would otherwise not be caught until runtime. @overload def set_index(timeline: str, *, recording: RecordingStream | None = None, sequence: int) -> None: ... diff --git a/rerun_py/tests/test_types/components/affix_fuzzer10.py b/rerun_py/tests/test_types/components/affix_fuzzer10.py index 8da5e5425cdb..037a890712b1 100644 --- a/rerun_py/tests/test_types/components/affix_fuzzer10.py +++ b/rerun_py/tests/test_types/components/affix_fuzzer10.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import numpy.typing as npt @@ -51,7 +52,7 @@ class AffixFuzzer10Batch(BaseBatch[AffixFuzzer10ArrayLike], ComponentBatchMixin) @staticmethod def _native_to_pa_array(data: AffixFuzzer10ArrayLike, data_type: pa.DataType) -> pa.Array: if isinstance(data, str): - array: Union[list[str], npt.ArrayLike] = [data] + array: list[str] | npt.ArrayLike = [data] elif isinstance(data, Sequence): array = [str(datum) for datum in data] elif isinstance(data, np.ndarray): diff --git a/rerun_py/tests/test_types/components/affix_fuzzer11.py b/rerun_py/tests/test_types/components/affix_fuzzer11.py index 1c54b134f791..20e40e2ce0b5 100644 --- a/rerun_py/tests/test_types/components/affix_fuzzer11.py +++ b/rerun_py/tests/test_types/components/affix_fuzzer11.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/tests/test_types/components/affix_fuzzer12.py b/rerun_py/tests/test_types/components/affix_fuzzer12.py index 400505f21287..bcad31f6ab63 100644 --- a/rerun_py/tests/test_types/components/affix_fuzzer12.py +++ b/rerun_py/tests/test_types/components/affix_fuzzer12.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/tests/test_types/components/affix_fuzzer13.py b/rerun_py/tests/test_types/components/affix_fuzzer13.py index 6a4cf3d30295..38c4fa63f840 100644 --- a/rerun_py/tests/test_types/components/affix_fuzzer13.py +++ b/rerun_py/tests/test_types/components/affix_fuzzer13.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/tests/test_types/components/affix_fuzzer16.py b/rerun_py/tests/test_types/components/affix_fuzzer16.py index a9897a77e156..176ce1efa220 100644 --- a/rerun_py/tests/test_types/components/affix_fuzzer16.py +++ b/rerun_py/tests/test_types/components/affix_fuzzer16.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/tests/test_types/components/affix_fuzzer17.py b/rerun_py/tests/test_types/components/affix_fuzzer17.py index f8fc9e0d2146..d3a9333d764f 100644 --- a/rerun_py/tests/test_types/components/affix_fuzzer17.py +++ b/rerun_py/tests/test_types/components/affix_fuzzer17.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/tests/test_types/components/affix_fuzzer18.py b/rerun_py/tests/test_types/components/affix_fuzzer18.py index 7fedf7d6d306..9920b57993f0 100644 --- a/rerun_py/tests/test_types/components/affix_fuzzer18.py +++ b/rerun_py/tests/test_types/components/affix_fuzzer18.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/tests/test_types/components/affix_fuzzer7.py b/rerun_py/tests/test_types/components/affix_fuzzer7.py index b88b69ae8d35..fab6bd3ab31d 100644 --- a/rerun_py/tests/test_types/components/affix_fuzzer7.py +++ b/rerun_py/tests/test_types/components/affix_fuzzer7.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/tests/test_types/components/affix_fuzzer8.py b/rerun_py/tests/test_types/components/affix_fuzzer8.py index 0dd8ccfc58f5..e4d75bfe006b 100644 --- a/rerun_py/tests/test_types/components/affix_fuzzer8.py +++ b/rerun_py/tests/test_types/components/affix_fuzzer8.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/tests/test_types/components/affix_fuzzer9.py b/rerun_py/tests/test_types/components/affix_fuzzer9.py index 9f8086730fc3..b890c2551fca 100644 --- a/rerun_py/tests/test_types/components/affix_fuzzer9.py +++ b/rerun_py/tests/test_types/components/affix_fuzzer9.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import numpy.typing as npt @@ -54,7 +55,7 @@ class AffixFuzzer9Batch(BaseBatch[AffixFuzzer9ArrayLike], ComponentBatchMixin): @staticmethod def _native_to_pa_array(data: AffixFuzzer9ArrayLike, data_type: pa.DataType) -> pa.Array: if isinstance(data, str): - array: Union[list[str], npt.ArrayLike] = [data] + array: list[str] | npt.ArrayLike = [data] elif isinstance(data, Sequence): array = [str(datum) for datum in data] elif isinstance(data, np.ndarray): diff --git a/rerun_py/tests/test_types/datatypes/affix_fuzzer1.py b/rerun_py/tests/test_types/datatypes/affix_fuzzer1.py index 139078ed6036..6da2f197519f 100644 --- a/rerun_py/tests/test_types/datatypes/affix_fuzzer1.py +++ b/rerun_py/tests/test_types/datatypes/affix_fuzzer1.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/tests/test_types/datatypes/affix_fuzzer2.py b/rerun_py/tests/test_types/datatypes/affix_fuzzer2.py index bb26cfb9a31f..37a6114b7a4e 100644 --- a/rerun_py/tests/test_types/datatypes/affix_fuzzer2.py +++ b/rerun_py/tests/test_types/datatypes/affix_fuzzer2.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/tests/test_types/datatypes/affix_fuzzer20.py b/rerun_py/tests/test_types/datatypes/affix_fuzzer20.py index 29a6e510e783..18b752bcaa76 100644 --- a/rerun_py/tests/test_types/datatypes/affix_fuzzer20.py +++ b/rerun_py/tests/test_types/datatypes/affix_fuzzer20.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/tests/test_types/datatypes/affix_fuzzer21.py b/rerun_py/tests/test_types/datatypes/affix_fuzzer21.py index 2818853d4846..55c616e34bd3 100644 --- a/rerun_py/tests/test_types/datatypes/affix_fuzzer21.py +++ b/rerun_py/tests/test_types/datatypes/affix_fuzzer21.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/tests/test_types/datatypes/affix_fuzzer22.py b/rerun_py/tests/test_types/datatypes/affix_fuzzer22.py index b9ca6f86e819..a75c3c4abb0c 100644 --- a/rerun_py/tests/test_types/datatypes/affix_fuzzer22.py +++ b/rerun_py/tests/test_types/datatypes/affix_fuzzer22.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/tests/test_types/datatypes/affix_fuzzer3.py b/rerun_py/tests/test_types/datatypes/affix_fuzzer3.py index f6432001311c..b86a2b42c674 100644 --- a/rerun_py/tests/test_types/datatypes/affix_fuzzer3.py +++ b/rerun_py/tests/test_types/datatypes/affix_fuzzer3.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import numpy as np import numpy.typing as npt @@ -24,7 +25,7 @@ class AffixFuzzer3: # You can define your own __init__ function as a member of AffixFuzzer3Ext in affix_fuzzer3_ext.py - inner: Union[None, float, list[datatypes.AffixFuzzer1], npt.NDArray[np.float32]] = field() + inner: None | float | list[datatypes.AffixFuzzer1] | npt.NDArray[np.float32] = field() """ Must be one of: diff --git a/rerun_py/tests/test_types/datatypes/affix_fuzzer4.py b/rerun_py/tests/test_types/datatypes/affix_fuzzer4.py index 1a35350f32cf..ee296dbd223f 100644 --- a/rerun_py/tests/test_types/datatypes/affix_fuzzer4.py +++ b/rerun_py/tests/test_types/datatypes/affix_fuzzer4.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Sequence, Union +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, Union import pyarrow as pa from attrs import define, field @@ -22,7 +23,7 @@ class AffixFuzzer4: # You can define your own __init__ function as a member of AffixFuzzer4Ext in affix_fuzzer4_ext.py - inner: Union[datatypes.AffixFuzzer3, list[datatypes.AffixFuzzer3]] = field() + inner: datatypes.AffixFuzzer3 | list[datatypes.AffixFuzzer3] = field() """ Must be one of: diff --git a/rerun_py/tests/test_types/datatypes/affix_fuzzer5.py b/rerun_py/tests/test_types/datatypes/affix_fuzzer5.py index e2c8965a57b3..bf4f709497f7 100644 --- a/rerun_py/tests/test_types/datatypes/affix_fuzzer5.py +++ b/rerun_py/tests/test_types/datatypes/affix_fuzzer5.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/tests/test_types/datatypes/enum_test.py b/rerun_py/tests/test_types/datatypes/enum_test.py index 27d377303cf8..2585b2f6dd92 100644 --- a/rerun_py/tests/test_types/datatypes/enum_test.py +++ b/rerun_py/tests/test_types/datatypes/enum_test.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa from rerun._baseclasses import ( diff --git a/rerun_py/tests/test_types/datatypes/flattened_scalar.py b/rerun_py/tests/test_types/datatypes/flattened_scalar.py index a477923894e1..d88c72e04c8c 100644 --- a/rerun_py/tests/test_types/datatypes/flattened_scalar.py +++ b/rerun_py/tests/test_types/datatypes/flattened_scalar.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/tests/test_types/datatypes/multi_enum.py b/rerun_py/tests/test_types/datatypes/multi_enum.py index d0f912ca717d..9bdd0ee42334 100644 --- a/rerun_py/tests/test_types/datatypes/multi_enum.py +++ b/rerun_py/tests/test_types/datatypes/multi_enum.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import pyarrow as pa from attrs import define, field diff --git a/rerun_py/tests/test_types/datatypes/primitive_component.py b/rerun_py/tests/test_types/datatypes/primitive_component.py index 6350eabbaa94..705d593ff1c2 100644 --- a/rerun_py/tests/test_types/datatypes/primitive_component.py +++ b/rerun_py/tests/test_types/datatypes/primitive_component.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import numpy.typing as npt diff --git a/rerun_py/tests/test_types/datatypes/string_component.py b/rerun_py/tests/test_types/datatypes/string_component.py index e8b34b13a5ae..df643178ed10 100644 --- a/rerun_py/tests/test_types/datatypes/string_component.py +++ b/rerun_py/tests/test_types/datatypes/string_component.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Any, Sequence, Union +from collections.abc import Sequence +from typing import Any, Union import numpy as np import numpy.typing as npt @@ -48,7 +49,7 @@ class StringComponentBatch(BaseBatch[StringComponentArrayLike]): @staticmethod def _native_to_pa_array(data: StringComponentArrayLike, data_type: pa.DataType) -> pa.Array: if isinstance(data, str): - array: Union[list[str], npt.ArrayLike] = [data] + array: list[str] | npt.ArrayLike = [data] elif isinstance(data, Sequence): array = [str(datum) for datum in data] elif isinstance(data, np.ndarray): diff --git a/rerun_py/tests/test_types/datatypes/valued_enum.py b/rerun_py/tests/test_types/datatypes/valued_enum.py index 70527c9b39be..15db844ae77d 100644 --- a/rerun_py/tests/test_types/datatypes/valued_enum.py +++ b/rerun_py/tests/test_types/datatypes/valued_enum.py @@ -5,7 +5,8 @@ from __future__ import annotations -from typing import Literal, Sequence, Union +from collections.abc import Sequence +from typing import Literal, Union import pyarrow as pa from rerun._baseclasses import ( diff --git a/rerun_py/tests/unit/test_annotation_context.py b/rerun_py/tests/unit/test_annotation_context.py index fbb6f8ad62a9..e07d76b72bd6 100644 --- a/rerun_py/tests/unit/test_annotation_context.py +++ b/rerun_py/tests/unit/test_annotation_context.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Sequence +from collections.abc import Sequence import pytest import rerun as rr diff --git a/rerun_py/tests/unit/test_binary_stream.py b/rerun_py/tests/unit/test_binary_stream.py index f5ed39378a6c..23730f6c7e6e 100644 --- a/rerun_py/tests/unit/test_binary_stream.py +++ b/rerun_py/tests/unit/test_binary_stream.py @@ -8,7 +8,8 @@ import tempfile import threading import time -from typing import Any, Iterator +from collections.abc import Iterator +from typing import Any import rerun as rr import rerun.blueprint as rrb diff --git a/rerun_py/tests/unit/test_container_blueprint.py b/rerun_py/tests/unit/test_container_blueprint.py index 1fe20f1ae48f..4da5404be3de 100644 --- a/rerun_py/tests/unit/test_container_blueprint.py +++ b/rerun_py/tests/unit/test_container_blueprint.py @@ -1,7 +1,8 @@ from __future__ import annotations import itertools -from typing import Any, Optional, Sequence, cast +from collections.abc import Sequence +from typing import Any, Optional, cast from rerun.blueprint.archetypes.container_blueprint import ContainerBlueprint from rerun.blueprint.components.active_tab import ActiveTab, ActiveTabBatch diff --git a/rerun_py/tests/unit/test_geo_line_strings.py b/rerun_py/tests/unit/test_geo_line_strings.py index be2c728fa590..9b66731f195c 100644 --- a/rerun_py/tests/unit/test_geo_line_strings.py +++ b/rerun_py/tests/unit/test_geo_line_strings.py @@ -25,8 +25,8 @@ [], np.array([]), [ - [[0, 0], [2, 1], [4, -1], [6, 0]], # type: ignore[list-item] - [[0, 3], [1, 4], [2, 2], [3, 4], [4, 2], [5, 4], [6, 3]], # type: ignore[list-item] + [[0, 0], [2, 1], [4, -1], [6, 0]], + [[0, 3], [1, 4], [2, 2], [3, 4], [4, 2], [5, 4], [6, 3]], ], [ [DVec2D([0, 0]), (2, 1), [4, -1], (6, 0)], # type: ignore[list-item] diff --git a/rerun_py/tests/unit/test_line_strips2d.py b/rerun_py/tests/unit/test_line_strips2d.py index 1747c0d35551..593163a5d94b 100644 --- a/rerun_py/tests/unit/test_line_strips2d.py +++ b/rerun_py/tests/unit/test_line_strips2d.py @@ -31,8 +31,8 @@ [], np.array([]), [ - [[0, 0], [2, 1], [4, -1], [6, 0]], # type: ignore[list-item] - [[0, 3], [1, 4], [2, 2], [3, 4], [4, 2], [5, 4], [6, 3]], # type: ignore[list-item] + [[0, 0], [2, 1], [4, -1], [6, 0]], + [[0, 3], [1, 4], [2, 2], [3, 4], [4, 2], [5, 4], [6, 3]], ], [ [Vec2D([0, 0]), (2, 1), [4, -1], (6, 0)], # type: ignore[list-item] diff --git a/rerun_py/tests/unit/test_line_strips3d.py b/rerun_py/tests/unit/test_line_strips3d.py index 8e7ab6bd510a..ba8947356399 100644 --- a/rerun_py/tests/unit/test_line_strips3d.py +++ b/rerun_py/tests/unit/test_line_strips3d.py @@ -30,14 +30,14 @@ [], np.array([]), [ - [[0, 0, 2], [1, 0, 2], [1, 1, 2], (0, 1, 2)], # type: ignore[list-item] + [[0, 0, 2], [1, 0, 2], [1, 1, 2], (0, 1, 2)], [[0, 0, 0], [0, 0, 1], [1, 0, 0], (1, 0, 1), - [1, 1, 0], (1, 1, 1), [0, 1, 0], (0, 1, 1)], # type: ignore[list-item] + [1, 1, 0], (1, 1, 1), [0, 1, 0], (0, 1, 1)], ], [ [Vec3D([0, 0, 2]), (1, 0, 2), [1, 1, 2], (0, 1, 2)], # type: ignore[list-item] - [Vec3D([0, 0, 0]), (0, 0, 1), [1, 0, 0], (1, 0, 1), - [1, 1, 0], (1, 1, 1), [0, 1, 0], (0, 1, 1)], # type: ignore[list-item] + [Vec3D([0, 0, 0]), (0, 0, 1), [1, 0, 0], (1, 0, 1), # type: ignore[list-item] + [1, 1, 0], (1, 1, 1), [0, 1, 0], (0, 1, 1)], ], [ np.array([([0, 0, 2]), (1, 0, 2), [1, 1, 2], (0, 1, 2)], dtype=np.float32), diff --git a/rerun_py/tests/unit/test_multiprocessing_gc.py b/rerun_py/tests/unit/test_multiprocessing_gc.py index 7c78eabeccc6..07b6e0652437 100644 --- a/rerun_py/tests/unit/test_multiprocessing_gc.py +++ b/rerun_py/tests/unit/test_multiprocessing_gc.py @@ -10,7 +10,7 @@ try: import torch.multiprocessing as multiprocessing except ImportError: - import multiprocessing # type: ignore[no-redef] + import multiprocessing def task() -> None: @@ -31,4 +31,4 @@ def test_multiprocessing_gc() -> None: if proc.is_alive(): # Terminate so our test doesn't get stuck proc.terminate() - assert False, "Process deadlocked during gc.collect()" + raise AssertionError("Process deadlocked during gc.collect()") diff --git a/rerun_py/tests/unit/test_transform3d.py b/rerun_py/tests/unit/test_transform3d.py index 4afa024102a3..fb04a33e9d27 100644 --- a/rerun_py/tests/unit/test_transform3d.py +++ b/rerun_py/tests/unit/test_transform3d.py @@ -116,7 +116,7 @@ def test_transform3d() -> None: ) arch = rr.Transform3D( translation=translation, - rotation_axis_angle=rotation_axis_angle, # type: ignore[assignment, arg-type] # prior cast didn't work here + rotation_axis_angle=rotation_axis_angle, # type: ignore[arg-type] # prior cast didn't work here quaternion=quaternion, scale=scale, mat3x3=mat3x3, @@ -125,9 +125,7 @@ def test_transform3d() -> None: ) print(f"{arch}\n") - assert arch.scale == rr.components.Scale3DBatch( - none_empty_or_value(scale, rr.components.Scale3D(scale)) # type: ignore[arg-type] - ) + assert arch.scale == rr.components.Scale3DBatch(none_empty_or_value(scale, rr.components.Scale3D(scale))) assert arch.rotation_axis_angle == rr.components.RotationAxisAngleBatch( none_empty_or_value(rotation_axis_angle, rr.components.RotationAxisAngle([1, 2, 3], Angle(deg=10))) ) diff --git a/rerun_py/tests/unit/test_visualizer_overrides.py b/rerun_py/tests/unit/test_visualizer_overrides.py index 09c0533fee6c..4e56139eee2a 100644 --- a/rerun_py/tests/unit/test_visualizer_overrides.py +++ b/rerun_py/tests/unit/test_visualizer_overrides.py @@ -26,6 +26,6 @@ def visualizer_overrides_expected(obj: Any) -> rrbc.VisualizerOverridesBatch: def test_view_coordinates() -> None: for input in VISUALIZER_OVERRIDES_INPUT: - batch = rrbc.VisualizerOverridesBatch(input) # type: ignore[arg-type] + batch = rrbc.VisualizerOverridesBatch(input) assert batch.as_arrow_array() == visualizer_overrides_expected(batch).as_arrow_array() diff --git a/scripts/check_example_manifest_coverage.py b/scripts/check_example_manifest_coverage.py index a0ed0b40825b..4f4923809986 100755 --- a/scripts/check_example_manifest_coverage.py +++ b/scripts/check_example_manifest_coverage.py @@ -4,8 +4,8 @@ from __future__ import annotations +from collections.abc import Iterable from pathlib import Path -from typing import Iterable import tomli diff --git a/scripts/ci/crates.py b/scripts/ci/crates.py index 9ec377c04eba..845de88df67c 100755 --- a/scripts/ci/crates.py +++ b/scripts/ci/crates.py @@ -25,12 +25,13 @@ import subprocess import sys import time +from collections.abc import Generator from datetime import datetime, timezone from enum import Enum from glob import glob from multiprocessing import cpu_count from pathlib import Path -from typing import Any, Generator +from typing import Any import git import requests @@ -54,10 +55,13 @@ def cargo( *, cargo_version: str | None = None, cwd: str | Path | None = None, - env: dict[str, Any] = {}, + env: dict[str, Any] | None = None, dry_run: bool = False, capture: bool = False, ) -> Any: + if env is None: + env = {} + if cargo_version is None: cmd = [CARGO_PATH] + args.split() else: @@ -367,7 +371,7 @@ def bump_version(dry_run: bool, bump: Bump | str | None, pre_id: str, dev: bool) if not dry_run: with Path("Cargo.toml").open("w", encoding="utf-8") as f: tomlkit.dump(root, f) - for name, crate in crates.items(): + for crate in crates.values(): with Path(f"{crate.path}/Cargo.toml").open("w", encoding="utf-8") as f: tomlkit.dump(crate.manifest, f) cargo("update --workspace", dry_run=dry_run) @@ -544,12 +548,7 @@ def __str__(self) -> str: def get_release_version_from_git_branch() -> str: - # TODO(ab): change this to s.removeprefix("release-") when we move to Python 3.9 - s = git.Repo().active_branch.name - if s.startswith("release-"): - s = s[len("release-") :] - - return s + return git.Repo().active_branch.name.removeprefix("release-") def get_version(target: Target | None, skip_prerelease: bool = False) -> VersionInfo: diff --git a/scripts/ci/dag.py b/scripts/ci/dag.py index 553b8458516c..8460fc219b8c 100644 --- a/scripts/ci/dag.py +++ b/scripts/ci/dag.py @@ -1,12 +1,13 @@ from __future__ import annotations import time +from collections.abc import Hashable from concurrent.futures import ThreadPoolExecutor from math import floor from multiprocessing import Event, cpu_count from multiprocessing.synchronize import Event as EventClass from queue import Empty, Queue -from typing import Callable, Generic, Hashable, TypeVar +from typing import Callable, Generic, TypeVar class RateLimiter: diff --git a/scripts/ci/frontmatter.py b/scripts/ci/frontmatter.py index 8ec11462babc..bae9c896e602 100644 --- a/scripts/ci/frontmatter.py +++ b/scripts/ci/frontmatter.py @@ -1,10 +1,10 @@ from __future__ import annotations -from typing import Any, Dict +from typing import Any import tomlkit -Frontmatter = Dict[str, Any] +Frontmatter = dict[str, Any] def load_frontmatter(s: str) -> dict[str, Any] | None: diff --git a/scripts/ci/publish_wheels.py b/scripts/ci/publish_wheels.py index b84b19be565e..e97f55a742ff 100755 --- a/scripts/ci/publish_wheels.py +++ b/scripts/ci/publish_wheels.py @@ -78,7 +78,7 @@ def main() -> None: os.mkdir("wheels") with ThreadPoolExecutor() as e: for blob in wheel_blobs: - e.submit(lambda: blob.download_to_filename(f"wheels/{blob.name.split('/')[-1]}")) + e.submit(lambda blob: blob.download_to_filename(f"wheels/{blob.name.split('/')[-1]}"), blob) check_version(canonicalize_version(args.version)) diff --git a/scripts/ci/python_check_signatures.py b/scripts/ci/python_check_signatures.py index 46bc1b6a0771..271844843cee 100644 --- a/scripts/ci/python_check_signatures.py +++ b/scripts/ci/python_check_signatures.py @@ -108,7 +108,7 @@ def parse_function_signature(node: Any) -> APIDef: if child.type == "suite": first_child = child.children[1] if first_child.type == "simple_stmt" and first_child.children[0].type == "string": - doc = first_child.children[0].value.strip('"""') + doc = first_child.children[0].value.replace('"""', "") sig = Signature(parameters=params) return APIDef(node.name.value, sig, doc) @@ -137,7 +137,7 @@ def load_stub_signatures(pyi_file: Path) -> TotalSignature: if child.type == "suite": first_child = child.children[1] if first_child.type == "simple_stmt" and first_child.children[0].type == "string": - doc = first_child.children[0].value.strip('"""') + doc = first_child.children[0].value.replace('"""', "") if doc is not None: class_def["__doc__"] = doc diff --git a/scripts/ci/render_bench.py b/scripts/ci/render_bench.py index f00fe9bab578..d120484e0aaf 100755 --- a/scripts/ci/render_bench.py +++ b/scripts/ci/render_bench.py @@ -28,12 +28,13 @@ import os import re import textwrap +from collections.abc import Generator from dataclasses import dataclass from datetime import datetime, timedelta, timezone from enum import Enum from pathlib import Path from subprocess import run -from typing import Callable, Dict, Generator, List +from typing import Callable from google.cloud import storage @@ -99,7 +100,7 @@ def duplicate(self, date: datetime) -> BenchmarkEntry: ) -Benchmarks = Dict[str, List[BenchmarkEntry]] +Benchmarks = dict[str, list[BenchmarkEntry]] FORMAT_BENCHER_RE = re.compile(r"test\s+(\S+).*bench:\s+(\d+)\s+ns\/iter") @@ -125,7 +126,7 @@ def parse_sizes_json(data: str) -> list[Measurement]: ] -Blobs = Dict[str, storage.Blob] +Blobs = dict[str, storage.Blob] def fetch_blobs(gcs: storage.Client, bucket: str, path_prefix: str) -> Blobs: @@ -297,7 +298,7 @@ def date_type(v: str) -> datetime: try: return datetime.strptime(v, DATE_FORMAT) except ValueError: - raise argparse.ArgumentTypeError(f"Date must be in {DATE_FORMAT} format") + raise argparse.ArgumentTypeError(f"Date must be in {DATE_FORMAT} format") from None class Output(Enum): @@ -322,12 +323,12 @@ class GcsPath: def parse_gcs_path(path: str) -> GcsPath: if not path.startswith("gs://"): raise ValueError(f"invalid gcs path: {path}") - path = path.lstrip("gs://") + path = path.removeprefix("gs://") try: bucket, blob = path.split("/", 1) return GcsPath(bucket, blob.rstrip("/")) except ValueError: - raise ValueError(f"invalid gcs path: {path}") + raise ValueError(f"invalid gcs path: {path}") from None def main() -> None: diff --git a/scripts/ci/sync_release_assets.py b/scripts/ci/sync_release_assets.py index 3513884fcfea..794c2a6f478c 100644 --- a/scripts/ci/sync_release_assets.py +++ b/scripts/ci/sync_release_assets.py @@ -15,14 +15,14 @@ import argparse import time -from typing import Dict, cast +from typing import cast from github import Github from github.GitRelease import GitRelease from github.Repository import Repository from google.cloud import storage -Assets = Dict[str, storage.Blob] +Assets = dict[str, storage.Blob] def get_any_release(repo: Repository, tag_name: str) -> GitRelease | None: diff --git a/scripts/ci/thumbnails.py b/scripts/ci/thumbnails.py index 13bcb9aaf41d..e1631ddc318f 100755 --- a/scripts/ci/thumbnails.py +++ b/scripts/ci/thumbnails.py @@ -5,16 +5,17 @@ from __future__ import annotations import argparse +from collections.abc import Generator from concurrent.futures import ThreadPoolExecutor from io import BytesIO from pathlib import Path -from typing import Any, Dict, Generator +from typing import Any import requests from frontmatter import load_frontmatter from PIL import Image -Frontmatter = Dict[str, Any] +Frontmatter = dict[str, Any] class Example: diff --git a/scripts/generate_view_coordinate_defs.py b/scripts/generate_view_coordinate_defs.py index 078afa788bea..60a9a9050b68 100755 --- a/scripts/generate_view_coordinate_defs.py +++ b/scripts/generate_view_coordinate_defs.py @@ -11,8 +11,8 @@ import argparse import itertools import os +from collections.abc import Iterable from dataclasses import dataclass -from typing import Iterable BEGIN_MARKER = "" END_MARKER = "" diff --git a/scripts/lint.py b/scripts/lint.py index 67c9cbd6e69e..9b1bf2546af8 100755 --- a/scripts/lint.py +++ b/scripts/lint.py @@ -14,7 +14,7 @@ import re import sys from pathlib import Path -from typing import Any, Callable, Dict +from typing import Any, Callable from ci.frontmatter import load_frontmatter from gitignore_parser import parse_gitignore @@ -39,7 +39,7 @@ double_the = re.compile(r"\bthe the\b") double_word = re.compile(r" ([a-z]+) \1[ \.]") -Frontmatter = Dict[str, Any] +Frontmatter = dict[str, Any] def is_valid_todo_part(part: str) -> bool: @@ -806,7 +806,7 @@ def is_acronym_or_pascal_case(s: str) -> bool: words = s.strip().split(" ") - for i, word in enumerate(words): + for word in words: if word == "": continue @@ -857,7 +857,7 @@ def fix_enforced_upper_case(s: str) -> str: new_words: list[str] = [] inline_code_block = False - for i, word in enumerate(split_words(s)): + for word in split_words(s): if word.startswith("`"): inline_code_block = True if word.endswith("`"): diff --git a/scripts/screenshot_compare/build_screenshot_compare.py b/scripts/screenshot_compare/build_screenshot_compare.py index 481a8d59f629..4ecd4a82cfcd 100755 --- a/scripts/screenshot_compare/build_screenshot_compare.py +++ b/scripts/screenshot_compare/build_screenshot_compare.py @@ -24,11 +24,12 @@ import shutil import subprocess import threading +from collections.abc import Iterable from dataclasses import dataclass from functools import partial from io import BytesIO from pathlib import Path -from typing import Any, Iterable +from typing import Any import requests from jinja2 import Template diff --git a/scripts/snapshots.py b/scripts/snapshots.py index 556454ccd03a..81b13ccdb579 100644 --- a/scripts/snapshots.py +++ b/scripts/snapshots.py @@ -10,9 +10,9 @@ from __future__ import annotations import argparse +from collections.abc import Iterator from pathlib import Path from sys import stderr -from typing import Iterator import numpy as np import PIL.Image as Image diff --git a/tests/python/chunk_zoo/chunk_zoo.py b/tests/python/chunk_zoo/chunk_zoo.py index 6e1404aab474..5ffd6726e62f 100644 --- a/tests/python/chunk_zoo/chunk_zoo.py +++ b/tests/python/chunk_zoo/chunk_zoo.py @@ -9,7 +9,7 @@ from __future__ import annotations import argparse -from typing import Sequence +from collections.abc import Sequence import numpy as np import rerun as rr diff --git a/tests/python/gc_stress/many_large_many_rows_recordings.py b/tests/python/gc_stress/many_large_many_rows_recordings.py index 00a1ee5ecfa7..8509fd7da09f 100644 --- a/tests/python/gc_stress/many_large_many_rows_recordings.py +++ b/tests/python/gc_stress/many_large_many_rows_recordings.py @@ -20,7 +20,7 @@ for i in range(0, 20000000): rr.init("rerun_example_recording_gc", recording_id=f"image-rec-{i}", spawn=True) - for j in range(0, 10000): + for _j in range(0, 10000): positions = rng.uniform(-5, 5, size=[10000000, 3]) colors = rng.uniform(0, 255, size=[10000000, 3]) radii = rng.uniform(0, 1, size=[10000000]) diff --git a/tests/python/memory_drain/main.py b/tests/python/memory_drain/main.py index 2d4d6c8b3126..26259376a135 100644 --- a/tests/python/memory_drain/main.py +++ b/tests/python/memory_drain/main.py @@ -12,7 +12,8 @@ import queue import threading import time -from typing import Any, Iterator +from collections.abc import Iterator +from typing import Any import rerun as rr import rerun.blueprint as rrb diff --git a/tests/roundtrips.py b/tests/roundtrips.py index 4c493a90d669..1dd30dc62b52 100755 --- a/tests/roundtrips.py +++ b/tests/roundtrips.py @@ -159,7 +159,7 @@ def run_roundtrips(arch: str, language: str, args: argparse.Namespace) -> None: elif language == "rust": run_roundtrip_rust(arch, args.release, args.target, args.target_dir) else: - assert False, f"Unknown language: {language}" + raise AssertionError(f"Unknown language: {language}") def run_roundtrip_python(arch: str) -> str: