A comprehensive conductor script for the PICurv simulation platform. More...
Go to the source code of this file.
Data Structures | |
| class | picurv_cli.core._LazyNumpyProxy |
Module-like proxy that preserves picurv.np without eager import. More... | |
| class | picurv_cli.core.CommandExecutionError |
| Raised when an external command exits unsuccessfully. More... | |
| class | picurv_cli.core.PlotDependencyError |
| Raised when plot.gen reports a missing optional dependency. More... | |
Namespaces | |
| namespace | picurv_cli |
| namespace | picurv_cli.core |
Functions | |
| picurv_cli.core._prune_incompatible_python_site_paths (paths) | |
| Remove site-package paths for a different Python major/minor version. | |
| picurv_cli.core._drop_imported_package (str package_name) | |
| Remove a failed/partial import package tree from sys.modules. | |
| picurv_cli.core.require_numpy () | |
| Import NumPy only for commands that need numeric reductions. | |
| picurv_cli.core.optional_matplotlib_pyplot () | |
| Import matplotlib.pyplot lazily for study plot generation. | |
| str | picurv_cli.core._read_release_version () |
| Read the single release version shared by every PICurv executable. | |
| dict | picurv_cli.core._source_build_identity (str release_version) |
| Resolve reproducible release, commit, and dirty-tree build identity. | |
| picurv_cli.core._find_named_file_upwards (str start, str filename) | |
| Find a named file at or above an arbitrary filesystem anchor. | |
| picurv_cli.core.find_workspace_root (*anchors) | |
| Locate the nearest initialized PICurv workspace for supplied anchors. | |
| dict | picurv_cli.core.load_workspace_config (str workspace_root) |
| Load and validate the immutable workspace identity/configuration file. | |
| dict | picurv_cli.core.enforce_workspace_version (str workspace_root) |
| Enforce an optional workspace PICurv version requirement. | |
| dict | picurv_cli.core.enforce_reproducibility_policy (str workspace_root) |
| Enforce an optional workspace policy demanding a clean, released build. | |
| str | picurv_cli.core.resolve_workspace_path (str anchor_file, str candidate, *bool allow_external=False) |
| Resolve a user path against its workspace and reject implicit escapes. | |
| None | picurv_cli.core.ensure_workspace_layout (str workspace_root) |
| Materialize the uniform, cheap directory skeleton for one workspace. | |
| str | picurv_cli.core.initialize_workspace_root (str workspace_root, str template_name) |
| Create the workspace skeleton and its identity file at one root. | |
| None | picurv_cli.core.ensure_run_layout (str run_dir) |
| Materialize the uniform, cheap directory skeleton for one run. | |
| tuple | picurv_cli.core.validate_run_directory_structure (str run_dir) |
| Refuse a run whose root has grown a directory the layout does not define. | |
| None | picurv_cli.core.enforce_run_directory_structure (str run_dir) |
Apply validate_run_directory_structure() as a refusal at run time. | |
| str | picurv_cli.core.case_run_label (dict case_cfg, str case_path) |
| Resolve the stable human-facing portion of a generated run identifier. | |
| str | picurv_cli.core.allocate_generated_run_id (str runs_root, dict case_cfg, str case_path) |
| Build the generated run identity, disambiguating a same-second collision. | |
| bool | picurv_cli.core.discard_unused_run_directory (str run_dir, *bool created) |
| Remove a generated run directory that never received any content. | |
| picurv_cli.core._file_sha256 (str path) | |
| Content digest of one file, or None when it cannot be read. | |
| dict | picurv_cli.core.build_software_lock () |
| Capture the exact software identity a run is about to execute with. | |
| dict | picurv_cli.core._toolchain_identity () |
| Best-effort record of the PETSc, MPI, and compiler the binaries were built on. | |
| str | picurv_cli.core.write_software_lock (str run_dir) |
| Write the run's software lock beside its asset lock. | |
| str | picurv_cli.core.workspace_artifact_root (str workspace_root, str kind) |
| Return the canonical workspace-owned root for runs or studies. | |
| picurv_cli.core._relative_to_workspace (str path, str workspace_root) | |
| Return a portable workspace-relative path when possible. | |
| dict | picurv_cli.core.snapshot_run_configuration (str run_dir, dict source_paths, bool continuation=False) |
| Snapshot editable YAML inputs without erasing prior continuation state. | |
| dict | picurv_cli.core.load_active_run_configuration (str run_dir) |
| Load the active immutable configuration revision for a run. | |
| dict | picurv_cli.core.archive_active_generated_configuration (str run_dir, list paths) |
| Preserve generated control sidecars beside a continuation's YAML revision. | |
| dict | picurv_cli.core._run_component_states (str run_dir, dict stages_requested) |
| Report each run component's home, retention class, and lifecycle state. | |
| dict | picurv_cli.core.build_run_lineage (str parent_run_dir, int checkpoint_step, *workspace_root=None, statistics_state=None, requested_source=None) |
| Record which run and which checkpoint a branched run was started from. | |
| dict | picurv_cli.core.build_run_manifest (str run_dir, str run_id, *workspace_root=None, str launch_mode="local", int num_procs=1, int post_num_procs=1, stages_requested=None, stages_completed=None, inputs=None, asset_lock=None, submission=None, lineage=None, str artifact_type="run", study_id=None, case_id=None) |
| Build the authoritative run identity, topology, and lifecycle manifest. | |
| str | picurv_cli.core._checkpoint_bundle_path (str source_dir, int step) |
| Resolve a run/output root or an exact checkpoint bundle. | |
| dict | picurv_cli.core._read_checkpoint_options (str metadata_path) |
| Parse the deliberately small PETSc-options checkpoint manifest. | |
| dict | picurv_cli.core.validate_committed_checkpoint (str source_dir, int step, bool require_particles=False) |
| Validate one committed bundle using the same manifest contract as C. | |
| "set[int]" | picurv_cli.core._scan_committed_checkpoint_steps (str source_dir, bool require_particles=False) |
| Return only fully validated, committed checkpoint steps. | |
| int | picurv_cli.core.parse_slurm_time_limit_to_seconds (str time_text) |
| Parse a Slurm time-limit string into total seconds. | |
| "dict | None" | picurv_cli.core.resolve_walltime_guard_policy ("dict | None" cluster_cfg) |
| Resolve the effective Slurm walltime-guard policy for generated solver jobs. | |
| dict | picurv_cli.core.build_walltime_guard_exports ("dict | None" cluster_cfg) |
| Build shell-evaluated environment exports for the runtime walltime guard. | |
| str | picurv_cli.core.resolve_runtime_executable (str executable_name) |
| Resolve solver/post executable path, preferring local sibling binaries. | |
| dict | picurv_cli.core.read_binary_build_identity (str executable_path) |
| Read the build identity a native executable was compiled with. | |
| dict | picurv_cli.core.runtime_build_identities () |
| Read the build identity of every native executable a run would launch. | |
| list | picurv_cli.core.build_identity_problems (dict identities, workspace_requirement=None) |
| Report every reason the active build identity is not internally coherent. | |
| list | picurv_cli.core.warn_on_stale_runtime_binaries (dict identities) |
| Report native executables whose build identity is not the active source. | |
| str | picurv_cli.core._sanitize_error_field (value) |
| Normalize error fields into a single-line string. | |
| picurv_cli.core.emit_structured_error (str code, str key="-", str file_path="-", str message="", str hint=None, stream=None) | |
| Emit one standardized error line for tooling and users. | |
| picurv_cli.core.fail_cli_usage (str message, str hint=None) | |
| Emit a structured CLI usage error and exit with code 2. | |
| picurv_cli.core._split_error_file_and_message (str raw_error) | |
| Separate a validation error into its source-file and message fields when possible. | |
| str | picurv_cli.core._extract_key_path (str message) |
| Best-effort key-path extraction from free-form validation messages. | |
| str | picurv_cli.core._classify_error_code (str message) |
| Map existing validation/error messages to the standardized code set. | |
| dict | picurv_cli.core.read_yaml_file (str filepath) |
| Safely reads a YAML file and returns its content. | |
| picurv_cli.core.write_yaml_file (str filepath, dict data) | |
| Write YAML with stable ordering for generated study artifacts. | |
| picurv_cli.core.write_json_file (str filepath, dict payload) | |
| Write JSON metadata/manifests with a stable, readable format. | |
| str | picurv_cli.core.write_runtime_execution_file (str filepath, str template_source_path=None) |
| Write a default runtime execution config, copying a source template when available. | |
| bool | picurv_cli.core._launcher_arg_contains_whitespace (token) |
| Return True when a launcher arg token contains embedded whitespace and should be split. | |
| "str | None" | picurv_cli.core.resolve_runtime_execution_seed_source (str source_project_root) |
| Prefer repo-local ignored runtime config, then tracked example, then built-in defaults. | |
| dict | picurv_cli.core.ensure_case_runtime_execution_config (str case_dir, str source_project_root, bool overwrite=False) |
| Create case-local runtime execution config if missing, seeded from repo-local config when available. | |
| bool | picurv_cli.core.is_project_root (str candidate) |
| Return True when a directory looks like the PICurv source repository root. | |
| picurv_cli.core._iter_parent_dirs (str start_path) | |
| Yield a path and all of its parents up to filesystem root. | |
| picurv_cli.core.find_project_root_upwards (str start_path) | |
| Search upward from an anchor and return the first matching project root. | |
| picurv_cli.core.discover_local_project_root (*extra_anchors) | |
| Best-effort source repo discovery from runtime anchors. | |
| picurv_cli.core.find_case_origin_metadata_file (str case_dir_hint=None) | |
| Find the nearest case-origin metadata file from known runtime anchors. | |
| picurv_cli.core.load_case_origin_metadata (str case_dir_hint=None) | |
| Load case-origin metadata if present, returning (case_dir, metadata_path, payload). | |
| picurv_cli.core.find_runtime_execution_config_file (*anchors) | |
| Find the nearest optional execution config from runtime/case anchors. | |
| dict | picurv_cli.core._normalize_execution_override_section (dict payload, str section_name, str config_path, str config_label) |
| Validate one execution override section while preserving missing-vs-empty semantics. | |
| picurv_cli.core.load_runtime_execution_config (str config_search_anchor=None, extra_search_anchors=None) | |
| Load optional shared execution launcher config from the nearest runtime config file. | |
| dict | picurv_cli.core.merge_execution_overrides ("dict | None" base, "dict | None" override) |
| Merge execution overrides, letting explicit override values win key-by-key. | |
| dict | picurv_cli.core.resolve_runtime_execution_context (dict runtime_execution_cfg, str context) |
| Resolve default plus context-specific execution overrides. | |
| str | picurv_cli.core.get_git_commit (str repo_root=None) |
| Best-effort git commit lookup for run/study manifests and case metadata. | |
| picurv_cli.core.write_case_origin_metadata (str case_dir, str source_project_root, str template_name=None, dict existing=None, template_managed_files=None) | |
| Create or refresh case-origin metadata for repo-aware case maintenance commands. | |
| bool | picurv_cli.core.make_args_include_explicit_goal ("list[str]" make_args) |
| Return True when make args contain an explicit target rather than only options/assignments. | |
| picurv_cli.core.resolve_case_origin_context (str case_dir_hint=None, str source_root_override=None, str template_name_override=None) | |
| Resolve case directory, source repo root, and optional template metadata. | |
| picurv_cli.core.require_project_root (str candidate, str purpose) | |
| Validate that a source repo root was resolved and is structurally valid. | |
| picurv_cli.core.require_existing_case_dir (str case_dir, str purpose, str source_project_root=None) | |
| Validate that a target case directory exists and is not the source repo root. | |
| picurv_cli.core.resolve_template_directory (str source_project_root, str template_name) | |
| Resolve an example template directory inside the source repository. | |
| picurv_cli.core.list_template_relative_files (str template_dir, excluded_rel_paths=None) | |
| List all files in a template directory as case-relative paths. | |
| picurv_cli.core.list_source_binaries (str source_project_root) | |
| List binary artifacts currently available in the source repo bin directory. | |
| picurv_cli.core.sync_case_binaries (str case_dir, str source_project_root) | |
| Copy current source-repo binaries into a case directory for version-pinning. | |
| picurv_cli.core.sync_case_template_files (str case_dir, str template_dir, bool overwrite=False, bool prune=False, managed_rel_paths=None) | |
| Sync template files into a case directory, preserving modified files unless overwrite is requested. | |
| picurv_cli.core.compute_case_source_status (str case_dir, str source_project_root, str template_name=None, dict metadata=None) | |
| Compute source/case drift across commits, binaries, and template-managed files. | |
| picurv_cli.core.print_case_source_status (dict status) | |
| Render human-readable source/case drift details. | |
| picurv_cli.core.status_source_command (args) | |
| Report source/case drift for an initialized case directory. | |
| str | picurv_cli.core.resolve_path (str anchor_file, str candidate) |
| Resolve a potentially relative path against a source YAML file path. | |
| picurv_cli.core._mapping_value_with_aliases (dict mapping, *keys, default=None) | |
| Return the first defined value from a mapping across alias keys. | |
| picurv_cli.core.get_post_run_control_value (dict post_cfg, str canonical_key, default=None) | |
| Resolve post run_control values with backwards-compatible legacy aliases. | |
| None | picurv_cli.core.warn_on_grid_generator_hyphen_keys (dict generator, str case_path, list warnings) |
| Warn when grid.generator uses unsupported hyphenated wrapper keys. | |
| list | picurv_cli.core.reject_generator_destination_keys (generator, str case_path, str label) |
| Reject generator settings that try to choose their own output destination. | |
| picurv_cli.core.get_post_source_data (dict post_cfg) | |
| Return source_data as a mapping when valid, else an empty mapping. | |
| str | picurv_cli.core.get_post_source_directory_template (dict post_cfg, str default="<solver_output_dir>") |
| Resolve the source directory template from source_data with a safe default. | |
| picurv_cli.core.get_post_input_extensions (dict post_cfg) | |
| Return post input_extensions, preferring io. | |
| picurv_cli.core.get_post_statistics_task_tokens (dict post_cfg) | |
| Return normalized statistics pipeline tokens that will be written into post.run. | |
| str | picurv_cli.core.get_monitor_output_directory (dict monitor_cfg, str default="output") |
| Resolve the solver output root from monitor.yml, preserving the default layout. | |
| str | picurv_cli.core.get_post_statistics_output_prefix (dict post_cfg, str default="Stats") |
| Resolve the statistics CSV prefix, preserving legacy top-level override support. | |
| str | picurv_cli.core.resolve_post_statistics_output_prefix (dict post_cfg, monitor_cfg=None, str default="Stats") |
| Resolve the runtime statistics prefix, routing bare basenames under the monitor output root. | |
| picurv_cli.core.get_post_statistics_output_artifacts (dict post_cfg, str run_dir, monitor_cfg=None) | |
| Predict statistics CSV output paths relative to the postprocessor runtime cwd. | |
| dict | picurv_cli.core.normalize_post_spectra_config (dict post_cfg) |
| Validate and canonicalize the spectra block of post.yml. | |
| list | picurv_cli.core.validate_post_spectra_preconditions (dict spectra_cfg, dict case_cfg, str post_path) |
| Check spectra tasks against what the case can actually support. | |
| str | picurv_cli.core._resolve_spectra_payload (dict bundle, str kind, str field, int block) |
| Locate one checkpoint payload by its inventory entry rather than by path shape. | |
| list | picurv_cli.core._spectra_mean_arguments (dict task_cfg, dict bundle, dict mean_bundle=None) |
| Build the generator arguments implementing a task's fluctuation choice. | |
| set | picurv_cli.core.resolve_post_stage_selection (only) |
Resolve the --only selector into the set of post stages to execute. | |
| dict | picurv_cli.core.run_post_spectra_stage (str run_dir, dict post_cfg, dict monitor_cfg, str source_dir, steps, bool quiet=False) |
| Measure spectra for every requested task across a window of committed steps. | |
| str | picurv_cli.core.compute_post_spectra_signature (dict spectra_cfg) |
| Reduce a normalized spectra recipe to a stable identity string. | |
| str | picurv_cli.core.resolve_post_spectra_output_dir (monitor_cfg=None) |
| Resolve the run-relative directory spectra CSVs are written to. | |
| str | picurv_cli.core.resolve_recipe_spectra_output_dir (dict post_cfg, monitor_cfg=None) |
| Resolve the canonical spectra directory for one versioned recipe. | |
| list | picurv_cli.core.get_post_spectra_output_artifacts (dict post_cfg, str run_dir, monitor_cfg=None) |
| Predict the spectra CSV paths a recipe will write. | |
| str | picurv_cli.core.post_spectra_task_basename (dict task_cfg, str output_prefix) |
| Build the file basename one normalized spectra task writes. | |
| dict | picurv_cli.core.normalize_post_field_statistics_config (dict post_cfg) |
| Validate and canonicalize the field_statistics block of post.yml. | |
| int | picurv_cli.core._post_window_derived_field_count (dict window_cfg, list outputs) |
| Count the derived fields one window would produce for a set of outputs. | |
| bool | picurv_cli.core._post_requests_field_statistics (dict post_cfg) |
| Return whether the current post recipe derives accumulated field statistics. | |
| picurv_cli.core.get_post_field_statistics_artifacts (dict post_cfg, str run_dir) | |
| Predict the per-window statistics artifacts a recipe will produce. | |
| dict | picurv_cli.core.build_post_recipe_config (dict post_cfg, monitor_cfg=None) |
| Build the flat key=value mapping consumed by the C post-processor. | |
| str | picurv_cli.core.compute_post_recipe_id (dict post_cfg) |
| Compute a stable human-readable identity for one post recipe. | |
| "tuple[dict, str]" | picurv_cli.core.apply_canonical_post_paths (dict post_cfg, str run_dir) |
| Route every post artifact into its fixed analysis or visualization home. | |
| dict | picurv_cli.core.normalize_post_recipe_signature (dict recipe_cfg) |
| Normalize post recipe settings into a stable signature mapping. | |
| "tuple[dict, str]" | picurv_cli.core.compute_post_recipe_fingerprint (dict recipe_cfg) |
| Return normalized recipe signature plus SHA-256 fingerprint. | |
| picurv_cli.core.parse_post_recipe_file (str post_recipe_path) | |
| Parse an existing generated post.run file into a key/value mapping. | |
| str | picurv_cli.core.get_post_resume_state_path (str run_dir, dict post_cfg=None) |
| Return the JSON resume metadata path for a run directory. | |
| str | picurv_cli.core.get_post_recipe_root (str run_dir, dict post_cfg) |
| Return the versioned run-local control directory for one post recipe. | |
| dict | picurv_cli.core.get_post_lock_paths (str run_dir, str recipe_id=None) |
| Return lock-wrapper related paths for a run directory. | |
| str | picurv_cli.core._post_output_directory_abs (str run_dir, dict post_cfg) |
| Resolve the absolute post output directory for the current recipe. | |
| bool | picurv_cli.core._post_requests_eulerian_output (dict post_cfg) |
| Return whether the current post recipe expects Eulerian VTK output artifacts. | |
| bool | picurv_cli.core._post_requests_particle_output (dict post_cfg) |
| Return whether the current post recipe expects particle VTP output artifacts. | |
| bool | picurv_cli.core._post_requests_statistics (dict post_cfg) |
| Return whether the current post recipe expects statistics CSV artifacts. | |
| bool | picurv_cli.core._post_needs_particle_source (dict post_cfg) |
| Return whether the current post recipe requires particle source files to be present. | |
| picurv_cli.core._iter_post_steps (int start_step, int end_step, int step_interval) | |
| Yield configured post-processing steps inclusively. | |
| "tuple[int, int, int]" | picurv_cli.core.resolve_post_requested_window (dict post_cfg, dict case_cfg=None) |
| Resolve post requested start/end/interval, expanding end=-1 via case.yml when available. | |
| dict | picurv_cli.core.prepare_effective_post_config (dict post_cfg, str resolved_source_dir, int start_step=None, int end_step=None) |
| Return a copy of post_cfg with resolved source dir and optional effective bounds. | |
| "set[int]" | picurv_cli.core._scan_post_vtk_steps (str prefix_path, str extension) |
| Collect step numbers from VTK files named with a prefix, step suffix, and extension. | |
| "set[int]" | picurv_cli.core._scan_post_statistics_csv_steps (str csv_path) |
| Scan step ids from the first CSV column of a statistics artifact. | |
| "list[set[int]]" | picurv_cli.core.collect_post_completion_families (str run_dir, dict post_cfg, monitor_cfg=None) |
| Collect per-family completed-step sets for the current post recipe. | |
| dict | picurv_cli.core.detect_post_completed_frontier (str run_dir, dict post_cfg, monitor_cfg, int start_step, int end_step, int step_interval) |
| Detect the highest contiguous fully completed post step for the current recipe. | |
| picurv_cli.core._nearest_step ("set[int]" steps, int target) | |
| Return the complete source step nearest to a target step. | |
| str | picurv_cli.core._format_optional_step (step) |
| Format an optional step number for user-facing diagnostics. | |
| "tuple[set[int], dict]" | picurv_cli.core._scan_complete_source_steps (str source_dir, dict monitor_cfg, dict post_cfg) |
| Scan source artifacts and return steps with every file required by the recipe. | |
| "list[str]" | picurv_cli.core._expected_source_paths_for_step (int step, dict source_scan, dict post_cfg) |
| Build required source file paths for a single post-processing step. | |
| dict | picurv_cli.core.detect_post_source_frontier (str source_dir, dict monitor_cfg, dict post_cfg, int start_step, int end_step, int step_interval) |
| Detect the highest contiguous fully available source step for live post-processing. | |
| picurv_cli.core.persist_post_resume_state (str run_dir, dict plan, last_successful_requested_end_step=None) | |
| Persist post resume lineage metadata for future –continue runs. | |
| str | picurv_cli.core._build_post_lock_wrapper_source () |
| Return the Python wrapper used to hold an exclusive post-stage lock. | |
| str | picurv_cli.core.ensure_post_lock_wrapper (str run_dir) |
| Ensure the lock wrapper exists for a run directory and return its path. | |
| "tuple[list, dict]" | picurv_cli.core.build_post_locked_command (str run_dir, str recipe_fingerprint, list wrapped_command, bool create_wrapper=True) |
| Wrap a postprocessor command behind the run-dir-scoped lock wrapper. | |
| dict | picurv_cli.core.build_post_execution_plan (str run_dir, str run_id, dict case_cfg, dict monitor_cfg, dict post_cfg, bool continue_requested=False, bool allow_source_frontier_scan=True) |
| Resolve post resume/source-availability behavior into one execution plan. | |
| bool | picurv_cli.core.needs_restart_source (dict case_cfg, dict solver_cfg) |
| Return True when the solver requires restart data from disk. | |
| str | picurv_cli.core.resolve_run_output_dir (str run_dir, dict monitor_cfg) |
| Resolve the output data directory within a run directory. | |
| str | picurv_cli.core.resolve_run_restart_dir (str run_dir, dict monitor_cfg) |
| Resolve the restart staging directory within a run directory. | |
| str | picurv_cli.core.compute_physical_case_identity (dict case_cfg) |
| Compute the hidden identity used to guard in-place continuation. | |
| None | picurv_cli.core.validate_continue_case_identity (str run_dir, dict case_cfg) |
| Reject in-place continuation when the physical case has changed. | |
| picurv_cli.core.populate_restart_directory (str source_output, str target_restart, int start_step, dict monitor_cfg, "int | None" end_step=None, bool materialize=True) | |
| Atomically materialize an immutable checkpoint interval into a run. | |
| picurv_cli.core.validate_eulerian_checkpoint (str source_dir, int step, dict monitor_cfg) | |
Validate the mandatory Eulerian field set required by ReadSimulationFields(). | |
| picurv_cli.core.detect_last_checkpoint_step (str output_dir) | |
| Scan output directory for the highest step number available. | |
| dict | picurv_cli.core.detect_case_completion_status (str run_dir, dict monitor_cfg, int target_final_step) |
| Determine whether a study case is complete, partially complete, or empty. | |
| picurv_cli.core.validate_load_mode_step_range (str source_output, int start_step, int total_steps, dict monitor_cfg) | |
| Validate that all required eulerian step files exist for "load" mode. | |
| picurv_cli.core.validate_particle_checkpoint (str source_dir, int start_step, dict monitor_cfg) | |
| Validate that particle checkpoint files exist for the given step. | |
| dict | picurv_cli.core.read_monitor_from_run (str run_dir) |
| Read the monitor.yml from a run directory's config/ subdirectory. | |
| str | picurv_cli.core.resolve_latest_restart_run (dict case_cfg, str case_path, int start_step) |
| Select the newest local workspace run compatible with a requested restart. | |
| picurv_cli.core.resolve_restart_source (args, dict case_cfg, dict solver_cfg, dict monitor_cfg, str run_dir, bool materialize=True) | |
| Resolve the restart source directory based on –restart-from or –continue CLI flags. | |
| picurv_cli.core.absolutize_case_external_paths (dict case_cfg, str case_anchor_path) | |
| Convert external grid/generator paths in case config to absolute paths. | |
| picurv_cli.core.prepare_case_for_continuation (str run_dir, str case_id, int last_step, int target_final_step, dict cluster_cfg) | |
| Set up a partially-completed study case for continuation in-place. | |
| bool | picurv_cli.core.is_valid_email (str email) |
| Lightweight email validation for scheduler notifications. | |
| str | picurv_cli.core.normalize_statistics_task (str task_name) |
| Normalizes user-facing statistics task names to C pipeline keywords. | |
| picurv_cli.core._iter_nonempty_noncomment_lines (file_obj) | |
| Yield (lineno, stripped_line) for non-empty, non-comment lines. | |
| str | picurv_cli.core.format_picgrid_coordinate (float value) |
| Format a coordinate with round-trip-safe binary64 precision. | |
| dict | picurv_cli.core.validate_and_nondimensionalize_picgrid (str source_grid, str dest_grid, float L_ref, int expected_nblk=None) |
| Validates PICGRID payload and writes a non-dimensionalized copy. | |
| list | picurv_cli.core.read_picgrid_header_dimensions (str source_grid, int expected_nblk=None) |
| Read only the canonical PICGRID header dimensions. | |
| dict | picurv_cli.core.validate_and_nondimensionalize_picslice (str source_slice, str dest_slice, float U_ref, tuple expected_dims=None) |
| Validate a canonical PICSLICE payload and write a solver-scale copy. | |
| str | picurv_cli.core._face_artifact_token (str face) |
| Convert a BC face token into a filesystem-friendly artifact token. | |
| str | picurv_cli.core._resolve_run_artifact_path (str run_dir, str configured_path, str default_path, bool default_to_config_dir=False) |
| Resolve a run artifact path with run-dir-relative defaults. | |
| str | picurv_cli.core._resolve_generator_script (str configured_script, str case_path, str default_name) |
| Resolve an optional generator script override or repository default. | |
| dict | picurv_cli.core._normalize_square_duct_poiseuille_params (params, str field_name) |
| Validate square-duct Poiseuille generator parameters. | |
| dict | picurv_cli.core._normalize_field_slice_source (source, str field_name) |
| Validate a prescribed_flow field_slice source block. | |
| dict | picurv_cli.core._normalize_field_slice_selector (slice_cfg, str field_name) |
| Validate the field_slice slice selector. | |
| dict | picurv_cli.core.generate_square_duct_poiseuille_picslice (str output_path, tuple dims, dict params, str target_grid=None, int target_block=0, str target_face=None, str script=None, str case_path=None) |
| Generate a dimensional canonical PICSLICE for square-duct Poiseuille flow. | |
| dict | picurv_cli.core.generate_field_slice_picslice (str output_path, tuple expected_dims, dict source, str target_grid, str target_face, int target_block, str case_path) |
| Invoke profile.gen to extract a field_slice PICSLICE artifact. | |
| str | picurv_cli.core._resolve_case_relative_path (str path_value, str case_dir) |
| Resolve a path relative to the current case directory. | |
| float | picurv_cli.core._resolve_field_slice_velocity_scale (dict source, str case_dir) |
| Resolve field_slice dimensional velocity scale. | |
| str | picurv_cli.core.resolve_target_grid_for_field_slice (dict case_cfg, str case_path, str run_dir) |
| Resolve the target canonical PICGRID path needed for field_slice normals. | |
| str | picurv_cli.core.resolve_target_grid_for_generated_profile (dict case_cfg, str case_path, str run_dir) |
| Resolve an optional target canonical PICGRID for generated profile sampling. | |
| str | picurv_cli.core.write_profile_info (str config_dir, list summaries) |
| Write a profile.info summary for generated inlet profiles. | |
| list | picurv_cli.core.validate_grid_generator_cli_args (cli_args, str case_path) |
| Check closed-choice values inside the generator's opaque token list. | |
| str | picurv_cli.core.run_grid_generator (str case_path, str run_dir, dict grid_cfg, dict case_cfg=None) |
| Runs generators/grid.gen to produce a PICGRID file for this run. | |
| dict | picurv_cli.core._normalize_prescribed_flow_source (source, str field_name) |
| Validate the structured source block for prescribed_flow BCs. | |
| tuple | picurv_cli.core._bc_profile_expected_dims (str face, tuple block_dims) |
| Return expected PICSLICE dimensions for a face and block node dimensions. | |
| list | picurv_cli.core.resolve_grid_block_dimensions_for_profiles (dict case_cfg, str case_path, str run_dir=None) |
| Resolve per-block node dimensions for prescribed inlet profile validation. | |
| list | picurv_cli.core.materialize_generated_prescribed_flow_profiles (str run_dir, dict case_cfg, str case_path, list profile_grid_dims=None) |
| Generate dimensional PICSLICE artifacts for generated/field_slice prescribed_flow sources. | |
| float | picurv_cli.core._to_float (value, str field_name) |
| Convert a YAML scalar to float with a clear error message. | |
| float | picurv_cli.core._to_finite_float (value, str field_name) |
| Convert a non-boolean YAML scalar to a finite float. | |
| bool | picurv_cli.core._to_bool (value, str field_name) |
| Convert a YAML scalar/string to bool with a clear error message. | |
| picurv_cli.core.normalize_boundary_conditions_layout (all_blocks_bcs, int num_blocks) | |
| Normalize boundary_conditions to list-of-lists form and validate block count. | |
| set | picurv_cli.core._les_periodic_axes (dict case_cfg) |
| Reports which logical axes a case declares periodic on both faces. | |
| picurv_cli.core.validate_wall_model_pairing (dict case_cfg, les_cfg, rans_cfg, wall_cfg, str case_path, list errors, list warnings) | |
| Rejects wall-model selections that no turbulence treatment can support. | |
| picurv_cli.core._case_reynolds_number (dict case_cfg) | |
| Reynolds number implied by a case's scaling and fluid properties. | |
| picurv_cli.core.validate_les_configuration (dict case_cfg, dict les_cfg, str case_path, list errors, list warnings) | |
| Checks the structured LES block for values the closure cannot honour. | |
| picurv_cli.core.validate_and_prepare_boundary_conditions (dict case_cfg) | |
| Validate BC entries against currently supported C-side handlers/types and. | |
| str | picurv_cli.core._schema_path_text (tuple path) |
| Render an internal schema path tuple as a user-facing YAML path. | |
| picurv_cli.core._lookup_allowed_schema_keys (dict schema, tuple path) | |
| Return allowed keys for a path, honoring '*' dynamic mapping entries. | |
| str | picurv_cli.core._schema_key_hint (dict schema, tuple path, str key, set allowed) |
| Build a concise typo or hierarchy hint for an unsupported YAML key. | |
| None | picurv_cli.core._validate_yaml_schema_keys (cfg, dict schema, str file_path, list errors, tuple path=()) |
| Reject unsupported YAML keys before they can be silently ignored by staging. | |
| str | picurv_cli.core.directory_value_charset_problem (str value) |
| Describe why a directory value cannot be written to a PETSc options line. | |
| str | picurv_cli.core.classify_run_directory_value (value) |
| Classify a configured run directory value. | |
| str | picurv_cli.core.normalized_run_directory (str value) |
| Normalized, comparable form of a contained run directory value. | |
| bool | picurv_cli.core.paths_overlap (str first, str second) |
| Whether two run-relative directories are the same or nested in one another. | |
| tuple | picurv_cli.core.resolve_unsafe_paths_override (dict dirs, str monitor_path) |
| Resolve the unsafe-paths override, requiring a real YAML boolean. | |
| tuple | picurv_cli.core.evaluate_run_directories (dict values, bool override, set explicit=None) |
| Apply every run-directory safety rule to a set of effective directory values. | |
| list | picurv_cli.core.classify_physical_containment (str run_dir, dict values) |
| Classify where each run-owned directory physically lands. | |
| list | picurv_cli.core.check_physical_containment (str run_dir, dict values) |
| Human-readable physical containment violations. | |
| dict | picurv_cli.core.effective_run_directories (dict configured) |
| Fill in defaults for run-owned directories that were not configured. | |
| tuple | picurv_cli.core.validate_run_directory_containment (dict monitor_cfg, str monitor_path) |
| Classify legacy directory values as defense-in-depth during validation. | |
| list | picurv_cli.core.validate_reserved_directory_flags (dict config, str config_path, str label) |
| Reject raw PETSc passthrough options that set run-owned directories. | |
| picurv_cli.core.validate_simulation_configs (dict case_cfg, dict solver_cfg, dict monitor_cfg, str case_path, str solver_path, str monitor_path) | |
| Validates every configuration a simulation run consumes, before any work is done. | |
| "tuple[list, list]" | picurv_cli.core.check_post_checkpoint_cadence_alignment (dict post_cfg, dict monitor_cfg, str post_path, str monitor_path="monitor.yml") |
| Report post step selections that cannot land on a committed checkpoint. | |
| picurv_cli.core.validate_post_config (dict post_cfg, str post_path, dict monitor_cfg=None, dict case_cfg=None) | |
| Validates the post-processing config before running the post-processor. | |
| picurv_cli.core.validate_cluster_config (dict cluster_cfg, str cluster_path) | |
| Validate Slurm scheduler configuration from cluster.yml. | |
| picurv_cli.core.validate_study_config (dict study_cfg, str study_path, bool skip_base_file_check=False) | |
| Validate sweep/study specification from study.yml. | |
| picurv_cli.core._deep_set (dict container, str dotted_path, value) | |
| Set nested dictionary value, creating intermediate maps when needed. | |
| list | picurv_cli.core.expand_parameter_matrix (dict parameters) |
| Expand study parameter lists into cartesian-product combinations. | |
| list | picurv_cli.core.expand_study_parameter_combinations (dict study_cfg) |
| Expand either cartesian-study parameters or explicit parameter sets. | |
| dict | picurv_cli.core.flatten_study_parameters (dict parameters) |
| Flatten grouped study overrides into scalar dotted-path columns. | |
| list | picurv_cli.core.get_study_parameter_keys (dict study_cfg) |
| Collect ordered parameter keys from either cross-product parameter expansions or explicit parameter sets. | |
| int | picurv_cli.core.get_cluster_total_tasks (dict cluster_cfg) |
| Return cluster total tasks. | |
| str | picurv_cli.core.normalize_extension (str ext) |
| Canonicalize a user-supplied filename extension by trimming whitespace and leading dots. | |
| list | picurv_cli.core.resolve_conductor_entry_point () |
| Resolve how to invoke this conductor again from a batch script. | |
| list | picurv_cli.core.build_spectra_follow_command (str run_dir, str post_path, dict post_cfg) |
| Build the batch-script step that measures spectra after the field stage. | |
| picurv_cli.core.render_slurm_script (str script_path, str job_name, dict cluster_cfg, list command, str workdir, str stdout_path, str stderr_path=None, dict env_vars=None, dict shell_env_vars=None, str array_spec=None, list follow_commands=None) | |
| Render a Slurm batch script for a single command. | |
| "tuple[str | None, list[str]]" | picurv_cli.core.split_launcher_tokens ("str | None" launcher, "list | None" launcher_args=None, str label="launcher") |
| Canonicalize launcher config into executable token plus argv-style flags. | |
| "tuple[str | None, list[str]]" | picurv_cli.core.normalize_cluster_launcher (dict execution) |
| Canonicalize cluster launcher config into executable token plus argv-style flags. | |
| "list[str]" | picurv_cli.core.strip_launcher_size_flags (str launcher_name, "list[str]" launcher_args) |
| Remove explicit MPI task-count flags from known launchers. | |
| list | picurv_cli.core.build_local_launch_command (str executable, list executable_args, int num_procs, str config_search_anchor=None, bool allow_single_rank_launcher_override=False, "int | None" force_num_procs=None) |
| Build local launcher command, allowing env or shared config overrides for login-node MPI quirks. | |
| dict | picurv_cli.core.resolve_cluster_execution (dict cluster_cfg, str config_search_anchor=None, extra_search_anchors=None) |
| Resolve cluster execution launcher settings from shared runtime config plus cluster.yml overrides. | |
| list | picurv_cli.core.build_cluster_launch_command (dict cluster_cfg, str executable, list executable_args, str config_search_anchor=None, extra_search_anchors=None, "int | None" force_num_procs=None) |
| Build scheduler launcher command from cluster config plus optional shared execution defaults. | |
| str | picurv_cli.core.parse_slurm_job_id (str sbatch_output) |
| Extract numeric job id from standard sbatch output. | |
| dict | picurv_cli.core.submit_sbatch (str script_path, str dependency=None, str dependency_type="afterok") |
| Submit sbatch script and return submission metadata. | |
| picurv_cli.core._print_validation_errors (list errors) | |
| Prints validation errors and exits. | |
| str | picurv_cli.core.generate_header (str run_id, dict source_files) |
| Creates a standard header block for all generated files. | |
| str | picurv_cli.core.generate_simple_list_file (str run_dir, str run_id, dict cfg, str section, str key, str filename, dict header_sources, str config_dir=None) |
| Generic function to create a file containing a simple list of strings. | |
| bool | picurv_cli.core.has_explicit_monitor_whitelist (dict monitor_cfg) |
| Return True when logging.enabled_functions contains at least one entry. | |
| dict | picurv_cli.core.resolve_profiling_config (dict monitor_cfg) |
| Resolve profiling reporting config from monitor.yml. | |
| dict | picurv_cli.core._diagnostic_info (value) |
| Validate PETSc info logging configuration. | |
| picurv_cli.core._diagnostic_bool_or_path (value, str key) | |
| Validate a diagnostics value that can be false, true, or a path/viewer string. | |
| bool | picurv_cli.core._diagnostic_bool (value, str key) |
| Validate a diagnostics boolean value. | |
| picurv_cli.core._diagnostic_bool_or_all (value, str key) | |
| Validate a diagnostics value that can be false, true, or "all". | |
| str | picurv_cli.core._diagnostic_default_file (str run_dir, str filename) |
| Return an absolute run-local diagnostics file path. | |
| picurv_cli.core._diagnostic_resolve_path_or_default (value, str run_dir, str default_filename) | |
| Resolve true/string diagnostics values to a concrete file path. | |
| dict | picurv_cli.core.resolve_diagnostics_config (dict monitor_cfg, "str | None" run_dir=None, str stage_label="Solver") |
| Resolve monitor diagnostics config and default run-local log paths. | |
| list | picurv_cli.core.build_petsc_diagnostics_args (dict monitor_cfg, str run_dir, str stage_label) |
| Build PETSc diagnostics command-line arguments for a run stage. | |
| bool | picurv_cli.core._statistics_subsystem_available (dict case_cfg, requirement) |
| Report whether the subsystem a statistics field depends on is active. | |
| dict | picurv_cli.core.normalize_field_statistics_config (dict monitor_cfg, dict case_cfg=None) |
| Validate and canonicalize the field-statistics block of monitor.yml. | |
| list | picurv_cli.core.resolve_field_statistics_flags (dict monitor_cfg, dict case_cfg=None) |
| Serialize field-statistics configuration into control-file option lines. | |
| "int | None" | picurv_cli.core.resolve_statistics_console_output_frequency (dict io_cfg) |
| Resolve the statistics console cadence, mirroring the particle one. | |
| dict | picurv_cli.core.normalize_solution_monitoring_config (dict monitor_cfg) |
| Validate and canonicalize physical-solution convergence monitoring. | |
| dict | picurv_cli.core.resolve_solution_monitoring_flags (dict monitor_cfg) |
| Translate solution-monitoring YAML into the existing C convergence flags. | |
| dict | picurv_cli.core.prepare_monitor_files (str run_dir, str run_id, dict monitor_cfg, dict source_files, str config_dir=None) |
| Generate monitor sidecar files and resolve profiling reporting behavior. | |
| list | picurv_cli.core.generate_multi_block_bcs (str run_dir, str run_id, dict case_cfg, dict source_files, str config_dir=None) |
| Parses multi-block BCs from YAML, generates a .run file for each block, and returns a list of their absolute paths. | |
| picurv_cli.core.format_flag_value (value) | |
| Converts Python types to C-style command-line flag values. | |
| dict | picurv_cli.core.translate_programmatic_grid_settings (dict grid_settings) |
| Return programmatic-grid settings translated to the C node-count contract. | |
| None | picurv_cli.core.validate_programmatic_generated_ic_grid_settings (dict raw_settings) |
| Validate scalar programmatic grid settings needed by file-generating IC providers. | |
| dict | picurv_cli.core.generate_picgrid_from_programmatic_settings (dict raw_settings, str dest_path, float L_ref) |
| Generate a canonical PICGRID file from programmatic Cartesian grid settings. | |
| dict | picurv_cli.core.resolve_grid_da_processor_layout (dict grid_cfg) |
| Resolve optional global DMDA layout, preferring grid-level keys over legacy nested keys. | |
| None | picurv_cli.core.append_grid_da_processor_layout (list control_lines, dict grid_cfg, int num_procs) |
| Append optional global DMDA layout flags for any grid mode. | |
| str | picurv_cli.core.normalize_momentum_solver_type (str value) |
| Maps canonical user-facing momentum solver names to C-enum CLI values. | |
| dict | picurv_cli.core.validate_newton_krylov_config (dict cfg) |
| Validate and normalize the structured Newton–Krylov solver block. | |
| str | picurv_cli.core.normalize_solution_convergence_mode (str value) |
| Normalizes the solution-convergence mode selector to the C-side canonical string. | |
| int | picurv_cli.core.normalize_field_init_mode (str value) |
| Maps canonical field init mode names to C enum/int codes (-finit). | |
| "tuple[str, int]" | picurv_cli.core.normalize_initial_condition_field (str value) |
| Normalize a file IC field selector to its staged basename and C enum value. | |
| bool | picurv_cli.core.is_generated_ic_provider (dict resolved_ic) |
| Return whether a resolved IC is backed by a registered file generator. | |
| dict | picurv_cli.core.resolve_fluid_scaling (dict case_cfg) |
| Resolve the shared physical and nondimensional fluid scaling contract. | |
| dict | picurv_cli.core.resolve_initial_condition_config (dict ic, prepared_blocks, float U_ref, provider_context=None) |
| Resolve legacy and structured initial-condition YAML into one launcher contract. | |
| dict | picurv_cli.core.validate_petsc_vec_binary (str path) |
| Validate the basic PETSc binary VecView envelope used by ReadFieldData. | |
| str | picurv_cli.core.run_initial_spectrum_generator (str field_path, str staged_grid, str spectrum_path, str case_dir) |
| Measure the shell-averaged spectrum of a staged initial condition. | |
| str | picurv_cli.core.run_initial_condition_generator (str case_path, str run_dir, dict resolved_ic) |
| Run the repository IC generator. | |
| dict | picurv_cli.core.stage_initial_condition_file (str run_dir, str case_path, dict resolved_ic) |
| Materialize and stage one file-backed IC in ReadFieldData's expected layout. | |
| int | picurv_cli.core.normalize_flow_direction_token (str value) |
| Maps a face-token flow direction string to the C FlowDirection enum integer. | |
| bool | picurv_cli.core._ic_has_inlet (prepared_blocks) |
| Return True if any prepared BC block contains an INLET face. | |
| dict | picurv_cli.core.resolve_ic_cli_params (dict ic, int finit_code, prepared_blocks, float U_ref) |
| Resolve all IC parameters and return a dict of PETSc option values. | |
| str | picurv_cli.core.normalize_eulerian_field_source (str value) |
| Normalizes the Eulerian field source selector to the C-side canonical string. | |
| str | picurv_cli.core.normalize_analytical_type (str value) |
| Normalizes the analytical solution selector to the C-side canonical string. | |
| "tuple[float, float, float]" | picurv_cli.core.parse_initial_velocity_components (dict initial_conditions, int finit_code, *bool require_explicit) |
| Parse initial-condition velocity components with mode-aware defaults. | |
| "str | None" | picurv_cli.core.infer_unique_inlet_axis_from_prepared_bcs (list prepared_blocks) |
| Infer the unique inlet axis across all blocks using C-side "primary inlet" ordering. | |
| int | picurv_cli.core.normalize_particle_init_mode (str value) |
| Maps canonical particle init mode names to C enum/int codes (-pinit). | |
| int | picurv_cli.core.normalize_interpolation_method (str value) |
| Maps interpolation method names to C enum/int codes (-interpolation_method). | |
| int | picurv_cli.core.normalize_les_model (value) |
| Maps LES model selectors to C enum/int codes (-les). | |
| int | picurv_cli.core.normalize_les_test_filter (value) |
| Maps LES test-filter kernel names to the C -les_test_filter_kernel flag. | |
| int | picurv_cli.core.normalize_les_filter_width (value) |
| Maps LES grid-filter-width model names to the C -les_filter_width flag. | |
| int | picurv_cli.core.normalize_les_averaging_mode (value) |
| Maps LES coefficient-averaging mode names to the C -les_averaging_mode flag. | |
| int | picurv_cli.core.normalize_les_clip_mode (value) |
| Maps LES coefficient-limiting mode names to the C -les_clip_mode flag. | |
| str | picurv_cli.core.normalize_les_averaging_directions (value) |
| Maps a list of homogeneous logical directions to the C flag's string form. | |
| int | picurv_cli.core.normalize_rans_model (value) |
| Maps RANS model selectors to the current C -rans switch. | |
| int | picurv_cli.core.normalize_wall_function_model (value) |
| Maps wall-function model selectors to the C -wallfunction flag. | |
| bool | picurv_cli.core.resolve_enabled_flag (dict cfg, str path, bool default=True) |
Resolves a structured enabled flag and rejects non-boolean values. | |
| picurv_cli.core.append_les_parameter_flags (dict les_cfg, list control_lines) | |
| Appends the LES closure parameter flags from a structured les block. | |
| picurv_cli.core.append_turbulence_flags (dict models, list control_lines) | |
| Appends turbulence model flags from legacy or structured case.yml blocks. | |
| picurv_cli.core.control_value (value, str context) | |
| Guard a value that is written verbatim into the generated control file. | |
| picurv_cli.core.append_passthrough_flags (list control_lines, dict options) | |
| Appends raw CLI flags to the control list from a {flag: value} dict. | |
| dict | picurv_cli.core.resolve_solver_monitoring_flags (dict monitor_cfg) |
| Resolve human-readable solver monitoring YAML to raw control flags. | |
| "int | None" | picurv_cli.core.resolve_particle_console_output_frequency (dict io_cfg) |
| Return the effective particle-console snapshot cadence from monitor.yml. | |
| picurv_cli.core.parse_and_add_model_flags (dict case_cfg, list control_lines) | |
| Parses the 'models' section of case.yml and adds corresponding C-solver flags. | |
| dict | picurv_cli.core.parse_solver_config (dict solver_cfg) |
| Parses the structured solver.yml into a flat dictionary of {flag: value}. | |
| picurv_cli.core.generate_solver_control_file (run_dir, run_id, configs, num_procs, monitor_files, restart_source_dir=None, continue_mode=False, str config_dir=None) | |
| Generates the main .control file for the C-solver. | |
| str | picurv_cli.core.generate_post_recipe_file (str run_dir, str run_id, dict post_cfg, dict source_files, monitor_cfg=None) |
| Generates a key=value config file (post.run) for the C post-processor. | |
| picurv_cli.core.execute_command (list command, str run_dir, str log_filename, dict monitor_cfg=None) | |
| Executes a command, streaming its output to the console and a log file. | |
| str | picurv_cli.core.format_command_for_display (list command) |
| Render a shell-safe command string for console and log output. | |
| str | picurv_cli.core.resolve_command_log_path (str run_dir, str log_filename) |
| Resolve a command log filename relative to the run directory. | |
| subprocess.CompletedProcess | picurv_cli.core._run_captured_command (list command, str run_dir) |
| Run a command and capture combined stdout/stderr details for later inspection. | |
| picurv_cli.core._require_successful_command (list command, subprocess.CompletedProcess result) | |
Raise CommandExecutionError when a captured command failed. | |
| str | picurv_cli.core._capture_command_stdout (list command, str run_dir) |
| Run a command, require success, and return stripped stdout text. | |
| picurv_cli.core._stream_command_to_console_and_log (list command, str run_dir, log_file) | |
| Stream command output to stdout and an already-open log file. | |
| dict | picurv_cli.core._get_git_head_state (str run_dir) |
| Capture the current git HEAD branch name and commit hash. | |
| "list[tuple[str, str | None]]" | picurv_cli.core._get_local_branches_with_upstreams (str run_dir) |
| Return local branch names plus their configured upstreams. | |
| bool | picurv_cli.core._working_tree_has_tracked_changes (str run_dir) |
Return True when the repository has staged or unstaged tracked changes. | |
| picurv_cli.core._attempt_pull_cleanup (str run_dir, bool rebase, log_file) | |
Best-effort cleanup after a failed git pull so the original branch can be restored. | |
| picurv_cli.core._restore_git_head (str run_dir, dict original_head, log_file) | |
| Restore the repository back to the branch or detached commit it started on. | |
| picurv_cli.core.pull_all_source_branches (str run_dir, str log_filename, bool rebase=True) | |
| Refresh every local tracking branch in the source repository, then restore the starting branch. | |
| picurv_cli.core.auto_identify_run_inputs (str config_dir) | |
| Auto-detect case.yml, monitor.yml, and *.control in a run config directory. | |
| str | picurv_cli.core.resolve_post_source_directory (str run_dir, dict monitor_cfg, dict post_cfg, bool strict=True) |
| Resolve post source directory token and optionally enforce existence. | |
| picurv_cli.core.render_slurm_array_stage_script (str script_path, str job_name, dict cluster_cfg, str array_spec, str case_index_tsv, str stage, str solver_exe, str post_exe, str stdout_path, str stderr_path) | |
| Render array script that maps SLURM_ARRAY_TASK_ID to per-case run artifacts. | |
| picurv_cli.core.render_metrics_aggregate_script (str script_path, str job_name, dict cluster_cfg, str study_dir, str picurv_path) | |
| Generate a single-node sbatch script that runs metrics aggregation. | |
| picurv_cli.core.reduce_metric_values (values, str reduction) | |
| Reduce a metric series to one scalar according to the requested reducer. | |
| picurv_cli.core.extract_metric_from_csv (str case_dir, dict spec) | |
| Extract a scalar metric from a CSV source. | |
| picurv_cli.core.extract_metric_from_log (str case_dir, dict spec) | |
| Extract a scalar metric from a log file using regex. | |
| picurv_cli.core.normalize_metric_spec (metric) | |
| Normalize study metric definitions to a common dictionary form. | |
| dict | picurv_cli.core._read_previous_metric_rows (str results_dir) |
| Read the metrics table an earlier aggregation wrote, keyed by case id. | |
| str | picurv_cli.core.aggregate_study_metrics (dict study_cfg, list cases, str results_dir) |
| Collect metric values from generated case directories into one CSV. | |
| str | picurv_cli.core._study_parameter_label (str key) |
| Return a concise report label for a study parameter path. | |
| str | picurv_cli.core._study_metric_label (dict study_cfg, str metric) |
| Resolve an optional configured metric label or humanize its name. | |
| "list | None" | picurv_cli.core._numeric_study_column (list rows, str key) |
| Parse one complete, finite numeric study-table column. | |
| "dict | None" | picurv_cli.core._infer_study_plot_axis (dict study_cfg, list rows) |
| Infer the scientifically meaningful independent variable of a study. | |
| picurv_cli.core.infer_plot_x_axis (dict study_cfg, list rows) | |
| Infer x-axis key/values for study plots. | |
| str | picurv_cli.core._format_study_group_value (value) |
| Format a secondary study parameter compactly for a legend. | |
| list | picurv_cli.core._study_plot_groups (dict study_cfg, list rows, dict axis, str metric) |
| Group metric points by any secondary varied study parameters. | |
| bool | picurv_cli.core._study_use_log_scale (list values, bool semantic_hint=False) |
| Use log scaling only for positive data spanning a meaningful range. | |
| "tuple[float, float] | None" | picurv_cli.core._study_linear_y_limits (list values) |
| Build padded linear limits that include zero for non-negative metrics. | |
| picurv_cli.core.generate_study_plots (dict study_cfg, str metrics_csv, str plots_dir) | |
| Generate metric-vs-parameter plots for completed studies. | |
| str | picurv_cli.core._command_to_string (list command_tokens) |
| Render a command list as a shell-safe display string. | |
| str | picurv_cli.core._resolve_post_source_directory_preview (str run_dir, dict monitor_cfg, dict post_cfg) |
| Resolve post source directory without side effects or stdout/stderr output. | |
| dict | picurv_cli.core.build_run_dry_plan (args) |
Build a no-write execution plan for run --dry-run. | |
| None | picurv_cli.core.add_planned_grid_artifacts (dict plan, dict case_cfg, str run_dir) |
| Add grid-mode-specific staged artifacts to a dry-run plan. | |
| None | picurv_cli.core.add_planned_profile_artifacts (dict plan, dict case_cfg, str run_dir) |
| Add generated prescribed-flow profile artifacts to a dry-run plan. | |
| None | picurv_cli.core.add_planned_initial_condition_artifacts (dict plan, dict case_cfg, dict solver_cfg, str run_dir) |
| Add authoritative file-backed initial-condition artifacts to a dry-run plan. | |
| picurv_cli.core.render_run_dry_plan (dict plan, str output_format="text") | |
| Render dry-run plan in human or JSON format. | |
| picurv_cli.core.validate_workflow (args) | |
Implements picurv validate without launching solver/post workflows. | |
| str | picurv_cli.core._asset_file_sha256 (str path) |
| Hash an asset source or payload without loading it into memory. | |
| str | picurv_cli.core._stable_mapping_sha256 (payload) |
| Hash a JSON-compatible value with deterministic serialization. | |
| dict | picurv_cli.core._provider_source_fingerprints (value, str case_path, str key="") |
| Hash every existing file explicitly referenced by an asset provider. | |
| dict | picurv_cli.core.build_case_asset_graph (dict case_cfg, str case_path) |
| Classify case inputs into precomputable or simulator-runtime providers. | |
| list | picurv_cli.core._asset_selection (dict graph, requested=None, *bool precomputable_only=False) |
| Resolve requested asset kinds plus dependency closure. | |
| list | picurv_cli.core._asset_payload_files (str build_root, str kind) |
| Enumerate canonical files belonging to one asset kind in a build tree. | |
| dict | picurv_cli.core._build_selected_asset_payloads (str build_root, dict case_cfg, str case_path, list selected) |
| Execute existing generators into one isolated run-like build tree. | |
| dict | picurv_cli.core._picgrid_geometry_summary (str path) |
| Read a canonical PICGRID and summarize what a user would want to check. | |
| bool | picurv_cli.core._write_structured_grid_preview (str picgrid_path, str destination, dims) |
| Write a single-block ASCII VTS preview of a staged PICGRID. | |
| dict | picurv_cli.core._build_asset_inspection (str kind, str build_root, dict provider, list payload_files) |
| Produce the inspection material published beside an asset's payload. | |
| dict | picurv_cli.core._publish_asset_object (str workspace_root, str build_root, dict provider, list payload_files) |
| Publish one immutable content-addressed asset object atomically. | |
| str | picurv_cli.core._workspace_asset_set_name (str workspace_root, str case_path) |
| Return a collision-free, readable mutable asset-set name. | |
| str | picurv_cli.core._write_workspace_asset_set (str workspace_root, str case_path, dict graph, dict references) |
| Atomically update the named asset set and workspace asset catalog. | |
| dict | picurv_cli.core.precompute_case_assets (str workspace_root, dict case_cfg, str case_path, requested=None, bool precomputable_only=False) |
| Build and publish a selected deterministic asset dependency closure. | |
| str | picurv_cli.core._workspace_asset_set_path (str workspace_root, str case_path) |
| Return the mutable asset-set pointer associated with a case config name. | |
| dict | picurv_cli.core.plan_run_assets (dict case_cfg, str case_path) |
| Plan reuse/build/runtime actions for all configured run providers. | |
| str | picurv_cli.core._materialize_asset_file (str source, str destination) |
| Expose one immutable shared-asset file through reflink, hardlink, or copy. | |
| dict | picurv_cli.core.materialize_run_assets (str run_dir, dict case_cfg, str case_path, bool require_precomputed=False, bool fetch_missing=False) |
| Resolve/build workspace assets and write the exact run input lock. | |
| picurv_cli.core.precompute_workflow (args) | |
| Resolve, preflight, and atomically publish reusable workspace assets. | |
| picurv_cli.core.run_workflow (args) | |
| Main orchestrator for the 'run' command (local and Slurm modes). | |
| list | picurv_cli.core.parse_case_index_tsv (str tsv_path) |
| Parse a case_index.tsv file back into a list of case entry dicts. | |
| picurv_cli.core.sweep_workflow (args) | |
| Study/sweep orchestration using Slurm job arrays. | |
| picurv_cli.core.sweep_continue_workflow (args) | |
| Continue a partially-completed Slurm parameter sweep study. | |
| picurv_cli.core.sweep_reaggregate_workflow (args) | |
| Re-run metrics aggregation and plot generation for an existing study. | |
| picurv_cli.core._read_yaml_if_exists (str filepath) | |
| Read YAML when present, otherwise return None. | |
| picurv_cli.core._read_json_if_exists (str filepath) | |
| Read JSON when present, otherwise return None. | |
| picurv_cli.core._parse_int_loose (value) | |
| Best-effort integer parsing for summary extraction. | |
| picurv_cli.core._parse_float_loose (value) | |
| Best-effort float parsing for summary extraction. | |
| picurv_cli.core._extract_numeric_tuple (str text) | |
| Extract a numeric tuple from a string like '(1, 2, 3)'. | |
| dict | picurv_cli.core._build_summary_context (str run_dir) |
| Resolve run-local config and artifact paths for summarize. | |
| dict | picurv_cli.core._require_summary_config (dict context, str name) |
| Return one explicitly requested copied config or fail with a structured error. | |
| dict | picurv_cli.core._build_run_overview (dict context) |
| Build timestep-independent run metadata for summarize. | |
| dict | picurv_cli.core._summarize_turbulence (dict turbulence_cfg) |
| Build compact turbulence and wall-model selections. | |
| dict | picurv_cli.core._build_case_overview (dict context) |
| Build a curated case.yml summary with useful derived quantities. | |
| dict | picurv_cli.core._build_solver_overview (dict context) |
| Build a curated solver.yml summary with normalized selections. | |
| dict | picurv_cli.core._build_monitor_overview (dict context) |
| Build a curated monitor.yml summary with resolved defaults. | |
| "tuple[dict, list[int]]" | picurv_cli.core._parse_continuity_metrics_log (str filepath) |
| Parse Continuity_Metrics.log into latest rows by step plus observed order. | |
| "tuple[dict, list[int]]" | picurv_cli.core._parse_particle_metrics_log (str filepath) |
| Parse Particle_Metrics.log into latest rows by step plus observed order. | |
| "tuple[dict, dict, list[int]]" | picurv_cli.core._parse_momentum_convergence_logs (str log_dir) |
| Parse per-block momentum convergence logs. | |
| "tuple[dict, dict, list[int]]" | picurv_cli.core._parse_poisson_convergence_logs (str log_dir) |
| Parse per-block Poisson convergence logs. | |
| "tuple[dict, list[int]]" | picurv_cli.core._parse_profiling_timestep_csv (str filepath) |
| Parse profiling timestep CSV into latest rows by step plus observed order. | |
| "tuple[dict, list[int], dict]" | picurv_cli.core._parse_runtime_memory_log (str filepath) |
| Parse Runtime_Memory.log into latest rows by step and final status. | |
| "tuple[dict, list[int]]" | picurv_cli.core._parse_solution_convergence_log (str filepath) |
| Parse solution_convergence.log into latest rows by step plus observed order. | |
| "list[str]" | picurv_cli.core._find_solver_stream_log_candidates (str run_dir, str log_dir) |
| Return plausible solver stream logs for local and Slurm runs. | |
| dict | picurv_cli.core._parse_particle_snapshot_file (str filepath) |
| Parse sampled particle snapshots from a solver stream log. | |
| "int | None" | picurv_cli.core._find_previous_snapshot_step ("list[int]" snapshot_steps, int step) |
| Return the nearest earlier snapshot step when available. | |
| dict | picurv_cli.core._compute_particle_snapshot_delta ("list[dict]" current_rows, "list[dict]" previous_rows) |
| Compute sampled deltas between two particle snapshot samples. | |
| dict | picurv_cli.core._build_particle_snapshot_summary (str source, int step, "list[dict]" rows, int preview_rows, particle_console_output_freq, particle_log_interval, "int | None" previous_step=None, "list[dict] | None" previous_rows=None) |
| Build sampled diagnostics for one particle console snapshot. | |
| dict | picurv_cli.core._find_particle_snapshot_for_step (str run_dir, str log_dir, int step, int preview_rows, particle_console_output_freq, particle_log_interval) |
| Locate and summarize a particle console snapshot for one step. | |
| picurv_cli.core._resolve_summary_step (requested_step, continuity_rows, particle_rows, momentum_rows, poisson_rows, profiling_rows, memory_rows=None, convergence_rows=None, step_orders=None, str selection_mode="latest") | |
| Select a step to summarize from available metric artifacts. | |
| str | picurv_cli.core._format_summary_float (value, str spec=".6e", str missing="n/a") |
| Format optional numeric values for summary text output. | |
| float | picurv_cli.core._summary_source_mtime (paths) |
| Return the newest modification time among one or more summary sources. | |
| "list[list[int]]" | picurv_cli.core._order_summary_step_orders ("list[tuple[list[int], object]]" sources) |
| Order observed step sequences by the recency of their source files. | |
| dict | picurv_cli.core.build_run_summary_payload (str run_dir, "int | None" step=None, int snapshot_rows=5, str selection_mode="latest") |
| Build a read-only run-step summary from existing PICurv artifacts. | |
| picurv_cli.core.render_run_summary (dict payload, str output_format="text") | |
| Render a run-step summary in human or JSON form. | |
| str | picurv_cli.core._summary_display_value (value) |
| Format one configuration-summary value for compact text output. | |
| picurv_cli.core._print_config_header (str title, "str | None" subtitle=None) | |
| Print a strong dashboard-style configuration summary header. | |
| picurv_cli.core._print_config_group (str title, list rows) | |
| Print an aligned configuration-summary field group. | |
| list | picurv_cli.core._flatten_summary_mapping (dict mapping, str prefix="") |
| Flatten nested summary mappings into readable dotted field rows. | |
| picurv_cli.core._render_run_overview_text (dict summary) | |
| Render run metadata as a compact dashboard. | |
| picurv_cli.core._render_case_summary_text (dict summary) | |
| Render the case summary as a glanceable simulation dashboard. | |
| picurv_cli.core._render_solver_summary_text (dict summary) | |
| Render the solver summary as a glanceable numerical-method dashboard. | |
| picurv_cli.core._render_monitor_summary_text (dict summary) | |
| Render the monitor summary as a glanceable observability dashboard. | |
| picurv_cli.core.render_selected_summary (dict payload, str output_format="text") | |
| Render selected timestep-independent config views and optional health. | |
| str | picurv_cli.core._humanize_plot_identifier (str value) |
| Convert one machine-oriented identifier into a readable plot label. | |
| str | picurv_cli.core._summary_field_label (str field) |
| Return the report-facing label for one logged scalar field. | |
| "float | None" | picurv_cli.core._summary_physical_time (dict context, dict record) |
| Resolve a record's physical time from its artifact or copied case configuration. | |
| picurv_cli.core._read_runtime_diagnostics_csv (path) | |
Yields (segment, row) for each data line of a runtime diagnostics CSV. | |
| picurv_cli.core._append_summary_plot_record (list records, str source, step, str line, dict values, str source_path, int segment=0, dict coordinates=None) | |
| Append one numeric append-ordered record for summarize plotting. | |
| bool | picurv_cli.core._is_summary_plot_continuation_marker (str line) |
| Return whether a log line starts a new continuation segment. | |
| list | picurv_cli.core._collect_summary_plot_records (dict context) |
| Collect append-ordered numeric records from summarize-supported scalar logs. | |
| list | picurv_cli.core._collect_spectra_plot_records (dict context) |
| Collect the per-step scalar histories written by the spectra post stage. | |
| list | picurv_cli.core._build_summary_plot_catalog (list records) |
| Build available qualified-series metadata from plot records. | |
| list | picurv_cli.core._representative_indices (int count, int maximum=6) |
| Select evenly distributed indices while always retaining both endpoints. | |
| dict | picurv_cli.core._build_spectrum_plot_request (dict context, str task, bool reference, bool linear_y, "str | None" output_path) |
| Build a plot.gen request drawing representative measured spectra. | |
| dict | picurv_cli.core._build_summary_plot_request (dict context, list records, str series, "int | None" last_n, bool linear_y, "str | None" output_path) |
| Build one normalized plot.gen request from collected summarize records. | |
| picurv_cli.core._render_summary_plot_catalog (list catalog, str output_format) | |
| Render available summarize plot-series metadata. | |
| picurv_cli.core._invoke_plot_gen (dict request) | |
| Invoke standalone plot.gen with one normalized request over stdin. | |
| picurv_cli.core.summarize_workflow (args) | |
| Build and render a read-only health summary for a run step. | |
| dict | picurv_cli.core._resolve_submission_target (str run_dir=None, str study_dir=None) |
| Resolve a run/study submission target from explicit directory flags. | |
| dict | picurv_cli.core._get_submission_stage_metadata (dict target_context, str stage_name) |
| Return stored metadata for one staged submission target. | |
| list | picurv_cli.core._get_recorded_submission_stages (dict target_context) |
| Return stage names explicitly recorded in scheduler submission metadata. | |
| str | picurv_cli.core._format_stage_list (list stage_names) |
| Format a human-readable stage list for submit diagnostics. | |
| str | picurv_cli.core._build_submit_missing_stage_hint (dict target_context, str requested_stage, list selected_stages) |
| Build an actionable hint for requested submit stages missing from metadata. | |
| picurv_cli.core._set_submission_stage_metadata (dict target_context, str stage_name, dict stage_meta) | |
| Persist one stage's metadata back into the submission payload. | |
| picurv_cli.core._write_submission_target_metadata (dict target_context) | |
| Write updated submission metadata back to disk. | |
| tuple | picurv_cli.core.staged_control_directories (str control_path) |
| Read run-owned directory values from a staged control file. | |
| list | picurv_cli.core.preflight_config_directories (str root_dir) |
| Every config directory under a run or study root that may hold a control file. | |
| tuple | picurv_cli.core.preflight_staged_run_directories (str root_dir) |
| Re-check run-directory safety against an already-staged run or study. | |
| list | picurv_cli.core.read_text_file_lines (str path) |
| Read a text file into a list of lines. | |
| picurv_cli.core.submit_staged_jobs (args) | |
| Submit previously staged Slurm artifacts from an existing run/study directory. | |
| picurv_cli.core.submit_staged_local_run (args, dict target_context, list selected_stages) | |
| Execute previously staged local run commands from scheduler/submission.json. | |
| picurv_cli.core.cancel_run_jobs (args) | |
| Cancel Slurm-submitted jobs for an existing run directory. | |
| picurv_cli.core._workspace_yaml_role (str path) | |
| Infer the owned workspace role of one copied YAML file. | |
| picurv_cli.core._rewrite_workspace_path_values (value, dict replacements) | |
| Rewrite copied template path scalars to workspace-root-relative homes. | |
| picurv_cli.core._choose_primary_workspace_role (list candidates, str role, str template_name) | |
| Select the canonical role file from a template that may carry variants. | |
| dict | picurv_cli.core.organize_initialized_workspace (str workspace_root, str template_name, str source_template_root=None) |
| Convert a copied example into the canonical editable workspace layout. | |
| dict | picurv_cli.core.import_workspace_input (str workspace_root, str kind, str source, str name=None, str mode="copy") |
| Explicitly import or register one workspace input. | |
| picurv_cli.core.inputs_workflow (args) | |
| Handle explicit workspace input management. | |
| picurv_cli.core.version_workflow (args) | |
Report, and for the status action validate, the shared build identity. | |
| None | picurv_cli.core._require_clean_source_checkout (str action) |
| Refuse version-changing Git operations in a dirty source checkout. | |
| subprocess.CompletedProcess | picurv_cli.core._git_source_command (list arguments) |
| Run a checked Git command against the active PICurv source checkout. | |
| picurv_cli.core.source_workflow (args) | |
| Fetch source history without silently changing the active code. | |
| picurv_cli.core._workspace_requested_version (str workspace_root) | |
| Resolve an exact version requested by an initialized workspace. | |
| picurv_cli.core.versions_workflow (args) | |
| List or activate a release using the existing source/build owners. | |
| picurv_cli.core.init_case (args) | |
| Implements the 'init' command. | |
| picurv_cli.core.sync_case_config_command (args) | |
| Refresh template-managed config/docs files in a case directory. | |
| picurv_cli.core.pull_source_repo (args) | |
| Refresh source branches in the repository resolved from a case directory. | |
| picurv_cli.core.build_project (args) | |
| Implements the 'build' command. | |
A comprehensive conductor script for the PICurv simulation platform.
This script acts as the central user interface for running simulations, managing configurations, and orchestrating the entire end-to-end workflow. It translates user-friendly YAML files into C-solver compatible control files, supports full multi-block configurations, and provides live log streaming. It features intelligent, content-based config file discovery and robustly manages data I/O paths for the post-processor. It also supports Slurm job generation/submission and parameter sweeps via job arrays.
Definition in file core.py.