odatse.scripts.summarize_each_T module#

odatse.scripts.summarize_each_T.extract_columns(file_path, export_dir, replica_per_proc, written)[source]#

Extract the final population (one row per walker) from a result file.

Selects the final sample of each walker, drops the step / walker_id / ancestor columns, and writes the remaining columns to a per-temperature output file.

When replica_per_proc > 0 the last replica_per_proc rows are taken (they are the final population). Otherwise the final sample of each walker is selected as the row with the largest step per walker id (column 1), so walkers that ended at different steps are handled correctly.

Output files are aggregated across all input files of a run: the first time a given output file is written in this run it is truncated (written tracks that), so re-running does not duplicate data.

Parameters:
  • file_path (str) – Path to the input data file.

  • export_dir (str) – Directory where the output file will be saved.

  • replica_per_proc (int) – Number of final rows to extract (<= 0 selects the last step per walker).

  • written (set) – Set of output paths already written in this run (mutated here).

Note

format of input data file:

step walker_id T(or beta) fx x1 … xN weight ancestor

format of output file:

T(or beta) fx x1 … xN weight

odatse.scripts.summarize_each_T.main()[source]#

Main function to parse arguments and execute data extraction.

odatse.scripts.summarize_each_T.read_toml(input_filename)[source]#

Reads the TOML configuration file and extracts required parameters.

Parameters:

input_filename (str) – Path to the TOML configuration file.

Returns:

Contains ‘replica_per_proc’ and ‘output_dir’ extracted from the config.

Return type:

dict