Skip to content

refactor(flow360): entity system — client files become re-import relays#1945

Merged
benflexcompute merged 10 commits intoBenY/CentralizedSchemafrom
BenY/EntityMigration
Mar 31, 2026
Merged

refactor(flow360): entity system — client files become re-import relays#1945
benflexcompute merged 10 commits intoBenY/CentralizedSchemafrom
BenY/EntityMigration

Conversation

@benflexcompute
Copy link
Copy Markdown
Collaborator

@benflexcompute benflexcompute commented Mar 31, 2026

Summary

  • Client entity modules become thin re-import relays from flow360_schema
  • 16 files converted: entity_info, entity_operation, entity_base, entity_selector, entity_registry, entity_materializer, entity_utils, entity_expansion_utils, multi_constructor_model_base, unique_list, primitives, output_entities, utils, types, exceptions
  • Fix _get_draft_entity_type_names to handle types.UnionType (Python 3.10+ X | Y syntax)
  • Fix LengthType import in geometry.py — use new Length.PositiveFloat64 from schema

Depends on: flexcompute/flex entity migration PR (schema side)

Test plan

  • pytest tests/simulation — 1074 passed
  • pylint clean on all relay files (10/10)

🤖 Generated with Claude Code


Note

Medium Risk
Medium risk due to broad refactor across core simulation/entity plumbing and materialization/selector code paths, even though behavior is intended to be preserved via re-exports. Main risk is subtle import/typing/serialization regressions when validating or expanding entities from params dicts.

Overview
Refactors the SDK’s simulation/entity framework to delegate implementations to flow360_schema. Several core modules (entity_info, entity_operation, entity_base, entity_registry, entity_selector, entity_utils, unique_list, output_entities, plus materialization/context helpers) are replaced with thin re-export relays to keep existing import paths working.

Updates internal mutation patterns by removing model_attribute_unlock usage and switching to _force_set_attr when updating frozen/private fields (e.g., entity renames, asset-cache setup, boundary full-name assignment, imported surface caching). Also simplifies entity materialization by wrapping the schema’s materialize_entities_and_selectors_in_place while retaining the client-specific entity type map/builder.

Written by Cursor Bugbot for commit f275a42. This will update automatically on new commits. Configure here.

Client entity modules now re-export from flow360_schema:
- entity_info, entity_operation, entity_base, entity_selector
- entity_registry, entity_materializer, entity_utils, entity_expansion_utils
- multi_constructor_model_base, unique_list
- primitives, output_entities, utils (model_attribute_unlock, BoundingBoxType)
- types (Axis, Vector), exceptions (Flow360ValueError, Flow360DeprecationError)

All 159 importing files continue to work via relay. Relay removal
will be done in a separate PR after all migrations complete.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8775dcf8bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@github-actions
Copy link
Copy Markdown
Contributor

Coverage report (flow360)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  flow360
  exceptions.py
  flow360/component
  geometry.py
  project_utils.py 320
  types.py
  flow360/component/simulation
  entity_info.py
  entity_operation.py
  primitives.py
  services.py
  simulation_params.py
  utils.py 60
  flow360/component/simulation/framework
  boundary_split.py
  entity_base.py
  entity_expansion_utils.py
  entity_materialization_context.py 4
  entity_materializer.py
  entity_registry.py
  entity_selector.py
  entity_utils.py
  multi_constructor_model_base.py
  param_utils.py
  unique_list.py
  flow360/component/simulation/outputs
  output_entities.py
Project Total  

This report was generated by python-coverage-comment-action

@benflexcompute benflexcompute merged commit f60f935 into BenY/CentralizedSchema Mar 31, 2026
18 checks passed
@benflexcompute benflexcompute deleted the BenY/EntityMigration branch March 31, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants