significance.py emits RuntimeWarning: Mean of empty slice during the benchmark tests
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- numpy, python
- Domain
- machine-learning, testing
Research direction
Start with the four reported lines in faircode/significance.py and the benchmark cases in tests/test_benchmark.py; run the issue's pytest command to reproduce the warnings. Trace which inputs create an empty group, then check how significance tests handle the explicit missing value and note. Done when an empty-group test is covered and the full run emits no RuntimeWarning from significance.py.
Written by the indexing model from the issue text.
Description
Where: faircode/significance.py (lines 48, 57, 72, 86), tests/test_benchmark.py.
Current gap: The full test run reports 245 warnings; among them are RuntimeWarning: Mean of empty slice from four lines of significance.py and invalid value encountered in divide, 15 of them in tests/test_benchmark.py, which means a group with no rows reaches numpy.mean and the result is NaN without the code saying so.
Repro:
python3 -m pytest tests/test_benchmark.py -q -W error::RuntimeWarning
Suggested approach: Find which inputs produce an empty slice, return an explicit missing value (and a note) instead of calling mean on nothing, and turn these RuntimeWarnings into errors in the significance tests.
Done when: the full run emits no RuntimeWarning from significance.py and a test covers the empty-group input.
- Dominant language
- HTML
- Stars
- 47
- Forks
- 45
- Avg merge
- 2h 47m
- Merged PRs (30d)
- 92
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from yakew7/Fair-Code
-
community enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
community enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
enhancement good first issue tooling
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
ci enhancement tooling
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
community enhancement tooling
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
All issues in yakew7/Fair-Code
Similar issues
-
code-health
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tinaudio/synth-setter#3750 ·
Maintainers usually reply within 1 day
-
Image processors with shortest_edge + longest_edge upscale every image to longest_edge (DETR, YOLOS)Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
huggingface/transformers.js#1886 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
tensorflow/tfjs#8754 ·
-
Tensor.split and neighbouring methods in torch/_tensor.py lack type annotations (return Unknown)Openbot-triaged module: typing triaged
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day