Add doctests as part of CI pipeline + 1 fix in utils.py
I've found a way to have pytest run doctests when it runs its usual unit tests, so I've gone ahead and turned that option on in the CI pipeline as well as adding a few doctests both in names.py
and utils.py
where adding unit tests for simple functions like these seem a bit of overkill. There's a lot of places where I'd want to add doctests, although it's low on my priority list so hopefully this will be a good starting point in case we add more functions, etc, we can just include the relevant doctest as we're developing.
As part of this, I found an inconsistency in utils.time_in_segment
, where the return type is O or 1 rather than a boolean like it is for utils.time_in_segment
and utils.times_in_segments
, so I went along and cast this to a boolean before returning. It should have the same behavior downstream.