Skip to content

feat: Set string settings with allowed values via string constants #4190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 8, 2025

Conversation

mkundu1
Copy link
Contributor

@mkundu1 mkundu1 commented Jun 18, 2025

The enumerated values are exposed as constant attributes of the instance. Please see the unittest for usage.

There is already an attribute allowed-values-with-display-text in settings API to fetch all possible allowed values which has been added to the static-info (Fluent PR 599447).

Below is the fragment of generated class:

class model_2(String, AllowedValuesMixin):
    """
    Viscous Model.
    """
    _version = '261'
    fluent_name = 'model'
    _python_name = 'model'
    LAMINAR = _FlConstant('laminar')
    MIXING_LENGTH = _FlConstant('mixing-length')
    KE1E = _FlConstant('ke1e')
    INVISCID = _FlConstant('inviscid')
...

TODO: doc update

@mkundu1 mkundu1 linked an issue Jun 18, 2025 that may be closed by this pull request
@github-actions github-actions bot added the new feature Request or proposal for a new feature label Jun 18, 2025
@prmukherj
Copy link
Collaborator

@mkundu1, existing tests suggest that something has gone wrong.

@mkundu1
Copy link
Contributor Author

mkundu1 commented Jun 19, 2025

Validation against all possible allowed values during set_state is now possible in the client side, will add it.

@hpohekar
Copy link
Collaborator

Validation against all possible allowed values during set_state is now possible in the client side, will add it.

That's great! Thank you.

@mkundu1 mkundu1 force-pushed the feat/string-constants branch from b79d1b3 to 58bf0e1 Compare July 2, 2025 13:21
@mkundu1 mkundu1 force-pushed the feat/string-constants branch from 58bf0e1 to 18ca6e0 Compare July 2, 2025 19:10
@mkundu1 mkundu1 merged commit 3285f66 into main Jul 8, 2025
106 of 109 checks passed
@mkundu1 mkundu1 deleted the feat/string-constants branch July 8, 2025 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Request or proposal for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose enums attribute for discoverability and error prevention
5 participants