Skip to content

Prefix undocumented functions with an underscore to indicate that they're private#833

Merged
leehart merged 70 commits intomasterfrom
GH796_prefix_private_functions
Dec 5, 2025
Merged

Prefix undocumented functions with an underscore to indicate that they're private#833
leehart merged 70 commits intomasterfrom
GH796_prefix_private_functions

Conversation

@leehart
Copy link
Copy Markdown
Collaborator

@leehart leehart commented Dec 1, 2025

Re: issue #796

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 1, 2025

Codecov Report

❌ Patch coverage is 99.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.68%. Comparing base (4c9100b) to head (6168f4c).

Files with missing lines Patch % Lines
malariagen_data/anoph/distance.py 85.71% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #833      +/-   ##
==========================================
+ Coverage   90.66%   90.68%   +0.02%     
==========================================
  Files          49       49              
  Lines        5174     5175       +1     
==========================================
+ Hits         4691     4693       +2     
+ Misses        483      482       -1     

☔ 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.

@leehart
Copy link
Copy Markdown
Collaborator Author

leehart commented Dec 2, 2025

A couple of functions do not appear to be used anywhere in the package:

  • _multiallelic_diplotype_mean_euclidean (formerly multiallelic_diplotype_mean_euclidean)
  • _value_error (formerly value_error)

A curiosity: plasmodium.py overrides the _resolve_region (formerly resolve_region) from util.py but does nothing except provide a different docstring.

The only undocumented function so far (afaik) that doesn't get the private underscore treatment is check_types in util.py, which is a decorator function, used throughout the codebase as @check_types. There appears to be a problem converting this to a private function and using a @_check_types decorator instead, which I'm still investigating.

@leehart
Copy link
Copy Markdown
Collaborator Author

leehart commented Dec 2, 2025

Somewhere along the way, some expected NaNs became Nones.
Investigating...

=========================== short test summary info ============================
FAILED tests/anoph/test_snp_frq.py::test_allele_frequencies_advanced_with_area_by[ag3_sim-admin1_iso] - AssertionError: 
Arrays are not equal

Mismatched elements: 14702 / 14908 (98.6%)
 x: array([None, None, None, ..., None, None, None], dtype=object)
 y: array([nan, nan, nan, ..., nan, nan, nan], dtype=object)
FAILED tests/anoph/test_snp_frq.py::test_allele_frequencies_advanced_with_area_by[af1_sim-admin1_iso] - AssertionError: 
Arrays are not equal

Mismatched elements: 1189 / 1422 (83.6%)
 x: array([None, None, None, ..., None, None, None], dtype=object)
 y: array([nan, nan, nan, ..., nan, nan, nan], dtype=object)
FAILED tests/anoph/test_snp_frq.py::test_allele_frequencies_advanced_with_area_by[adir1_sim-admin1_iso] - AssertionError: 
Arrays are not equal

Mismatched elements: 3297 / 3400 (97%)
 x: array([None, None, None, ..., None, None, None], dtype=object)
 y: array([nan, nan, nan, ..., nan, nan, nan], dtype=object)
FAILED tests/anoph/test_snp_frq.py::test_allele_frequencies_advanced_with_period_by[ag3_sim-year] - AssertionError: 
Arrays are not equal

[...more of the same...]

Mismatched elements: 2802 / 3153 (88.9%)
 x: array([None, None, None, ..., None, None, None], dtype=object)
 y: array([nan, nan, nan, ..., nan, nan, nan], dtype=object)
FAILED tests/anoph/test_snp_frq.py::test_allele_frequencies_advanced_with_dup_samples[af1_sim] - AssertionError: 
Arrays are not equal

Mismatched elements: 9399 / 9567 (98.2%)
 x: array([None, None, None, ..., None, None, None], dtype=object)
 y: array([nan, nan, nan, ..., nan, nan, nan], dtype=object)
FAILED tests/anoph/test_snp_frq.py::test_allele_frequencies_advanced_with_dup_samples[adir1_sim] - AssertionError: 
Arrays are not equal

Mismatched elements: 2521 / 3016 (83.6%)
 x: array([None, None, None, ..., None, None, None], dtype=object)
 y: array([nan, nan, nan, ..., nan, nan, nan], dtype=object)
=========== 24 failed, 631 passed, 194 warnings in 720.47s (0:12:00) ===========

@leehart
Copy link
Copy Markdown
Collaborator Author

leehart commented Dec 4, 2025

Requires resolution of the segmentation fault issue in CI checks: #835

@leehart leehart marked this pull request as ready for review December 4, 2025 11:48
@leehart leehart requested a review from jonbrenas December 4, 2025 11:48
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

@leehart leehart merged commit 57d6b5d into master Dec 5, 2025
10 checks passed
@leehart leehart deleted the GH796_prefix_private_functions branch December 5, 2025 13:08
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