aburrell / ocbpy

Convert between magnetic and adaptive, polar boundary coordinates
BSD 3-Clause "New" or "Revised" License
7 stars 7 forks source link

TST: Improve coverage #108

Closed aburrell closed 2 years ago

aburrell commented 2 years ago

Description

Improved unit test coverage and updated docstrings. Fixes #79.

Also improved the VectorData class by turning many attributes into properties that are tested and updated consistently even after class initialization.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Added unit tests.

Test Configuration:

Checklist:

coveralls commented 2 years ago

Coverage Status

Coverage decreased (-1.7%) to 80.445% when pulling d0751e5ad97b1a9303357aea0d95bcbcd74321a6 on improve_coverage into 1c0a8b3828b113e22f5817188b5b056501cee99a on develop.

aburrell commented 2 years ago

Local coverage report:

aburrell@lazyworm ocbpy % /opt/local/bin/coverage-3.9 report -m               
Name                                     Stmts   Miss  Cover   Missing
----------------------------------------------------------------------
ocbpy/__init__.py                           17      0   100%
ocbpy/_boundary.py                         644      0   100%
ocbpy/boundaries/__init__.py                 7      2    71%   12-13
ocbpy/boundaries/dmsp_ssj_files.py         147      6    96%   36-37, 119-120, 200, 460
ocbpy/boundaries/files.py                   64      0   100%
ocbpy/cycle_boundary.py                    116      0   100%
ocbpy/instruments/__init__.py               10      2    80%   15-16
ocbpy/instruments/general.py               108      2    98%   250-253
ocbpy/instruments/pysat_instruments.py     187      3    98%   19-22
ocbpy/instruments/supermag.py              118      0   100%
ocbpy/instruments/vort.py                  137      0   100%
ocbpy/ocb_correction.py                     27      0   100%
ocbpy/ocb_scaling.py                       545      1    99%   959
ocbpy/ocb_time.py                          107      0   100%
ocbpy/ocboundary.py                         23      0   100%
ocbpy/tests/__init__.py                      0      0   100%
ocbpy/tests/test_boundary_dual.py          571      1    99%   182
ocbpy/tests/test_boundary_eab.py           211      0   100%
ocbpy/tests/test_boundary_ocb.py           619      0   100%
ocbpy/tests/test_cycle_boundary.py         231      0   100%
ocbpy/tests/test_dmsp_ssj_files.py         309      8    97%   304-305, 460-464, 627-630
ocbpy/tests/test_files.py                  172      0   100%
ocbpy/tests/test_general.py                188      0   100%
ocbpy/tests/test_ocb_correction.py          46      0   100%
ocbpy/tests/test_ocb_scaling.py            789      0   100%
ocbpy/tests/test_ocb_time.py               176      0   100%
ocbpy/tests/test_ocboundary.py             172      0   100%
ocbpy/tests/test_pysat.py                  887     14    98%   25-26, 103, 236-238, 309, 718, 780, 841, 901, 961, 1045, 1482
ocbpy/tests/test_supermag.py               103      0   100%
ocbpy/tests/test_vort.py                   156      0   100%
----------------------------------------------------------------------
TOTAL                                     6887     39    99%

Though I am not sure how ocb_scaling.py is not 100%, because I put a RuntimeError there to test that it is covered, and it is.