uppasd_tools.collect
- uppasd_tools.collect.collect_averages(root: str | Path, name_template: str, simid: str | None = None, start: int | None = None, end: int | None = None, step: int | None = None, strict: bool = True, progress: bool = True) DataFrame
Collect averaged output columns from run directories matching a name template.
- Parameters:
root – Directory containing run subdirectories.
name_template – Folder name template with {field} placeholders used to extract variables into columns (e.g., “run_T{T}_P{P}”).
simid – Optional UppASD simid to select a specific output set within each run directory. When None, UppOut auto-detects the simid.
start – Start index for row slicing (inclusive) before averaging.
end – End index for row slicing (exclusive) before averaging.
step – Step for row slicing before averaging.
strict – When True, raise on any bad run; when False, skip with a warning. Missing output files are always skipped with an error log.
progress – When True, show a progress bar during collection.
- Returns:
DataFrame containing one row per run directory. Columns include the extracted template variables and the averaged values for Mx, My, Mz, M, and M_std.
- uppasd_tools.collect.collect_cumulants(root: str | Path, name_template: str, simid: str | None = None, start: int | None = None, end: int | None = None, step: int | None = None, strict: bool = True, progress: bool = True) DataFrame
Collect averaged cumulants columns from run directories matching a name template.
- Parameters:
root – Directory containing run subdirectories.
name_template – Folder name template with {field} placeholders used to extract variables into columns (e.g., “run_T{T}_P{P}”).
simid – Optional UppASD simid to select a specific output set within each run directory. When None, UppOut auto-detects the simid.
start – Start index for row slicing (inclusive) before averaging.
end – End index for row slicing (exclusive) before averaging.
step – Step for row slicing before averaging.
strict – When True, raise on any bad run; when False, skip with a warning. Missing output files are always skipped with an error log.
progress – When True, show a progress bar during collection.
- Returns:
DataFrame containing one row per run directory. Columns include the extracted template variables and the averaged values for M, M2, M4, Binder, chi, Cv, E, E_exch, and E_lsf.
- uppasd_tools.collect.collect_energies(root: str | Path, name_template: str, simid: str | None = None, start: int | None = None, end: int | None = None, step: int | None = None, strict: bool = True, progress: bool = True) DataFrame
Collect averaged energy columns from run directories matching a name template.
- Parameters:
root – Directory containing run subdirectories.
name_template – Folder name template with {field} placeholders used to extract variables into columns (e.g., “run_T{T}_P{P}”).
simid – Optional UppASD simid to select a specific output set within each run directory. When None, UppOut auto-detects the simid.
start – Start index for row slicing (inclusive) before averaging.
end – End index for row slicing (exclusive) before averaging.
step – Step for row slicing before averaging.
strict – When True, raise on any bad run; when False, skip with a warning. Missing output files are always skipped with an error log.
progress – When True, show a progress bar during collection.
- Returns:
DataFrame containing one row per run directory. Columns include the extracted template variables and the averaged values for tot, exch, aniso, DM, PD, BiqDM, BQ, dip, Zeeman, LSF, and chir.
- uppasd_tools.collect.collect_projavgs(root: str | Path, name_template: str, simid: str | None = None, start: int | None = None, end: int | None = None, step: int | None = None, strict: bool = True, progress: bool = True) dict[int, DataFrame]
Collect averaged projavgs columns from run directories matching a name template.
- Parameters:
root – Directory containing run subdirectories.
name_template – Folder name template with {field} placeholders used to extract variables into columns (e.g., “run_T{T}_P{P}”).
simid – Optional UppASD simid to select a specific output set within each run directory. When None, UppOut auto-detects the simid.
start – Start index for row slicing (inclusive) before averaging.
end – End index for row slicing (exclusive) before averaging.
step – Step for row slicing before averaging.
strict – When True, raise on any bad run; when False, skip with a warning. Missing output files are always skipped with an error log.
progress – When True, show a progress bar during collection.
- Returns:
Dictionary of DataFrames, one per projection index. Columns include the extracted template variables and the averaged values for M, M_std, Mx, My, and Mz.
- uppasd_tools.collect.collect_projcumulants(root: str | Path, name_template: str, simid: str | None = None, start: int | None = None, end: int | None = None, step: int | None = None, strict: bool = True, progress: bool = True) dict[int, DataFrame]
Collect averaged projcumulants columns from run directories matching a name template.
- Parameters:
root – Directory containing run subdirectories.
name_template – Folder name template with {field} placeholders used to extract variables into columns (e.g., “run_T{T}_P{P}”).
simid – Optional UppASD simid to select a specific output set within each run directory. When None, UppOut auto-detects the simid.
start – Start index for row slicing (inclusive) before averaging.
end – End index for row slicing (exclusive) before averaging.
step – Step for row slicing before averaging.
strict – When True, raise on any bad run; when False, skip with a warning. Missing output files are always skipped with an error log.
progress – When True, show a progress bar during collection.
- Returns:
Dictionary of DataFrames, one per projection index. Columns include the extracted template variables and the averaged values for M, M2, M4, Binder, and chi.
- uppasd_tools.collect.get_matching_directories(root: str | Path, name_template: str, *, sort: bool = True) dict[str, list[Path] | list[float | int | str]]
Return run subdirectories matching a folder-name template.
- Parameters:
root – Directory containing run subdirectories.
name_template – Folder name template with {field} placeholders used for matching (e.g., “run_T{T}_P{P}”).
sort – When True, return paths sorted by directory name.
- Returns:
Dictionary with - directories: list of matching run directory paths. - one key per placeholder field: list of values in directory order.