vm_parallelization
check_existing_outputs(file_list_path, output_summary_dir, limit_files=None)
Check which files already have outputs and which need processing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_list_path
|
str
|
Path to the file list CSV |
required |
output_summary_dir
|
str
|
Base output directory |
required |
limit_files
|
int
|
Limit to first N files for testing (None for all) |
None
|
Source code in fpg_observational_model/vm_parallelization.py
check_output_exists(sim_name, output_summary_dir, required_files=None)
Check if output files already exist for a simulation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sim_name
|
str
|
Name of the simulation |
required |
output_summary_dir
|
str
|
Base output directory |
required |
required_files
|
list
|
List of required file suffixes to check for |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
True if all required outputs exist, False otherwise |
Source code in fpg_observational_model/vm_parallelization.py
filter_processed_files(file_list_df, output_summary_dir, check_outputs=True)
Filter out files that have already been processed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_list_df
|
DataFrame
|
DataFrame with simulation info |
required |
output_summary_dir
|
str
|
Base output directory |
required |
check_outputs
|
bool
|
Whether to check for existing output files |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
(to_process_df, already_processed_df) |
Source code in fpg_observational_model/vm_parallelization.py
process_all_files(file_list_path, output_summary_dir, config_path=None, max_workers=None, verbose=False, skip_existing=True)
Process all files in parallel using multiprocessing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_list_path
|
str
|
Path to CSV file with 'output_name' and 'input_dir' columns |
required |
output_summary_dir
|
str
|
Directory to save all outputs |
required |
config_path
|
str
|
Path to config file (optional, will use defaults if not provided) |
None
|
max_workers
|
int
|
Maximum number of parallel processes (None = use all CPUs) |
None
|
verbose
|
bool
|
Whether to enable verbose logging |
False
|
skip_existing
|
bool
|
Whether to skip files that already have outputs |
True
|
Source code in fpg_observational_model/vm_parallelization.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
setup_logging(output_dir)
Set up logging for parallel processing.
Source code in fpg_observational_model/vm_parallelization.py
validate_file_list(file_list_path, limit_files=None)
Validate the file list and check if input directories exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_list_path
|
str
|
Path to the file list CSV |
required |
limit_files
|
int
|
Limit to first N files for testing (None for all) |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
(valid_df, invalid_df) - DataFrames of valid and invalid entries |