taxprofiler / taxpasta

TAXnomic Profile Aggregation and STAndardisation
https://taxpasta.readthedocs.io/
Apache License 2.0
31 stars 6 forks source link

feat: raise parser warning as exception #101

Closed Midnighter closed 1 year ago

Midnighter commented 1 year ago

This adds new behavior to the mOTUs reader. Likely, similar functionality should be added to all readers. Need to think about how to best integrate that.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.35 :tada:

Comparison is base (2167eb4) 81.64% compared to head (3cc4a3a) 81.99%.

:exclamation: Current head 3cc4a3a differs from pull request most recent head 2857708. Consider uploading reports for the commit 2857708 to get more accurate results

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #101 +/- ## ========================================== + Coverage 81.64% 81.99% +0.35% ========================================== Files 103 106 +3 Lines 1585 1594 +9 Branches 274 281 +7 ========================================== + Hits 1294 1307 +13 + Misses 250 247 -3 + Partials 41 40 -1 ``` | [Impacted Files](https://app.codecov.io/gh/taxprofiler/taxpasta/pull/101?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [...taxpasta/application/sample\_merging\_application.py](https://app.codecov.io/gh/taxprofiler/taxpasta/pull/101?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3RheHBhc3RhL2FwcGxpY2F0aW9uL3NhbXBsZV9tZXJnaW5nX2FwcGxpY2F0aW9uLnB5) | `57.89% <ø> (ø)` | | | [...frastructure/application/sample\_etl\_application.py](https://app.codecov.io/gh/taxprofiler/taxpasta/pull/101?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3RheHBhc3RhL2luZnJhc3RydWN0dXJlL2FwcGxpY2F0aW9uL3NhbXBsZV9ldGxfYXBwbGljYXRpb24ucHk=) | `73.33% <ø> (ø)` | | | [...rastructure/application/bracken/bracken\_profile.py](https://app.codecov.io/gh/taxprofiler/taxpasta/pull/101?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3RheHBhc3RhL2luZnJhc3RydWN0dXJlL2FwcGxpY2F0aW9uL2JyYWNrZW4vYnJhY2tlbl9wcm9maWxlLnB5) | `100.00% <100.00%> (ø)` | | | [...ture/application/bracken/bracken\_profile\_reader.py](https://app.codecov.io/gh/taxprofiler/taxpasta/pull/101?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3RheHBhc3RhL2luZnJhc3RydWN0dXJlL2FwcGxpY2F0aW9uL2JyYWNrZW4vYnJhY2tlbl9wcm9maWxlX3JlYWRlci5weQ==) | `100.00% <100.00%> (ø)` | | | [...cture/application/centrifuge/centrifuge\_profile.py](https://app.codecov.io/gh/taxprofiler/taxpasta/pull/101?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3RheHBhc3RhL2luZnJhc3RydWN0dXJlL2FwcGxpY2F0aW9uL2NlbnRyaWZ1Z2UvY2VudHJpZnVnZV9wcm9maWxlLnB5) | `100.00% <100.00%> (ø)` | | | [...pplication/centrifuge/centrifuge\_profile\_reader.py](https://app.codecov.io/gh/taxprofiler/taxpasta/pull/101?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3RheHBhc3RhL2luZnJhc3RydWN0dXJlL2FwcGxpY2F0aW9uL2NlbnRyaWZ1Z2UvY2VudHJpZnVnZV9wcm9maWxlX3JlYWRlci5weQ==) | `100.00% <100.00%> (ø)` | | | [...rastructure/application/diamond/diamond\_profile.py](https://app.codecov.io/gh/taxprofiler/taxpasta/pull/101?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3RheHBhc3RhL2luZnJhc3RydWN0dXJlL2FwcGxpY2F0aW9uL2RpYW1vbmQvZGlhbW9uZF9wcm9maWxlLnB5) | `100.00% <100.00%> (ø)` | | | [...ture/application/diamond/diamond\_profile\_reader.py](https://app.codecov.io/gh/taxprofiler/taxpasta/pull/101?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3RheHBhc3RhL2luZnJhc3RydWN0dXJlL2FwcGxpY2F0aW9uL2RpYW1vbmQvZGlhbW9uZF9wcm9maWxlX3JlYWRlci5weQ==) | `100.00% <100.00%> (ø)` | | | [.../infrastructure/application/kaiju/kaiju\_profile.py](https://app.codecov.io/gh/taxprofiler/taxpasta/pull/101?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3RheHBhc3RhL2luZnJhc3RydWN0dXJlL2FwcGxpY2F0aW9uL2thaWp1L2thaWp1X3Byb2ZpbGUucHk=) | `100.00% <100.00%> (ø)` | | | [...tructure/application/kaiju/kaiju\_profile\_reader.py](https://app.codecov.io/gh/taxprofiler/taxpasta/pull/101?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3RheHBhc3RhL2luZnJhc3RydWN0dXJlL2FwcGxpY2F0aW9uL2thaWp1L2thaWp1X3Byb2ZpbGVfcmVhZGVyLnB5) | `100.00% <100.00%> (ø)` | | | ... and [14 more](https://app.codecov.io/gh/taxprofiler/taxpasta/pull/101?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/taxprofiler/taxpasta/pull/101/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Midnighter commented 1 year ago

Turned into a pretty big thing with lots of changes under the hood and in the tests. Essentially, this PR does three things, though:

  1. Make validation stricter by turning off type coercion for profiles and turning parser warnings into errors.
  2. Thus ensure that input profiles other than from the chosen profiler fail (with exception of Kraken2 <-> Centrifuge profiles).
  3. Add tests to verify that processing other profiles fails.

This was done in response to the experience detailed in https://github.com/pyOpenSci/software-submission/issues/84#issuecomment-1530191450