Closed richfitz closed 8 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
9ba6cc6
) 99.65% compared to head (c2c2300
) 99.65%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This is a small chunk carved out of an impossibly big PR that migrated most of the functions, just showing the principle.
The idea is that the big God Class is a pain to document and a pain for users. It also fits poorly with our emerging hipercow workflows and it's hard to get meaningful chained error messages out of
cli
with. So instead we might look at having tonnes of free functions, so theobj$task_times(...)
method will becomerrq_task_times(..., controller = obj)
.For use in things like hintr, passing around an explicit controller is not that annoying, so we'll do that. For use with hipercow we will automatically register a controller when the user sets up their cluster configuration and they can just omit the
controller =
argument.This PR creates a simple
rrq_controller2
object for now (just a list, with a print method to make this a bit opaque), along with a simple default setting/clearing function. There's an internalget_controller
function that tries to do the right thing with arguments and defaults that we'll use basically everywhere. Then I've migrated over a single methodtask_list
asrrq_task_list
, along with its docs. The method version uses the new free function.Note that no tests have changed (though there are a few new ones in this PR). This will be the pattern for follow-on PRs; I will move great tracts of the package over with the same pattern and any code using the God Class will be unaffected. Then we can put a single deprecation warning into
get_controller
and bump the minor version number and update code.