Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exclusion criteria for ENA samples without collection date #144

Merged
merged 8 commits into from
Jan 25, 2024

Conversation

johausmann
Copy link
Member

Addresses issue #86

Added test for collection data filter
Added command line option to disable filter criteria (other viruses)
@johausmann johausmann changed the base branch from main to develop November 7, 2023 15:25
johausmann and others added 7 commits November 7, 2023 18:22
Fix unsupported operand type(s) for +=: 'dict' and 'int' error in ena accessor
Fix error in test data trying to insert the samples from previous test
Fix yet another typo
Copy link

codecov bot commented Nov 9, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b652204) 85.87% compared to head (f362c4e) 85.93%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #144      +/-   ##
===========================================
+ Coverage    85.87%   85.93%   +0.05%     
===========================================
  Files           48       48              
  Lines         5026     5047      +21     
===========================================
+ Hits          4316     4337      +21     
  Misses         710      710              
Files Coverage Δ
covigator/accessor/abstract_accessor.py 100.00% <100.00%> (ø)
covigator/accessor/ena_accessor.py 89.37% <100.00%> (+0.70%) ⬆️
covigator/tests/unit_tests/faked_objects.py 87.27% <100.00%> (ø)
covigator/tests/unit_tests/test_ena_accessor.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@johausmann johausmann marked this pull request as ready for review November 9, 2023 12:27
@johausmann johausmann changed the title Add exclusion criteria for ENA samples without colleciton date Add exclusion criteria for ENA samples without collection date Nov 9, 2023
@johausmann
Copy link
Member Author

This addresses the ENA accessor part related to this issue. I would like to discuss the retroactive removal in our next technical meeting.

@johausmann johausmann requested a review from priesgo November 9, 2023 13:40
@@ -191,6 +195,12 @@ def _parse_ena_run(self, run):
def _complies_with_inclusion_criteria(self, ena_run: dict):
# NOTE: this uses the original dictionary instead of the parsed SampleEna class for performance reasons
included = True
# Skip samples with empty collection date - Note this checks not if collection date is too early
if not self.disable_collection_date_filter:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a style comment that I normally try to avoid as for me it makes the code slightly more difficult to understand.

Double negations. When interpreting the code in your head and going through the logic, double negations are very error prone (for me, I did not run a trial on it). Here you do not and disable which means enable, so I would call the variable here enable. I understand that this comes from CLI where you want your default to be enabled and hende the flag is disabled, you can keep disable in the CLI.

You don't need to apply this change.

Copy link
Collaborator

@priesgo priesgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@priesgo priesgo merged commit 588a1c0 into develop Jan 25, 2024
6 checks passed
@priesgo priesgo deleted the 86_add_exclusion_without_collection_date branch January 25, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants