Repository: NREL/hescore-hpxml

Issue:
Move external_building_id to building_address
[In this repo](https://github.com/NREL/hescore-hpxml/blob/e5af84582b4524ad92bac0a9f153051f2d39f5eb/hescorehpxml/base.py#L879) we're placing the `external_building_id` under `building.about`. 

In the HEScore API documentation it says that it should be sent with `submit_address` which gets put in `building_address` in this tool. 

That change is easy enough to make here. @thepriestscottage @lirainer, have you been reading it out of the other location up to this point? If so, we should probably coordinate changing that. 

cc @bpark1327


Discussion:

Patch:
diff --git a/docs/source/translation/about.rst b/docs/source/translation/about.rst
index c083c764..6eebb65c 100644
--- a/docs/source/translation/about.rst
+++ b/docs/source/translation/about.rst
@@ -10,15 +10,6 @@ HEScore requires an assessment date. If a date is stored in the element
 ``Building/ProjectStatus/Date``, that date is used. If not, the current date is
 used.
 
-External Building ID
-********************
-
-The value of ``Building/extension/HESExternalID`` or
-``Building/BuildingID/SendingSystemIdentifierValue``, if present, is copied into the
-``building.about.external_building_id`` field in HEScore.
-Preference is given to the `extension` element if both are present.
-This is optional, but may be useful for those wanting to pass an additional building identifier for their own tracking purposes.
-
 Building Shape
 **************
 
diff --git a/docs/source/translation/building_address.rst b/docs/source/translation/building_address.rst
index 2937502f..33449491 100644
--- a/docs/source/translation/building_address.rst
+++ b/docs/source/translation/building_address.rst
@@ -91,3 +91,12 @@ element in the ``extension`` of ``Building/ProjectStatus``:
 
 Upon finding this ``HEScoreMentorAssessment`` element, the HEScore assessment
 type will be set to "mentor" regardless of the mapping :ref:`above <assessment-type-mapping>`.
+
+External Building ID
+********************
+
+The value of ``Building/extension/HESExternalID`` or
+``Building/BuildingID/SendingSystemIdentifierValue``, if present, is copied into the
+``building_address.external_building_id`` field in HEScore.
+Preference is given to the `extension` element if both are present.
+This is optional, but may be useful for those wanting to pass an additional building identifier for their own tracking purposes.
diff --git a/hescorehpxml/base.py b/hescorehpxml/base.py
index 0c9b2559..4f3a4544 100644
--- a/hescorehpxml/base.py
+++ b/hescorehpxml/base.py
@@ -828,6 +828,17 @@ class HPXMLtoHEScoreTranslatorBase(object):
             else:
                 assert transaction_type == 'update'
                 bldgaddr['assessment_type'] = 'corrected'
+
+        ext_id_xpath_exprs = (
+            'h:extension/h:HESExternalID/text()',
+            'h:BuildingID/h:SendingSystemIdentifierValue/text()'
+        )
+        for ext_id_xpath_expr in ext_id_xpath_exprs:
+            external_id_value = xpath(b, ext_id_xpath_expr)
+            if external_id_value is not None:
+                bldgaddr['external_building_id'] = external_id_value
+                break
+
         return bldgaddr
 
     def get_hpwes(self, p, c):
@@ -869,16 +880,6 @@ class HPXMLtoHEScoreTranslatorBase(object):
         ns = self.ns
         bldg_about = OrderedDict()
 
-        ext_id_xpath_exprs = (
-            'h:extension/h:HESExternalID/text()',
-            'h:BuildingID/h:SendingSystemIdentifierValue/text()'
-        )
-        for ext_id_xpath_expr in ext_id_xpath_exprs:
-            external_id_value = xpath(b, ext_id_xpath_expr)
-            if external_id_value is not None:
-                bldg_about['external_building_id'] = external_id_value
-                break
-
         project_status_date_el = b.find('h:ProjectStatus/h:Date', namespaces=ns)
         if project_status_date_el is None:
             bldg_about['assessment_date'] = dt.date.today()


Test patch:
diff --git a/tests/test_translation.py b/tests/test_translation.py
index 47a0e703..8287a01b 100644
--- a/tests/test_translation.py
+++ b/tests/test_translation.py
@@ -1056,7 +1056,7 @@ class TestOtherHouses(unittest.TestCase, ComparatorBase):
         myid = uuid.uuid4().hex
         el.text = myid
         res = tr.hpxml_to_hescore()
-        self.assertEqual(myid, res['building']['about'].get('external_building_id'))
+        self.assertEqual(myid, res['building_address'].get('external_building_id'))
 
     def test_external_id_extension_passthru(self):
         tr = self._load_xmlfile('hescore_min')
@@ -1069,7 +1069,7 @@ class TestOtherHouses(unittest.TestCase, ComparatorBase):
         el = etree.SubElement(self.xpath('//h:Building/h:BuildingID'), tr.addns('h:SendingSystemIdentifierValue'))
         el.text = uuid.uuid4().hex
         res = tr.hpxml_to_hescore()
-        self.assertEqual(myid, res['building']['about'].get('external_building_id'))
+        self.assertEqual(myid, res['building_address'].get('external_building_id'))
 
     def test_preconstruction_event_type(self):
         tr = self._load_xmlfile('hescore_min')