def task_download_place_boundaries(): """ Download place boundaries for each relevant state """ tiger = TIGER() for state in list_states(): yield { 'name': state, 'file_dep': [util.path.CONFIG_PATH], 'actions': [(tiger.download_place_boundaries, (state, ))], 'targets': [tiger.place_boundaries_path(state)], 'uptodate': [doit.tools.run_once], }
def task_create_tiger_directories(): """ Create TIGER's directories """ tiger = TIGER() return { 'file_dep': [util.path.CONFIG_PATH], 'targets': tiger.directories, 'actions': [tiger.create_directories], 'uptodate': [True], }
def task_download_county_boundaries(): """ Download county boundaries from the TIGER shapefiles """ tiger = TIGER() file = tiger.county_boundaries_path return { 'file_dep': [util.path.CONFIG_PATH], 'targets': [file], 'actions': [tiger.download_county_boundaries], 'uptodate': [doit.tools.run_once], }
def task_download_state_boundaries(): """ Download state boundaries from the ACS website """ tiger = TIGER() file = tiger.state_boundaries_path return { 'file_dep': [util.path.CONFIG_PATH], 'targets': [file], 'actions': [tiger.download_state_boundaries], 'uptodate': [True], }
def task_guess_states(): """ Guess the state for each department """ tiger = TIGER() for dept in Department.list(): yield { 'name': dept.name, 'file_dep': [ tiger.state_boundaries_path, dept.preprocessed_shapefile_path, ], 'targets': [dept.guessed_state_path], 'actions': [dept.guess_state], 'clean': True, }