Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix paz poles zeros reading #2260
What does this PR do?
Fix a bug in the module read_inventory when a SC3ML file is given:
Why was it initiated? Any relevant Issues?
Unable to read the instrumental response of a raspberryshake3d (version5) with the module read_inventory.
It is defined here. All whitespace locations are
There could be no spaces between each element (i.e.,
So this change is good, but incomplete, though that's not the reporter's fault. The original code was not quite correct.
Nice catch there @QuLogic!
Maybe we need to use some impossible to read regex here? ;-)
..or maybe something less sophisticated but far more readable.. ;-)
If we aren't trying to verify and assume the thing is valid, then a much simpler regex would work:
In : poles = " (-0.037,0.037) (-0.037,-0.037) (-6909, 9208)( -6909 ,-9208) " In : import re In : re.findall(r'\(\s*([^,\s]+)\s*,\s*([^)\s]+)\s*\)', poles) Out: [('-0.037', '0.037'), ('-0.037', '-0.037'), ('-6909', '9208'), ('-6909', '-9208')]