Deborah.Miriam.FileIO
Deborah.Miriam.FileIO.dump_bundle_rawtrM — Methoddump_bundle_rawtrM(
bundle::Ensemble.EnsembleArrayBundle,
key_list::Vector{String},
outdir::String,
LBP::Int,
TRP::Int
) -> NothingDump raw trace moment (trMi) data from all ensembles in an Deborah.Miriam.Ensemble.EnsembleArrayBundle.
Each Deborah.Miriam.Ensemble.EnsembleArray in the bundle is dumped using its tag name as a suffix, and each ensemble within the array is saved to a separate .dat file in the given outdir.
Arguments
bundle::Ensemble.EnsembleArrayBundle: The bundle of ensemble arrays to processkey_list::Vector{String}: Ensemble names (must match order in each array)outdir::String: Directory to write output.datfilesLBP::Int: Ratio of labeled set (used in filenames)TRP::Int: Ratio of training set (used in filenames)
Output
- Writes
.datfiles for all ensembles inside eachDeborah.Miriam.Ensemble.EnsembleArray, with filenames tagged byLBP,TRP, andtag.
Notes
- Internally calls
dump_ens_array_rawtrM_by_ensemblefor eachDeborah.Miriam.Ensemble.EnsembleArrayin the bundle.
Deborah.Miriam.FileIO.dump_ens_array_rawtrM_by_ensemble — Methoddump_ens_array_rawtrM_by_ensemble(
ens_array::Ensemble.EnsembleArray,
key_list::Vector{String},
outdir::String,
LBP::Int,
TRP::Int;
suffix::String = ""
) -> NothingDump raw trace moment data (trMi) from each ensemble in ens_array to separate .dat files.
Each file will be named using the ensemble name and parameters LBP, TRP, and optional suffix, and stored in the given outdir.
Arguments
ens_array::Ensemble.EnsembleArray: The container holding all ensemble datakey_list::Vector{String}: Ensemble names (matching order ofens_array.data)outdir::String: Output directory for the dumped.datfilesLBP::Int: Ratio of labeled set (for file naming)TRP::Int: Ratio of training set (for file naming)
Keyword Arguments
suffix::String = "": Optional suffix to include in output filenames
Output
- Writes one file per ensemble in
outdir. Each line in the file includes:- Four normalized trace values ($\text{Tr} \, M^{-n} \; (n=1,2,3,4)$),
- Original configuration number,
- Source tag as a string (e.g.,
"Y_tr","Y_bc","Y_ul").
Deborah.Miriam.FileIO.print_bundle_summary — Functionprint_bundle_summary(
bundle::Ensemble.EnsembleArrayBundle,
jobid::Union{Nothing, String}=nothing
) -> NothingPrint a brief summary of an Deborah.Miriam.Ensemble.EnsembleArrayBundle, including tags and ensemble counts.
Arguments
bundle::Ensemble.EnsembleArrayBundle: Collection of multipleDeborah.Miriam.Ensemble.EnsembleArrayobjects with substitution tags.jobid::Union{Nothing, String}: Optional job identifier for logging.
Behavior
- Prints:
- The tag of the first array
- Number of ensembles in the first array
- Total number of arrays
- Number of ensembles in each array and their corresponding tag
Deborah.Miriam.FileIO.read_ensemble_array — Methodread_ensemble_array(
cfg::TOMLConfigMiriam.FullConfigMiriam,
paths::PathConfigBuilderMiriam.MiriamPathConfig;
replace_bc::Bool=false,
replace_ul::Bool=false,
jobid::Union{Nothing, String}=nothing
) -> (Ensemble.EnsembleArray{Float64}, Params{Float64}, Vector{String})Load and construct an Deborah.Miriam.Ensemble.EnsembleArray by reading trace data from multiple ensembles.
Arguments
cfg::TOMLConfigMiriam.FullConfigMiriam: Configuration object with metadata and analysis settings.paths::PathConfigBuilderMiriam.MiriamPathConfig: Path container struct with resolved directory/file paths.replace_bc::Bool=false: Iftrue, use replacement files forY_BCtoYP_BCreplace_ul::Bool=false: Iftrue, use replacement files forY_ULtoYP_UL.take_only_lb::Bool=false: Iftrue, take files forY_LBonly.jobid::Union{Nothing, String}: Optional job ID for logging and profiling output.
Returns
ens_array::Ensemble.EnsembleArray{Float64}: The loaded ensemble trace data.param::Params{Float64}: Shared lattice parameter struct.key_list::Vector{String}: Names of all ensembles in the array (ordered).
Deborah.Miriam.FileIO.read_ensemble_array_bundle — Functionread_ensemble_array_bundle(
cfg::TOMLConfigMiriam.FullConfigMiriam,
paths::PathConfigBuilderMiriam.MiriamPathConfig,
jobid::Union{Nothing, String}=nothing
) -> Tuple{Ensemble.EnsembleArrayBundle, Vector{String}}Read and construct a full Deborah.Miriam.Ensemble.EnsembleArrayBundle by loading four consistent array variants (full datasets $+$ Y_LB-only datasets with/without Y_BC replacement). Also prints a bundle summary (when jobid = nothing) and can dump raw trace matrices if requested.
Arguments
cfg::TOMLConfigMiriam.FullConfigMiriam: Global configuration containing input paths, flags, and analysis settings.paths::PathConfigBuilderMiriam.MiriamPathConfig: Resolved path builder for locating ensemble files.jobid::Union{Nothing, String}: Optional job ID used for structured logging and timing.
Loaded Variants
This function internally calls read_ensemble_array four times with the following settings and assigns the corresponding tags:
FULL-LBOG-ULOG→ full data, no replacementsreplace_bc = false,replace_ul = false,take_only_lb = false- Loads
Y_TR,Y_BC, andY_ULas originally present.
FULL-LBOG-ULML→ full data,Y_ULreplacedreplace_bc = false,replace_ul = true,take_only_lb = falseY_TRandY_BCare original;Y_ULis replaced toYP_UL.
LABL-TROG-BCOG→Y_LB-only,Y_BCoriginalreplace_bc = false,replace_ul = false,take_only_lb = true- Loads only
Y_TRandY_BC(Y_ULis entirely skipped/ignored).
LABL-TROG-BCML→Y_LB-only,Y_BCreplacedreplace_bc = true,replace_ul = false,take_only_lb = true- Loads only
Y_TRandYP_BC(Y_ULis entirely skipped/ignored).
Note: When
take_only_lb = true, anyreplace_ulsetting is effectively ignored, andUL(Y_ul/YP_ul) data are not read at all.
Behavior
- Each call to
read_ensemble_arrayis timed and logged viaDeborah.Sarah.JobLoggerTools.@logtime_benji. - The four
Deborah.Miriam.Ensemble.EnsembleArrays are combined into a singleDeborah.Miriam.Ensemble.EnsembleArrayBundlealong with the tag list:["FULL-LBOG-ULOG", "FULL-LBOG-ULML", "LABL-TROG-BCOG", "LABL-TROG-BCML"]. - The
key_list(common ensemble identifiers) is taken from the first call and reused. - If
cfg.data.dump_original == true, the function invokesDeborah.Miriam.FileIO.dump_bundle_rawtrMto persist raw trace matrices for downstream inspection. - If
jobid = nothing, a human-readable summary of the bundle is printed.
Returns
(::Ensemble.EnsembleArrayBundle, ::Vector{String}):- The constructed bundle containing the four array variants.
- The
key_listused for consistent ensemble identification across variants.
Deborah.Miriam.FileIO.secondary_tag_to_str — Methodsecondary_tag_to_str(
tag::UInt8
) -> StringConvert a numeric secondary tag into its corresponding human-readable label.
Arguments
tag::UInt8: Secondary tag value (typically0or1)
Returns
String: One of the following depending on the value:0→"Y_lb"1→"Y_ul"- Otherwise → "unknown"
Deborah.Miriam.FileIO.source_tag_to_str — Methodsource_tag_to_str(
tag::UInt8
) -> StringConvert a numeric source tag into its corresponding human-readable label.
Arguments
tag::UInt8: Source tag value (typically from0to2)
Returns
String: One of the following depending on the value:0→"Y_tr"1→"Y_bc"2→"Y_ul"- Otherwise → "unknown"