Here, I've refactored two aspects of the output_tables function:
The table configuration transformation loop. This is where we transform the table configuration into instructions for creating cross tabs. The table configuration is passed as the table_config argument; tests.conftest.table_configs contains an example. I've renamed variables for clarity and merged similar transformations. (The commit messages call this loop the data wrangling loop.)
The cross tabs loop. This is where we loop over the instructions for creating cross tabs and create the cross tabs themselves. Again, I've renamed variables for clarity.
Running tests.test_create_tables.TestOutputTables on main and then on this branch should give you confidence that this refactoring is successful, although see #31 for a discussion of the limitations of this test.
Here, I've refactored two aspects of the
output_tables
function:table_config
argument;tests.conftest.table_configs
contains an example. I've renamed variables for clarity and merged similar transformations. (The commit messages call this loop the data wrangling loop.)Running
tests.test_create_tables.TestOutputTables
onmain
and then on this branch should give you confidence that this refactoring is successful, although see #31 for a discussion of the limitations of this test.