kingjml / pySnowRadar

Snow radar data processing and snow depth retrieval
MIT License
8 stars 3 forks source link

Add some tests (pytest) and update how pyWavelet is imported #8

Closed m9brady closed 5 years ago

m9brady commented 5 years ago

Tests and module usage changes Test coverage is only 62% so there is room for improvement (especially with testing for unexpected inputs) and there may be a need for updating existing test functions with better expected values. The only code not currently covered is in atm.py, picklayers.py and qc.py. I'm not sure if we're keeping atm.py or qc.py around?

There is a gentle introduction to pytest test functions in tests/test_rough_example.py.

The new README.md covers how to get started with the pyWavelet module using pip install . from a cloned copy of this repository. This is to get people in the habit of pip-installing the package to a Python environment rather than cloning the repository and importing modules locally.

The three notebooks demo.ipynb, awi.ipynb and retrieval_test.ipynb have been updated to reflect the changes in using the pyWavelet module as well as accessing the radar data arrays (i.e. OIB.data_radar rather than OIB.data)

Changes to pyWavelet code Changed the behaviour of timefunc.utcleap to expect a single float value rather than variable-length lists and tuples.

Also fixed the SnowRadar.as_dict() method to be super-generic for SnowRadar parent class, but extended with more information in OIB and AWI child classes :cake: