ropensci / RNeXML

Implementing semantically rich NeXML I/O in R
https://docs.ropensci.org/RNeXML
Other
13 stars 9 forks source link

Ensure NULL list elements in nexml slots are not converted to XML #204

Closed hlapp closed 5 years ago

hlapp commented 5 years ago

This fixes an error in the simmap serialization/deserialization that has manifested in the simmap vignette.

Obviously, this raises two questions. One, how did a NULL element get into a nexml slot holding a list in the first place (shouldn't result from XML parsing!). Two, why is this only surfacing in the vignette and not caught in one of the simmap tests.

I don't know enough about the simmap data structure to write a stricter test that would catch this (and potentially surface the cause of a NULL element getting into the list in the first place).

hlapp commented 5 years ago

@cboettig this is on top of the meta-refactor branch so you can review it more easily on its own, and so we can see whether that does (or still does not?) fix the failure there.

Once we're good, I'll update meta-refactor with it, which presumably is then good too and ready for merging. Once that's done, I rebase the change that would be an alternative to #201 and submit that too.

hlapp commented 5 years ago

Finally a passing suite of tests 😄 As per above, I added this to #203. @cboettig if you have ideas for how to write a stricter test for the simmap code that could help surface why there is a NULL element in the meta list to start with, please share.