opensafely / SRO-Measures

1 stars 0 forks source link

Refactor add percentiles #17

Closed iaindillingham closed 3 years ago

iaindillingham commented 3 years ago

The final commit is the most important. Changes:

There are more changes here in fewer commits than previously, however the document/test/refactor loop is the same.

I'm not sure whether you use a REPL (Read Evaluate Print Loop), or open a shell like ipython to execute code. If you do, then you can use a pytest fixture like this:

from tests import test_notebooks_utilities
measure_table = test_notebooks_utilities.measure_table.__wrapped__()

You can then use this to test compute_deciles like this:

from notebooks import utilities
utilities.compute_deciles(measure_table, "date", "value")