Epic: Package the PyAnsys settings framework #4524
seanpearsonuk
started this conversation in
General
Replies: 1 comment
-
|
Hello @seanpearsonuk! If this issue needs to remain open, please comment below with If you want this repository to be excluded from this automated maintenance process, please let us know by filling in the opt-out request form. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The client-side settings framework used in PyFluent supports PyFluent's interaction with Fluent settings through the settings API and its hierarchy of settings objects. The framework is sufficiently generic in concept that it can be repurposed to facilitate rapid construction of client libraries for a variety of products and services.
The anticipated benefits of commoditizing the settings framework include rapid client library development even in inexperienced teams, higher quality due to a single, centralized maintenance operation, and - above all - a uniformity across (some of) the PyAnsys developer experience.
The success of this project will be boosted by the efforts of early adopters that will help to shape the solution and also prove the concept. Those intended earliest adopters will be:
The PyCFX and PyFluent teams are already working closely together.
In its broadest definition, the settings framework currently consists of the following components:
SettingsgRPC interfaceSettingsServiceclass, which is a proxy to the gRPC stubSettingsServicethrough a purely abstract dependencyIn order to ease the transition from a Fluent solver solution to a fully flexible framework, the following steps are anticipated:
Settingsservice shall be minimal and complete, the changes for which have already been achieved in Fluent 2024R2 development. This is the minimal service:service Settings {
/* Static info about objects (type, children, commands, arguments,
object-type) in a recursive manner. */
rpc GetStaticInfo(GetStaticInfoRequest) returns (GetStaticInfoResponse);
/* Get the value of a path */
rpc GetVar(GetVarRequest) returns (GetVarResponse);
/* Set the value of a path */
rpc SetVar(SetVarRequest) returns (SetVarResponse);
/* Create a new object */
rpc Create(CreateRequest) returns (CreateResponse);
/* Execute a command */
rpc ExecuteCommand(ExecuteCommandRequest) returns (ExecuteCommandResponse);
/* Execute a query */
rpc ExecuteQuery(ExecuteQueryRequest) returns (ExecuteQueryResponse);
/* Attribute access */
rpc GetAttrs(GetAttrsRequest) returns (GetAttrsResponse);
}
The transition was achieved simply by implementing higher level methods (e.g.,
Rename) in terms of lower level ones. The new, minimal interface is anticipated to reduce barriers to implementing settings-API-compliant server code due to having fewer explicit gRPC methods to implement, and means that the service supports clients more flexibly.Python gRPC interface package: no changes anticipated.
The
SettingsServiceclass. This currently has some dependencies of concern:has_wildcardmethod does not really belong in this service. Instead it could be a standard extension in flobject.py.a. For instance, it should not contain any hard-coded Fluent names. We have already taken a step towards separating out Fluent names by defining them as constants within an flobject class:
Next, we shall move that class to a separate module, and each framework user shall define its own labels.
b. It shall not instantiate a PyFluent logger
c. We have methods
to_scheme_keysandto_python_keys. We shall name the former to be more general. Are these methods actually transforming anything?d. Eliminate all incidental mentions of Fluent and just use more general naming/wording
Mixins. Should already be generic
Codegen. At the end of the
settingsgen.py, we have this partly Fluent-solver-specific sequencesinfo is the abstract static info. We can add flexibility to this code by allowing applications to provide their own launch functions, but applications should also simply be able to provide their own static info provider. Then, static info could be allowed to static-schema-based, for instance.
EDIT (21/03/2024): As part of this epic, we can incorporate @h-krishnan's new infrastructure to populate autogenerated classes with static attributes. CC: @mkundu1
N.b. I want to use task lists here but I'm excluded (https://docs.github.com/en/issues/managing-your-tasks-with-tasklists/creating-a-tasklist)
Beta Was this translation helpful? Give feedback.
All reactions