Fixing error/warnings when writing to HDF5, circleRadius bug. #724
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #722.
Fixes #727
The NaturalNameWarning is now suppressed when writing to HDF5 when your object IDs start with a number (or don't otherwise fit PyTables' rather strict naming pattern
^[a-zA-Z_][a-zA-Z0-9_]*$
). Unless the user is going to be using PyTables to look at the data, this won't be an issue - we can warn them about this in the docs.While recreating this error, I also found a bug. At some point in the code -- I have no idea why or where, grepping didn't help -- the ObjID column is being changed to a Pandas dtype that PyTables doesn't support ('StringDtype'), leading to errors when writing out to HDF5.
This wasn't caught in the unit test because the unit test for
PPOutWriteHDF5()
just loads in some data from a CSV file then writes it out. Short of running all of Sorcha intest_PPOutWriteHDF5()
, I'm not sure this COULD have been caught - might be an argument for having end-to-end tests for all the output formats.I have inserted a line in
PPOutWriteHDF5()
that changes the type of that column to a standard 'str' instead.ADDITIONAL FIX:
I have also fixed that one horrible lonely instance of
circleRadius
being used instead ofcircle_radius
inPPPrintConfigsToLog()
. Finally.Review Checklist for Source Code Changes