-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push massive run script no analysis yet
- Loading branch information
1 parent
70a0f52
commit c6d8623
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from autumn.projects.sm_covid2.common_school.runner_tools import ( | ||
run_full_analysis, | ||
INCLUDED_COUNTRIES, | ||
DEFAULT_RUN_CONFIG, | ||
TEST_RUN_CONFIG | ||
) | ||
import multiprocessing as mp | ||
import sys | ||
from pathlib import Path | ||
from time import time | ||
|
||
ANALYSIS = 'main' | ||
RUN_CONFIG = TEST_RUN_CONFIG | ||
|
||
if __name__ == "__main__": | ||
start_time = time() | ||
|
||
# Retrieve country iso3 to run | ||
job_array_index = int(sys.argv[1]) | ||
iso3 = list(INCLUDED_COUNTRIES['google_mobility'].keys())[job_array_index - 1] | ||
print(f"Start job #{job_array_index}, iso3={iso3}, analysis={ANALYSIS}", flush=True) | ||
|
||
# mp.set_start_method("forkserver") | ||
|
||
# create parent output directory for multi-country analysis if required | ||
analysis_name = "short_full_test_array" | ||
output_root_dir = Path.home() / "sh30/users/rragonnet/outputs/" | ||
timestamp = sys.argv[2] | ||
analysis_output_dir = output_root_dir / f"{timestamp}_{analysis_name}_{ANALYSIS}" | ||
analysis_output_dir.mkdir(exist_ok=True) | ||
|
||
# create country-specific output dir | ||
country_output_dir = analysis_output_dir / iso3 | ||
analysis_output_dir.mkdir(exist_ok=True) | ||
|
||
# _, _, _ = run_full_analysis(iso3, ANALYSIS, RUN_CONFIG, out_path) | ||
|
||
print(f"Finished in {time() - start_time} seconds", flush=True) |