Skip to content

Path Utility

Output path resolution utilities for ReaxKit workflows.

This module centralizes the logic used to determine where analysis results, exports, and generated files are written. By default, outputs are placed under a standardized directory structure:

reaxkit_outputs/<workflow>/<filename>

If the user supplies an explicit path (absolute or containing directories), that path is respected exactly.

resolve_output_path(user_value, workflow)

Resolve the output path for a workflow result.

If the user provides only a bare filename, the file is written under reaxkit_outputs/<workflow>/. If the user provides an absolute path or a path containing directories, that path is used directly.

Parameters:

Name Type Description Default
user_value str

User-specified output path or filename.

required
workflow str

Name of the workflow producing the output.

required

Returns:

Type Description
Path

Resolved output path with parent directories created if needed.

Examples:

>>> resolve_output_path("results.csv", workflow="xmolout")
>>> resolve_output_path("out/results.csv", workflow="fort7")