Skip to content

Conversation

@Koeng101
Copy link
Contributor

This PR fixes the parsing issues when it comes to big' ole real-life GenbankFlatFiles.

Note: I have no idea WHY exactly it fixed them all. Basically, all I did was add length checks in 4 places:

quickMetaCheck (if len(line) == 0, flag is false)
quickSubMetaCheck (if len(line) == 0, flag is false)

check if len(startEndSplit) is > 1 before doing end, _ = strconv.Atoi(partialRegex.ReplaceAllString(startEndSplit[1], ""))
finally, check if there is still line to parse over when trying to find paratheses in switch expression[firstInnerParentheses+i]. Apparently, sometimes there ain't?

And commented out a line of code
attributeValue = strings.TrimSpace(attributeSplit[1])
I am not sure why this line is added - it is completely untested, and if you actually encounter it the system panics.

In particular, I tested with the following genbank file https://siasky.net/AABxAejn_kkw0H5O8ECVdPhFuMXy1uib_Z8B5JE5DctSuQ

It is pretty large, so I didn't actually push it to the main branch. It also takes quite a few seconds to parse, so there is that too.

@Koeng101
Copy link
Contributor Author

Forgot the bot was an a-hole, let me try to get those tests....

@Koeng101
Copy link
Contributor Author

Koeng101 commented Dec 19, 2020

@TimothyStiles I think your bot is bugged. 93.54% <0.00%> (-6.46%) doesn't make very much sense.

Also, added in a test for location tags that are just single letters. I guess they happen sometimes, so are added in. I implemented that in one of the test files, which is why it increased the coverage.

@qlty-cloud-legacy
Copy link

qlty-cloud-legacy bot commented Apr 14, 2021

Code Climate has analyzed commit d41459a and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Bug Risk 1

The test coverage on the diff in this pull request is 100.0% (95% is the threshold).

This pull request will bring the total coverage in the repository to 96.8% (0.0% change).

View more on Code Climate.

@bebop bebop deleted a comment from codecov bot Apr 14, 2021
@TimothyStiles TimothyStiles merged commit 3a11af6 into prime Apr 14, 2021
@TimothyStiles TimothyStiles deleted the gbkErrorHandling branch April 14, 2021 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants