ekaterinailin / AltaiPony

Find flares in Kepler and TESS light curves. Notebooks for quickstart inside.
https://altaipony.readthedocs.io
MIT License
26 stars 10 forks source link

Test the preservation of units throughout the pipeline #17

Closed ekaterinailin closed 4 years ago

ekaterinailin commented 6 years ago

What needs to be created or improved?

Write tests that explicitly check units of outputs of functions if the input units are known. Question: Would this be a good use case for decorators? (@gully)

Can you provide an example?

def test_units():
    lc = get_k2sc_lc()
    flares = lc.find_flares(*args, **kwargs)
    test_find_flares(lc, flares)

#OR

@testunits
def find_flares(*args, **kwargs):
    [...]
    return flares

What is the goal / expected behaviour?

Time is given in days, but ED is typically measured in seconds, frequencies can be per hour or per year, amplitued can be relative or e-/s.

ekaterinailin commented 6 years ago

This belongs to the analysis functions rather than to the core of the program. Move to next Milestone. Do after #19

ekaterinailin commented 4 years ago

The only unit that changes is time when converted to ED. This is now simply noted in the docstrings.