To Rearrange-Reader branch: Fix 5 tests : calculating number of data columns #369
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.
This pull-request fixes the remaining previously broken tests on the rearrange-reader branch.
It also, removes python 2.7 from Travis-CI. Per #364, Python 2.7 won't be supported on the rearrange-reader branch.
This change adds parsing a data line with regexp_subs which fixes common errors in the data
(~A). It is added to reader.py::inspect_data_section(). inspect_data_section() is a new function
on the rearrange_reader branch that replaces the older "get data line length" steps.
This change is essentially pulling the regex_subs loop from the older steps and adding it to the
new inspect_data_section() function.
This change also accepts the n_columns from insect_data_section() if provisional_wrap is "NO".
API change:
This change adds regex_subs to inspect_data_section's parameter list:
from
inspect_data_section(file_obj, line_nos)
to
inspect_data_section(file_obj, line_nos, regexp_subs)
Here are the tests fixed with this change:
Additional-Notes:
def inspect_data_section(file_obj, line_nos, regexp_subs)
anddef read_data_section_iterative(file_obj, line_nos, regexp_subs, value_null_subs)
have a fair amount of code in common. A future issue/pull-request might work tocombine the common code.
Test and Coverage comparison with master branch
rearrange-reader + this change
master branch
Let me know if this change could be accepted (or rejected) or
needs some additional changes before being approved and merged.
Thank you,
DC
Edit note 2020-07-08: update coverage stats to remove my development files. This moves both total coverages from percents in the 60s to percents in the 80s.