From 0ab8b321deaf8cf18e7fa845befee49162cb85d2 Mon Sep 17 00:00:00 2001 From: SpacemanSteve Date: Wed, 8 Jan 2020 14:51:25 -0500 Subject: [PATCH] add aff_raw field to augment pipeline message --- adsmsg/protobuf/augmentrecord_pb2.py | 15 +++++++++++---- adsmsg/tests/test_affiliation_record.py | 8 ++++++++ specs/augmentrecord.proto | 1 + 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/adsmsg/protobuf/augmentrecord_pb2.py b/adsmsg/protobuf/augmentrecord_pb2.py index d0272c3..eb353e1 100644 --- a/adsmsg/protobuf/augmentrecord_pb2.py +++ b/adsmsg/protobuf/augmentrecord_pb2.py @@ -20,7 +20,7 @@ name='augmentrecord.proto', package='adsmsg', syntax='proto3', - serialized_pb=_b('\n\x13\x61ugmentrecord.proto\x12\x06\x61\x64smsg\x1a\x0cstatus.proto\"o\n\x1f\x41ugmentAffiliationRequestRecord\x12\x0f\n\x07\x62ibcode\x18\x01 \x01(\t\x12\x1e\n\x06status\x18\x02 \x01(\x0e\x32\x0e.adsmsg.Status\x12\x0b\n\x03\x61\x66\x66\x18\x03 \x03(\t\x12\x0e\n\x06\x61uthor\x18\x04 \x03(\t\"\x8c\x01\n#AugmentAffiliationRequestRecordList\x12\x45\n\x14\x61\x66\x66iliation_requests\x18\x01 \x03(\x0b\x32\'.adsmsg.AugmentAffiliationRequestRecord\x12\x1e\n\x06status\x18\x02 \x01(\x0e\x32\x0e.adsmsg.Status\"\xeb\x01\n AugmentAffiliationResponseRecord\x12\x0f\n\x07\x62ibcode\x18\x01 \x01(\t\x12\x1e\n\x06status\x18\x02 \x01(\x0e\x32\x0e.adsmsg.Status\x12\x0b\n\x03\x61\x66\x66\x18\x03 \x03(\t\x12\x0e\n\x06\x61uthor\x18\x04 \x03(\t\x12\x12\n\naff_abbrev\x18\x05 \x03(\t\x12\x15\n\raff_canonical\x18\x06 \x03(\t\x12\x11\n\taff_facet\x18\x07 \x03(\t\x12\x16\n\x0e\x61\x66\x66_facet_hier\x18\x08 \x03(\t\x12\x0e\n\x06\x61\x66\x66_id\x18\t \x03(\t\x12\x13\n\x0binstitution\x18\n \x03(\t\"\x8f\x01\n$AugmentAffiliationResponseRecordList\x12G\n\x15\x61\x66\x66iliation_responses\x18\x01 \x03(\x0b\x32(.adsmsg.AugmentAffiliationResponseRecord\x12\x1e\n\x06status\x18\x02 \x01(\x0e\x32\x0e.adsmsg.Statusb\x06proto3') + serialized_pb=_b('\n\x13\x61ugmentrecord.proto\x12\x06\x61\x64smsg\x1a\x0cstatus.proto\"o\n\x1f\x41ugmentAffiliationRequestRecord\x12\x0f\n\x07\x62ibcode\x18\x01 \x01(\t\x12\x1e\n\x06status\x18\x02 \x01(\x0e\x32\x0e.adsmsg.Status\x12\x0b\n\x03\x61\x66\x66\x18\x03 \x03(\t\x12\x0e\n\x06\x61uthor\x18\x04 \x03(\t\"\x8c\x01\n#AugmentAffiliationRequestRecordList\x12\x45\n\x14\x61\x66\x66iliation_requests\x18\x01 \x03(\x0b\x32\'.adsmsg.AugmentAffiliationRequestRecord\x12\x1e\n\x06status\x18\x02 \x01(\x0e\x32\x0e.adsmsg.Status\"\xfc\x01\n AugmentAffiliationResponseRecord\x12\x0f\n\x07\x62ibcode\x18\x01 \x01(\t\x12\x1e\n\x06status\x18\x02 \x01(\x0e\x32\x0e.adsmsg.Status\x12\x0b\n\x03\x61\x66\x66\x18\x03 \x03(\t\x12\x0e\n\x06\x61uthor\x18\x04 \x03(\t\x12\x12\n\naff_abbrev\x18\x05 \x03(\t\x12\x15\n\raff_canonical\x18\x06 \x03(\t\x12\x11\n\taff_facet\x18\x07 \x03(\t\x12\x16\n\x0e\x61\x66\x66_facet_hier\x18\x08 \x03(\t\x12\x0e\n\x06\x61\x66\x66_id\x18\t \x03(\t\x12\x13\n\x0binstitution\x18\n \x03(\t\x12\x0f\n\x07\x61\x66\x66_raw\x18\x0b \x03(\t\"\x8f\x01\n$AugmentAffiliationResponseRecordList\x12G\n\x15\x61\x66\x66iliation_responses\x18\x01 \x03(\x0b\x32(.adsmsg.AugmentAffiliationResponseRecord\x12\x1e\n\x06status\x18\x02 \x01(\x0e\x32\x0e.adsmsg.Statusb\x06proto3') , dependencies=[status__pb2.DESCRIPTOR,]) @@ -194,6 +194,13 @@ message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), + _descriptor.FieldDescriptor( + name='aff_raw', full_name='adsmsg.AugmentAffiliationResponseRecord.aff_raw', index=10, + number=11, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), ], extensions=[ ], @@ -207,7 +214,7 @@ oneofs=[ ], serialized_start=302, - serialized_end=537, + serialized_end=554, ) @@ -244,8 +251,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=540, - serialized_end=683, + serialized_start=557, + serialized_end=700, ) _AUGMENTAFFILIATIONREQUESTRECORD.fields_by_name['status'].enum_type = status__pb2._STATUS diff --git a/adsmsg/tests/test_affiliation_record.py b/adsmsg/tests/test_affiliation_record.py index 4300298..8991249 100644 --- a/adsmsg/tests/test_affiliation_record.py +++ b/adsmsg/tests/test_affiliation_record.py @@ -71,6 +71,9 @@ def test_affiliation_response(self): "aff_id": ['placeholder'], "institution": [ "CfA" + ], + 'aff_raw': [ + "Harvard-Smithsonian Center for Astrophysics, Cambridge, MA." ] } a = AugmentAffiliationResponseRecord(**d) @@ -82,6 +85,7 @@ def test_affiliation_response(self): self.assertEqual(a.aff_canonical, d['aff_canonical']) self.assertEqual(a.aff_facet_hier, d['aff_facet_hier']) self.assertEqual(a.aff_id, d['aff_id']) + self.assertEqual(a.aff_raw, d['aff_raw']) self.assertEqual(a.institution, d['institution']) def test_affiliation_response_list(self): @@ -108,6 +112,9 @@ def test_affiliation_response_list(self): "aff_id": ['placeholder'], "institution": [ "CfA" + ], + 'aff_raw': [ + "Harvard-Smithsonian Center for Astrophysics, Cambridge, MA." ] } d_list = [d] @@ -124,4 +131,5 @@ def test_affiliation_response_list(self): self.assertEqual(m.affiliation_responses[i].aff_canonical, d_list[i]['aff_canonical']) self.assertEqual(m.affiliation_responses[i].aff_facet_hier, d_list[i]['aff_facet_hier']) self.assertEqual(m.affiliation_responses[i].aff_id, d_list[i]['aff_id']) + self.assertEqual(m.affiliation_responses[i].aff_raw, d_list[i]['aff_raw']) self.assertEqual(m.affiliation_responses[i].institution, d_list[i]['institution']) diff --git a/specs/augmentrecord.proto b/specs/augmentrecord.proto index 5940c4d..7c70840 100644 --- a/specs/augmentrecord.proto +++ b/specs/augmentrecord.proto @@ -32,6 +32,7 @@ message AugmentAffiliationResponseRecord { repeated string aff_facet_hier = 8; repeated string aff_id = 9; repeated string institution = 10; + repeated string aff_raw = 11; } // also support lists of the above