From fc8e2385ea09876796d87f2ce8a7db8934254715 Mon Sep 17 00:00:00 2001 From: Brendan Collins Date: Wed, 28 Jan 2026 20:50:45 -0800 Subject: [PATCH 1/2] fixed issues with cmake and numba in conda package and successfully built on linux --- conda-recipe/meta.yaml | 5 +++-- rtxpy/rtx.py | 12 ++++++++++++ rtxpy/tests/test_simple.py | 30 ++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 026dccc..0b3a107 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -1,5 +1,5 @@ {% set name = "rtxpy" %} -{% set version = "0.0.4" %} +{% set version = "0.0.5" %} package: name: {{ name|lower }} @@ -20,7 +20,7 @@ requirements: build: - {{ compiler('c') }} - {{ compiler('cxx') }} - - cmake + - conda-forge::cmake - git - cuda-nvcc - cuda-cudart-dev @@ -39,6 +39,7 @@ requirements: - python >=3.10 - numpy >=1.21,<3 # [py<313] - numpy >=2.0,<3 # [py>=313] + - numba >=0.56 - cupy >=12.0 - cuda-version >=12 - __cuda # [linux] diff --git a/rtxpy/rtx.py b/rtxpy/rtx.py index 73978ea..e54db5a 100644 --- a/rtxpy/rtx.py +++ b/rtxpy/rtx.py @@ -1093,6 +1093,18 @@ def get_geometry_count(self) -> int: """ return len(_state.gas_entries) + def has_geometry(self, geometry_id: str) -> bool: + """ + Check if a geometry with the given ID exists. + + Args: + geometry_id: The ID of the geometry to check. + + Returns: + True if the geometry exists, False otherwise. + """ + return geometry_id in _state.gas_entries + def clear_scene(self) -> None: """ Remove all geometries and reset to single-GAS mode. diff --git a/rtxpy/tests/test_simple.py b/rtxpy/tests/test_simple.py index 42b4ff0..f5c10a6 100644 --- a/rtxpy/tests/test_simple.py +++ b/rtxpy/tests/test_simple.py @@ -927,3 +927,33 @@ def test_cupy_buffers_multi_gas(test_cupy): hits_np = hits np.testing.assert_almost_equal(hits_np[0], 10.0, decimal=1) + + +@pytest.mark.parametrize("test_cupy", [False, True]) +def test_has_geometry(test_cupy): + """Test has_geometry() query method.""" + if test_cupy: + if not has_cupy: + pytest.skip("cupy not available") + import cupy + backend = cupy + else: + backend = np + + rtx = RTX() + rtx.clear_scene() + + # Should not exist initially + assert rtx.has_geometry("test_geo") == False + + # Add geometry + verts = backend.float32([0, 0, 0, 1, 0, 0, 0.5, 1, 0]) + tris = backend.int32([0, 1, 2]) + rtx.add_geometry("test_geo", verts, tris) + + # Should exist now + assert rtx.has_geometry("test_geo") == True + + # Remove and check again + rtx.remove_geometry("test_geo") + assert rtx.has_geometry("test_geo") == False From 0bbc7388f9f483e0c2bde661a2b7596d8589ada0 Mon Sep 17 00:00:00 2001 From: Brendan Collins Date: Wed, 28 Jan 2026 20:53:21 -0800 Subject: [PATCH 2/2] small updates to windows version --- conda-recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 0b3a107..c45d2ba 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -21,7 +21,7 @@ requirements: - {{ compiler('c') }} - {{ compiler('cxx') }} - conda-forge::cmake - - git + - conda-forge::git - cuda-nvcc - cuda-cudart-dev - cuda-nvrtc-dev