Skip to content

Conversation

@tristanbr
Copy link
Contributor

Description

Make Enumeration a subclass of Arrayable to allow FMU compilation with enumerations.

The issue can be reproduced from PythonFMU3/examples.

pythonfmu3 build -f Enum.py 
Traceback (most recent call last):
  File "C:\work\extern\PythonFMU3\.venv\Scripts\pythonfmu3-script.py", line 33, in <module>
    sys.exit(load_entry_point('pythonfmu3', 'console_scripts', 'pythonfmu3')())
  File "c:\work\extern\pythonfmu3\pythonfmu3\__main__.py", line 48, in cli_main
    execute(**options)
  File "c:\work\extern\pythonfmu3\pythonfmu3\builder.py", line 133, in build_FMU
    model_identifier, xml = get_model_description(
  File "c:\work\extern\pythonfmu3\pythonfmu3\builder.py", line 58, in get_model_description
    return instance.modelName, instance.to_xml()
  File "c:\work\extern\pythonfmu3\pythonfmu3\fmi3slave.py", line 170, in to_xml
    self.__apply_start_value(v)
  File "c:\work\extern\pythonfmu3\pythonfmu3\fmi3slave.py", line 208, in __apply_start_value
    refs = self.get_int64(vrs)
  File "c:\work\extern\pythonfmu3\pythonfmu3\fmi3slave.py", line 299, in get_int64
    if len(var.dimensions) == 0:
AttributeError: 'Enumeration' object has no attribute 'dimensions'

@StephenSmith25
Copy link
Owner

Thanks, I missed this one!

@StephenSmith25 StephenSmith25 merged commit 3d327c2 into StephenSmith25:master Jan 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants