pyrepseq icon indicating copy to clipboard operation
pyrepseq copied to clipboard

Improve test coverage

Open yutanagano opened this issue 1 year ago • 2 comments

While we shouldn't overtest, there are a few bits of code that might need more testing. To help decide if and where we want more testing, here are some suggestions:

Target test coverage

80% (current coverage 60%, see below for report)

Code to test more

Very important code to test better

  • [x] #28
  • [x] #29

Important code missing tests

clustering

  • [ ] test graph_clustering

distance

  • [ ] test pcDelta_grouped
  • [ ] test pcDelta_grouped_cross
  • [ ] test find_neighbor_pairs_index
  • [ ] test calculate_neighbor_numbers
  • [ ] test heirarchical_clustering

io

  • [ ] test multimerge

stats

  • [ ] test powerlaw_mle_alpha
  • [ ] #32
  • [ ] test chao1
  • [ ] test var_chao1
  • [ ] test chao2
  • [ ] test var_chao2
  • [ ] test pc_joint
  • [ ] test pc_conditional
  • [ ] test stdpc
  • [ ] #33
  • [ ] #34
  • [ ] test overlap
  • [ ] test overlap_coefficient
  • [ ] test shannon_entropy
  • [ ] test renyi2_entropy

Current test coverage

The "Missing" column tells us which lines are not yet touched at all by tests.

Name                                                                 Stmts   Miss  Cover   Missing
--------------------------------------------------------------------------------------------------
pyrepseq/__init__.py                                                     9      0   100%
pyrepseq/clustering.py                                                  28     22    21%   21-49
pyrepseq/distance.py                                                   223     98    56%   48-60, 93-106, 128-137, 182-207, 211-218, 241-246, 271-288, 309, 421-427, 445-447, 479, 492, 512, 521, 550-558
pyrepseq/io.py                                                          57     25    56%   182-185, 188, 252-255, 270-276, 296-317
pyrepseq/metric/__init__.py                                              3      0   100%
pyrepseq/metric/levenshtein.py                                          28      0   100%
pyrepseq/metric/metric.py                                               14      3    79%   19, 43, 62
pyrepseq/metric/tcr_metric/__init__.py                                   3      0   100%
pyrepseq/metric/tcr_metric/tcr_levenshtein.py                          149      8    95%   67, 72, 121, 126, 171-174
pyrepseq/metric/tcr_metric/tcr_metric.py                                25      6    76%   42, 44, 63-64, 69, 76
pyrepseq/metric/tcr_metric/tcrdist/__init__.py                           0      0   100%
pyrepseq/metric/tcr_metric/tcrdist/simplified_tcrdist_interface.py      64     11    83%   71-77, 105, 111, 126-136
pyrepseq/metric/tcr_metric/tcrdist/tcrdist_metric.py                    78      5    94%   38, 43, 82-84
pyrepseq/nn.py                                                         243     29    88%   80-81, 254-256, 490, 495-499, 518-537, 561-562, 575-578
pyrepseq/plotting.py                                                   227    199    12%   46-73, 88-93, 107-116, 125-127, 130-195, 225-240, 286-380, 407-412, 434-448, 468-490, 502-503, 508-527, 550-580
pyrepseq/stats.py                                                      171    124    27%   27-28, 43-47, 51-53, 77-92, 110-112, 164-167, 172-175, 180-187, 192-201, 221, 244-268, 273-275, 280-289, 294, 307-313, 325-333, 345-353, 370-396, 413-427
pyrepseq/util.py                                                        44     22    50%   21-32, 40-52
pyrepseq/version.py                                                     10      1    90%   13
--------------------------------------------------------------------------------------------------
TOTAL                                                                 1376    553    60%

yutanagano avatar Mar 07 '24 22:03 yutanagano

Hi @yutanagano , I'm interested in looking on to this issue, can you please assign me this task.

kachida avatar Mar 09 '24 02:03 kachida

Thanks @kachida for showing interest in helping development! If you would like to implement some working tests then feel free to submit a pull request and one of us can review the code.

yutanagano avatar Mar 11 '24 15:03 yutanagano