Test that vector of enums works as input#1904
Open
sebproell wants to merge 1 commit into4C-multiphysics:mainfrom
Open
Test that vector of enums works as input#1904sebproell wants to merge 1 commit into4C-multiphysics:mainfrom
sebproell wants to merge 1 commit into4C-multiphysics:mainfrom
Conversation
c-p-schmidt
approved these changes
Mar 28, 2026
ppraegla
reviewed
Mar 28, 2026
Member
ppraegla
left a comment
There was a problem hiding this comment.
Nice that this works. But when I try it in the code, I get the following error. So, maybe the schema generation needs to be adapted for this case
[build] File "/home/user/4C/build/release/python_venv_build_test/bin/create-schema-files", line 8, in <module>
[build] sys.exit(cli())
[build] ^^^^^
[build] File "/home/user/4C/utilities/four_c_python/src/four_c_metadata/json_schema.py", line 400, in cli
[build] main(**vars(args))
[build] File "/home/user/4C/utilities/four_c_python/src/four_c_metadata/json_schema.py", line 318, in main
[build] metadata_object = All_Of.from_4C_metadata(metadata["sections"], context)
[build] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[build] File "/home/user/4C/utilities/four_c_python/src/four_c_metadata/metadata.py", line 190, in from_4C_metadata
[build] specs = [metadata_from_dict(spec, context) for spec in specs]
[build] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[build] File "/home/user/4C/utilities/four_c_python/src/four_c_metadata/metadata.py", line 891, in metadata_from_dict
[build] return metadata_class.from_4C_metadata(data_dict, context)
[build] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[build] File "/home/user/4C/utilities/four_c_python/src/four_c_metadata/metadata.py", line 772, in from_4C_metadata
[build] metadata_from_dict(spec, context) for spec in data_dict.pop("specs", [])
[build] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[build] File "/home/user/4C/utilities/four_c_python/src/four_c_metadata/metadata.py", line 891, in metadata_from_dict
[build] return metadata_class.from_4C_metadata(data_dict, context)
[build] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[build] File "/home/user/4C/utilities/four_c_python/src/four_c_metadata/metadata.py", line 190, in from_4C_metadata
[build] specs = [metadata_from_dict(spec, context) for spec in specs]
[build] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[build] File "/home/user/4C/utilities/four_c_python/src/four_c_metadata/metadata.py", line 891, in metadata_from_dict
[build] return metadata_class.from_4C_metadata(data_dict, context)
[build] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[build] File "/home/user/4C/utilities/four_c_python/src/four_c_metadata/metadata.py", line 500, in from_4C_metadata
[build] value_type: NATIVE_CPP_ALIAS = metadata_from_dict(
[build] ^^^^^^^^^^^^^^^^^^^
[build] File "/home/user/4C/utilities/four_c_python/src/four_c_metadata/metadata.py", line 891, in metadata_from_dict
[build] return metadata_class.from_4C_metadata(data_dict, context)
[build] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[build] File "/home/user/4C/utilities/four_c_python/src/four_c_metadata/metadata.py", line 440, in from_4C_metadata
[build] choices = [c["name"] for c in data_dict.pop("choices")]
[build] ^^^^^^^^^^^^^^^^^^^^^^^^
[build] KeyError: 'choices'
Member
|
Looking further into this, the 4C_metadata.yaml contains Which indeed misses the |
Member
Author
|
@ppraegla Thanks for checking. I will add the choices here, this was indeed never used so far. |
Member
Author
|
Ah this is once more related to #1708. Added it to the list there. I will see if I find the time soon to cross a few things of this list. |
ppraegla
approved these changes
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@ppraegla