def deploy_dod_projections(disable_validation, input_state_dir, input_county_dir, output): """Generates and runs dod data projections from model outputs. Used for manual trigger # triggering persistance to s3 AWS_PROFILE=covidactnow BUCKET_NAME=covidactnow-deleteme python run.py deploy-dod-projections # deploy to the data bucket AWS_PROFILE=covidactnow BUCKET_NAME=data.covidactnow.org python run.py deploy-dod-projections # triggering persistance to local python run.py deploy-dod-projections """ for intervention in list(Intervention): # TODO(issues/#259): Split up the dod pipeline to process states/counties since states support inference # TODO(issues/#258): remove check once counties support inferrence if intervention in Intervention.county_supported_interventions(): logger.info(f"Starting to generate files for {intervention.name}.") state_result, county_result = dod_pipeline.run_projections( input_state_dir, input_county_dir, intervention, run_validation=not disable_validation ) dod_pipeline.deploy_results(state_result, output) dod_pipeline.deploy_results(county_result, output) logger.info('finished dod job')
def deploy_counties_api(disable_validation, input_dir, output, summary_output): """The entry function for invocation""" for intervention in list(Intervention): # TODO(issues/#258): remove check once counties support inferrence if intervention in Intervention.county_supported_interventions(): county_result = api_pipeline.run_projections( input_dir, AggregationLevel.COUNTY, intervention, run_validation=not disable_validation, ) county_summaries, county_timeseries = api_pipeline.generate_api( county_result, input_dir ) api_pipeline.deploy_results([*county_summaries, *county_timeseries], output) counties_summary = api_pipeline.build_counties_summary(county_summaries, intervention) counties_timeseries = api_pipeline.build_counties_timeseries(county_timeseries, intervention) summarized_timeseries = api_pipeline.build_prediction_header_timeseries_data(counties_timeseries) api_pipeline.deploy_prediction_timeseries_csvs(summarized_timeseries, summary_output) api_pipeline.deploy_results([counties_summary], summary_output, write_csv=True) api_pipeline.deploy_results([counties_timeseries], summary_output) logger.info("finished top counties job")