modelarrayio.cli.utils

Shared CLI helpers for logging, outputs, and result metadata.

Functions

configure_logging(log_level)

Configure package logging once for CLI entry points.

prefixed_output_path(output_path, prefix)

Return output path with a sanitized prefix added to its filename.

prepare_output_directory(output_dir, logger)

Create an output directory and warn when reusing an existing path.

prepare_output_parent(output_file)

Ensure the parent directory for an output file exists.

read_result_names(h5_file, analysis_name, ...)

Read result names from HDF5 metadata, with compatibility fallbacks.

sanitize_result_name(result_name)

Normalize an analysis result name for use in filenames.

write_hdf5_parcel_arrays(h5_file, parcel_arrays)

Write parcellated CIFTI parcel name arrays as HDF5 string datasets.

write_hdf5_scalar_matrices(h5_file, scalars, ...)

Write per-scalar matrices into an open HDF5 file.

write_table_dataset(h5_file, dataset_name, ...)

Write a dataframe as a transposed HDF5 dataset with column metadata.

write_tiledb_parcel_arrays(base_uri, ...)

Write parcellated CIFTI parcel name arrays as TileDB string arrays.

write_tiledb_scalar_matrices(output_dir, ...)

Write per-scalar matrices into a TileDB directory.