refactor(): Replace SelectorFactory mixin with dedicated Selector classes#1661
Merged
benflexcompute merged 3 commits intomainfrom Dec 17, 2025
Merged
refactor(): Replace SelectorFactory mixin with dedicated Selector classes#1661benflexcompute merged 3 commits intomainfrom
benflexcompute merged 3 commits intomainfrom
Conversation
…sses Unified the entity selector API by replacing the SelectorFactory mixin pattern on entity classes (Surface, Edge, GenericVolume, GeometryBodyGroup) with dedicated Selector classes (SurfaceSelector, EdgeSelector, VolumeSelector, BodyGroupSelector). Key changes: - Removed SelectorFactory mixin inheritance from entity classes - Created four new Selector classes that inherit from EntitySelector - Each class has target_class locked as a frozen field (type-safe) - Exported selector factories to fl namespace (fl.SurfaceSelector, etc.) - Hid syntax parameter from fluent API (UI doesn't support regex) - Updated docstrings to clarify "pattern-based selector" concept Benefits: - Clearer separation between entity access (draft.surfaces[...]) and selector definition (fl.SurfaceSelector(...)) - Better type safety with frozen target_class field - More discoverable API without exposing entity classes - Prevents accidental entity construction - Enables reusable SimulationParams templates across geometries This change maintains backward compatibility at the selector behavior level while improving the API ergonomics and design clarity. All tests updated and passing: - test_entity_selector_fluent_api: 6 tests - test_entity_expansion_impl: 3 tests - test_entity_list: 5 tests - test_validators_params: 2 tests - test_entity_processing_service: 7 tests - test_selector_expansion_validators: 4 tests - test_draft_context_end_to_end_submit_roundtrip: 1 test - test_solver_translator: 8 tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
…
Unified the entity selector API by replacing the SelectorFactory mixin pattern on entity classes (Surface, Edge, GenericVolume, GeometryBodyGroup) with dedicated Selector classes (SurfaceSelector, EdgeSelector, VolumeSelector, BodyGroupSelector).
Key changes:
Benefits:
This change maintains backward compatibility at the selector behavior level while improving the API ergonomics and design clarity.
All tests updated and passing: