fix(geometry): remove validators on the number of geometries in ClipOperation #2986
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Let's remove this validator as we have speed up preprocessing.
Greptile Overview
Greptile Summary
Removed validation limiting geometry count in
ClipOperationstructures to improve performance after preprocessing optimizations.Key Changes:
_validate_num_geometriesvalidator inSceneclassMAX_GEOMETRY_COUNTconstant (5000 limit)ClipOperation,GeometryGroup,flatten_groups, andtraverse_geometriesthat are no longer neededCritical Issues:
MAX_GEOMETRY_COUNTis still imported by test files (tests/test_components/test_scene.py:12 and tests/test_components/test_simulation.py:16), causing import errors since it's now commented outtest_max_geometry_validationin both test files will fail when trying to reference the commented constantConfidence Score: 1/5
MAX_GEOMETRY_COUNTis commented out but still imported by two test files. This will cause immediate import failures when tests run. The tests need to be updated to either remove the import or the constant should remain defined (though unused) for backward compatibility.MAX_GEOMETRY_COUNTis commented out, breaking test importsImportant Files Changed
File Analysis
MAX_GEOMETRY_COUNT; removed now-unused importsSequence Diagram
sequenceDiagram participant User participant Scene participant Validator participant Tests Note over User,Tests: Before PR (Current Behavior) User->>Scene: Create Scene with structures Scene->>Validator: _validate_num_geometries() Validator->>Validator: Count geometries in ClipOperation alt Geometry count > MAX_GEOMETRY_COUNT Validator-->>Scene: Raise SetupError Scene-->>User: Validation failed else Geometry count <= MAX_GEOMETRY_COUNT Validator-->>Scene: Validation passed Scene-->>User: Scene created successfully end Tests->>Scene: Import MAX_GEOMETRY_COUNT Scene-->>Tests: Return constant value (5000) Note over User,Tests: After PR (New Behavior) User->>Scene: Create Scene with structures Note over Validator: _validate_num_geometries() commented out Scene-->>User: Scene created (no validation) Tests->>Scene: Import MAX_GEOMETRY_COUNT Note over Scene: MAX_GEOMETRY_COUNT commented out Scene--xTests: ImportError/AttributeError