MathEXLab / PySPOD

A Python package for spectral proper orthogonal decomposition (SPOD).
https://mathexlab.github.io/PySPOD/
MIT License
101 stars 30 forks source link

Test coverage #9

Closed jdmoorman closed 3 years ago

jdmoorman commented 3 years ago

The test coverage is a bit low at 66% mainly due to the low coverage (52%) of postprocessing.py and nonexistent coverage (7%) of weights.py. Adding tests that hit the following lines would greatly improve the test coverage.

See below for a full breakdown of the lines the current tests miss.

$ pip install coverage
$ coverage run -m pytest -v tests/
$ coverage report -m pyspod/*.py
Name                         Stmts   Miss  Cover   Missing
----------------------------------------------------------
pyspod/__init__.py              11      0   100%
pyspod/postprocessing.py       641    307    52%   54-58, 89, 110-115, 143, 147, 175, 183, 206, 208, 227-228, 230-231, 233, 235, 243, 266, 268, 292-293, 295, 299, 308, 351, 353, 356, 358, 366-367, 386, 390, 394, 399-462, 471-473, 480-481, 484-485, 489, 491-492, 494-495, 499, 514, 559, 561, 564, 566, 613, 623, 626, 630, 652, 654, 676, 678, 699, 701, 715, 762-950, 984, 986, 989, 991, 1000, 1005, 1030, 1041, 1050, 1064, 1095, 1098, 1100, 1108, 1110, 1122, 1131, 1144-1145, 1148-1149, 1159, 1186, 1189, 1192, 1194, 1211, 1224, 1236, 1269-1338
pyspod/spod_base.py            282     63    78%   75, 101-102, 153, 163, 203, 223, 243, 273, 283, 314-319, 326-331, 336, 340, 348-351, 354, 361, 391-401, 409-412, 420, 445-446, 454-455, 462, 471, 476, 492, 512, 514-516, 518-519, 530-535, 558, 567, 700, 782
pyspod/spod_low_ram.py         102      8    92%   84-87, 119-123
pyspod/spod_low_storage.py      98      9    91%   56, 70-74, 98-101, 135
pyspod/spod_streaming.py       116      3    97%   143-145
pyspod/weights.py               56     52     7%   13-36, 45-68, 107-123
----------------------------------------------------------
TOTAL                         1306    442    66%
mengaldo commented 3 years ago

Thank you @jdmoorman! Will fix this and come back to you.

mengaldo commented 3 years ago

@jdmoorman Thank you for the comments above - It should be now up to 89%!