Skip to content

refactor: tighten type annotations for cache variables in snp_data.py#1129

Open
faizavk wants to merge 2 commits intomalariagen:masterfrom
faizavk:tighten-snp-types
Open

refactor: tighten type annotations for cache variables in snp_data.py#1129
faizavk wants to merge 2 commits intomalariagen:masterfrom
faizavk:tighten-snp-types

Conversation

@faizavk
Copy link
Copy Markdown

@faizavk faizavk commented Mar 15, 2026

This PR addresses a TODO in AnophelesSnpData.init by tightening the type hints for the internal cache variables. Loose Dict types and untyped None assignments have been replaced with strict Dict, Optional, zarr.hierarchy.Group, and np.ndarray definitions based on their respective loading methods.

@faizavk faizavk force-pushed the tighten-snp-types branch from 76ae17c to 995ddad Compare March 15, 2026 19:16
@jonbrenas
Copy link
Copy Markdown
Collaborator

Hi @faizavk, could you move the type definitions to base_params.py?

@faizavk faizavk force-pushed the tighten-snp-types branch from 995ddad to 204a409 Compare March 18, 2026 11:38
@faizavk
Copy link
Copy Markdown
Author

faizavk commented Mar 18, 2026

Hi @jonbrenas, thanks for the feedback! I've moved the type definitions to base_params.py as zarr_group and numpy_ndarray TypeAliases, and updated snp_data.py to reference them consistently. Please let me know if this looks correct.

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