Skip to content

fix(phenotypes): Correct GCS path construction#816

Merged
jonbrenas merged 1 commit intomasterfrom
fix/phenotype-path-construction
Sep 8, 2025
Merged

fix(phenotypes): Correct GCS path construction#816
jonbrenas merged 1 commit intomasterfrom
fix/phenotype-path-construction

Conversation

@mohamed-laarej
Copy link
Copy Markdown
Collaborator

Re: issue #815

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 1, 2025

Codecov Report

❌ Patch coverage is 41.66667% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.08%. Comparing base (3c2ce1d) to head (054e601).
⚠️ Report is 112 commits behind head on master.

Files with missing lines Patch % Lines
malariagen_data/anoph/phenotypes.py 41.66% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #816      +/-   ##
==========================================
- Coverage   95.97%   92.08%   -3.90%     
==========================================
  Files          47       49       +2     
  Lines        4699     4939     +240     
==========================================
+ Hits         4510     4548      +38     
- Misses        189      391     +202     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@jonbrenas jonbrenas left a comment

Choose a reason for hiding this comment

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

It looks correct to me. CodeCov is having fits at times, it can mostly be ignored. More importantly, I would recommend to use inheritance (say from AnophelesSampleMetadata) to avoid having to redefine private fields (such as _url) that are going to be inferred from the Ag3 constructor anyways.

@mohamed-laarej
Copy link
Copy Markdown
Collaborator Author

Hi @jonbrenas ,
Thanks for the feedback about using inheritance from AnophelesSampleMetadata. I tried that approach but ran into MRO conflicts and constructor issues when MyPy tried to resolve the inheritance chain for AnophelesDataResource.
Instead, I want to implement a TYPE_CHECKING solution:

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    _url: str
    _fs: fsspec.AbstractFileSystem
    # ... other expected fields

This avoids redefining private fields (they're only declared for type checking) while preventing the inheritance conflicts. Do you think this approach is acceptable, or would you prefer I investigate the inheritance issues further?

@jonbrenas
Copy link
Copy Markdown
Collaborator

Thanks @mohamed-laarej.

If type-checking works, go with that. We will have to modify the code to use inheritance at some point (to make sure that the package stays (somewhat) consistent) but there are better things for you to spend your time on.

@mohamed-laarej
Copy link
Copy Markdown
Collaborator Author

Hi @jonbrenas ,

I've implemented the TYPE_CHECKING solution as discussed. This resolves the MyPy errors while avoiding inheritance conflicts. I understand we'll need to refactor to proper inheritance later, but this temporary solution allows me to proceed with the GWAS and Bayesian model work that depends on this PR.
Thanks for the guidance!

@mohamed-laarej mohamed-laarej force-pushed the fix/phenotype-path-construction branch from b4810b7 to 6dfba05 Compare September 4, 2025 14:52
Copy link
Copy Markdown
Collaborator

@jonbrenas jonbrenas left a comment

Choose a reason for hiding this comment

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

LGTM.

@jonbrenas jonbrenas merged commit c659b69 into master Sep 8, 2025
10 checks passed
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