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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

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.

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