Closed Fenreg closed 4 months ago
I may be misunderstanding, but I think the result you are seeing is what I would expect.
<Reference_List>
<Internal_Reference>
<lid_reference>1</lid_reference>
<reference_type>1b</reference_type>
<comment>1c</comment>
</Internal_Reference>
<Internal_Reference>
<lid_reference>2a</lid_reference>
<reference_type>2b</reference_type>
<comment>2c</comment>
</Internal_Reference>
</Reference_List>
Should translate to
dict_label = {
'Reference_List': {
'Internal_Reference': [
{
'lid_reference': '1a',
'reference_type': '1b',
'comment': '1c'
},
{
'lid_reference': '2a',
'reference_type': '2b',
'comment': '2c'
}
]
}
}
Is this not what you see, or not what you expect? If the latter, what did you expect?
@Fenreg
Following up on this one. If I don't hear back from you, I'll go ahead and assume this as resolved.
Dear @LevN0,
I found out that the to_dict method has apparently an issue when dealing with a Reference_List, and apparently collapses the duplicate sub-groups into a single one. Consider a Reference_List containing multiple Internal_Reference labels set as below: Which when read as follows: Provides the following results:
My understanding is that this feature happens despite the Reference_List being structured as expected according the Information model specs (https://pds.nasa.gov/datastandards/documents/im/v1/index_1K00.html#reference_type).
Could you throw maybe some light on this ? Looking forward to your reply, All the best