Add type hints and docstrings to util.py (#1141)#1213
Open
khushthecoder wants to merge 4 commits intomalariagen:masterfrom
Open
Add type hints and docstrings to util.py (#1141)#1213khushthecoder wants to merge 4 commits intomalariagen:masterfrom
khushthecoder wants to merge 4 commits intomalariagen:masterfrom
Conversation
1cb7055 to
8d0420d
Compare
Add PEP 484 type hints and NumPy-style docstrings to seven internal utility functions: _true_runs, _hash_params, _jitter, _value_error, _da_concat, _jackknife_ci, and _pdist_abs_hamming. - Use Union types where callers pass pd.Series (for _jitter) or plain lists (for _jackknife_ci) to avoid mypy and typeguard errors. - Add typing imports: Any, NoReturn, Sequence. - No behavioral changes; only annotations and docstrings. Fixes malariagen#1141
8d0420d to
299830f
Compare
Combine type hints and docstrings from this branch with the random_state parameter added in the merged GH1217 jitter PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1141 — Type hints and docstrings for key utility functions in
util.pySummary
Adds PEP 484 type hints and comprehensive NumPy-style docstrings to 7 key internal utility functions in
malariagen_data/util.py:_true_runs,_hash_params,_jitter,_value_error,_da_concat,_jackknife_ci, and_pdist_abs_hamming.Key Changes
Any,NoReturn,Sequence)@numba.njitdecorators, using basenp.ndarrayannotations where strictly constrained external types would cause JIT compilation failures