Skip to content
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

BCLXML doesn't handle AttributeVector #5364

Open
jmarrec opened this issue Mar 12, 2025 · 0 comments
Open

BCLXML doesn't handle AttributeVector #5364

jmarrec opened this issue Mar 12, 2025 · 0 comments

Comments

@jmarrec
Copy link
Collaborator

jmarrec commented Mar 12, 2025

Issue overview

OpenStudio::Attribute has an AttributeVector value type, but it is not supported by BCLXML.

Current Behavior

No warning is issued, but it is not serialized in saving. Nor would it be read.

case AttributeValueType::AttributeVector:
// can't handle this yet
continue;
break;

Expected Behavior

We should implement support for it, or warn when you try to add an AttributeVector in BCLXML::addAttribute.

Steps to Reproduce

bclXML = OpenStudio::BCLXML.new('measure.xml')

consideration1 = OpenStudio::Attribute.new("consideration", "Check transformer capacity when installing a heat pump.")
consideration2 = OpenStudio::Attribute.new("consideration", "Verify wiring compliance with local electrical codes before installation.")
implementation_considerations = OpenStudio::Attribute.new("implementation_considerations", [consideration1, consideration2])

n = bclXML.attributes.size

# The bclXML has the new attribute, but it will NOT be serialized to measure.xml when you save, nor in puts
bclXML.addAttribute(implementation_considerations)
raise unless bclXML.attributes.size == n + 1
puts bclXML
  <attributes>
    <attribute>
      <name>Measure Type</name>
      <value>ModelMeasure</value>
      <datatype>string</datatype>
    </attribute>
    <attribute>
      <name>Measure Language</name>
      <value>Ruby</value>
      <datatype>string</datatype>
    </attribute>
-   <attribute>
-      <name>string_attribute</name>
-      <datatype>AttributeVector<datatype>
-         <value>
-            <attributes>...</attributes>
-         </value>
-    </attribute>
  </attributes>

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version): All
  • Version of OpenStudio (if using an intermediate build, include SHA): 3.10.0-alpha

Context

Just realized this after trying to add nested attributes in measure.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant