chore: Remove get_specs.#5102
Conversation
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull request overview
This PR removes the get_specs RPC and related “generic” datamodel access patterns from PyFluent, moving the codebase toward a model where generated (codegen) datamodel APIs are required.
Changes:
- Removed
get_specsfrom the SE datamodel service wrappers and eliminatedPyMenuGeneric/PyNamedObjectContainerGeneric. - Updated workflow/meshing code to type against
PyMenurather than the removed generic menu types. - Removed tests that depended on the generic datamodel wrappers and added a minimal changelog entry.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_error_handling.py | Removes assertions that exercised get_specs error handling. |
| tests/test_datamodel_service.py | Removes tests that relied on PyMenuGeneric/generic navigation. |
| src/ansys/fluent/core/workflow.py | Updates workflow wrapper typing from PyMenuGeneric to PyMenu. |
| src/ansys/fluent/core/session_solver_aero.py | Switches Aero’s flserver root to PySimpleMenuGeneric. |
| src/ansys/fluent/core/session_shared.py | Removes generic fallback for missing generated datamodel modules; now raises a runtime error. |
| src/ansys/fluent/core/services/datamodel_se_v1.py | Removes get_specs and stops exporting removed generic wrapper types. |
| src/ansys/fluent/core/services/datamodel_se.py | Removes get_specs plumbing and deletes PyMenuGeneric/PyNamedObjectContainerGeneric. |
| src/ansys/fluent/core/meshing/meshing_workflow_new.py | Updates typing from PyMenuGeneric to PyMenu. |
| src/ansys/fluent/core/meshing/meshing_workflow.py | Updates typing from PyMenuGeneric to PyMenu. |
| pyproject.toml | Removes getSpecs from the non-capitalized identifier allowlist. |
| doc/changelog.d/5102.maintenance.md | Adds a changelog entry for the removal. |
| devel/undocumented_fields/undocumented_fields.txt | Removes PyMenuGeneric from undocumented fields list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
There is a CI and a pytest marker for tests running in no-codegen mode. Feel free to clean those up in stages. |
yes @mkundu1, will do it as part of clean up as well. Thanks |
There was a problem hiding this comment.
Pull request overview
Removes the legacy getSpecs/get_specs-based generic datamodel access path (and related generic wrappers) and shifts PyFluent to require codegen-generated datamodel API modules to be present at runtime.
Changes:
- Remove
get_specsRPC wrappers and deletePyMenuGeneric/PyNamedObjectContainerGeneric. - Replace several type hints/imports from
PyMenuGenerictoPyMenu(orPySimpleMenuGenericwhere still needed). - Remove tests that depended on the generic datamodel wrappers and update configuration/changelog references.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_error_handling.py | Removes get_specs-related error handling assertions and unused import. |
| tests/test_datamodel_service.py | Removes tests that explicitly exercised PyMenuGeneric-based access. |
| src/ansys/fluent/core/workflow.py | Updates workflow wrapper type hints from PyMenuGeneric to PyMenu. |
| src/ansys/fluent/core/session_solver_aero.py | Switches _flserver root to PySimpleMenuGeneric. |
| src/ansys/fluent/core/session_shared.py | Removes generic datamodel fallback; now raises RuntimeError if generated API is missing. |
| src/ansys/fluent/core/services/datamodel_se_v1.py | Removes get_specs implementation and generic wrapper exports. |
| src/ansys/fluent/core/services/datamodel_se.py | Removes get_specs, generic wrappers, and related helper logic/imports. |
| src/ansys/fluent/core/meshing/meshing_workflow_new.py | Updates type hints/imports to use PyMenu instead of PyMenuGeneric. |
| src/ansys/fluent/core/meshing/meshing_workflow.py | Updates type hints/imports to use PyMenu instead of PyMenuGeneric. |
| pyproject.toml | Removes getSpecs from the “non-cap” allowlist. |
| doc/changelog.d/5102.maintenance.md | Adds a changelog note about removing get_specs. |
| devel/undocumented_fields/undocumented_fields.txt | Removes undocumented-field listing for PyMenuGeneric.attrs. |
Comments suppressed due to low confidence (1)
src/ansys/fluent/core/services/datamodel_se.py:2139
PySimpleMenuGeneric's docstring still refers to the removedPyMenuGenericclass and to avoidingservice.get_specs, butPyMenuGeneric/get_specsare no longer part of the API in this PR. Update the docstring to describe the current intent/constraints (e.g., a permissive singleton-only menu wrapper without relying on generated API).
class PySimpleMenuGeneric(PyMenu, PyDictionary):
"""A simple implementation of PyMenuGeneric applicable only for SINGLETONS.
This is required for the stand-alone datamodel server to avoid the usage of
'service.get_specs'
"""
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Context
Remove 'getSpecs' Completely from PyFluent. This is done with the assumption that PyFluent compulsorily works with codegen run first.
One issue: Some parts of aero needs to be refactored later.
Change Summary
PyMenuGeneric and PyNamedObjectContainerGeneric-> removed
Tests using them removed as well.
Impact
None of the user facing documented interfaces should be affected.
Please note: Now it will raise RuntimeError during session creation if the codegen has not been run earlier, i.e. if the generated files are missing.