OCDocker.Workbench.AblationDesign module

Interactive ablation-design helpers for the strict OCScore Workbench dashboard.

OCDocker.Workbench.AblationDesign.build_ablation_design_context(root)[source]

Build catalog and workspace defaults for the ablation designer UI.

Parameters:

root (str or pathlib.Path) – Served OCScore output root.

Returns:

JSON-safe design context payload.

Return type:

dict[str, Any]

OCDocker.Workbench.AblationDesign.discover_ablation_input_features(body, root=None)[source]

Discover candidate model features from raw PDBbind/DUDEz modeling inputs.

Parameters:
  • body (dict[str, Any]) – Parsed JSON request body with input paths and optional feature_source.

  • root (str, pathlib.Path, or None) – Served OCScore output root used to auto-discover raw_prepare/ tables when explicit input paths are omitted.

Returns:

JSON-safe payload with metadata/target columns removed from candidates.

Return type:

dict[str, Any]

Raises:
  • ValueError – If input paths or feature_source are invalid.

  • FileNotFoundError – If referenced input paths do not exist.

OCDocker.Workbench.AblationDesign.handle_ablation_design_post(root, endpoint, body)[source]

Dispatch one ablation-design POST endpoint.

Parameters:
  • root (str or pathlib.Path) – Served OCScore output root.

  • endpoint (str) – Request path.

  • body (dict[str, Any]) – Parsed JSON request body.

Returns:

JSON-safe response payload.

Return type:

dict[str, Any]

Raises:

ValueError – If the endpoint is unknown or the request body is invalid.

OCDocker.Workbench.AblationDesign.plan_ablation_design(root, body)[source]

Validate a draft ablation, emit YAML, command plan, and preflight checks.

Parameters:
  • root (str or pathlib.Path) – Served OCScore output root.

  • body (dict[str, Any]) – Parsed JSON request body containing policy and run settings.

Returns:

JSON-safe plan payload with YAML, command, spec, and preflight report.

Return type:

dict[str, Any]

Raises:

ValueError – If the request body is invalid.

OCDocker.Workbench.AblationDesign.preview_ablation_design(root, body)[source]

Preview one draft feature policy against workspace candidate features.

Parameters:
  • root (str or pathlib.Path) – Served OCScore output root.

  • body (dict[str, Any]) – Parsed JSON request body containing a policy mapping.

Returns:

JSON-safe preview payload.

Return type:

dict[str, Any]

Raises:

ValueError – If the request body is invalid.

OCDocker.Workbench.AblationDesign.write_ablation_design_policy(root, body)[source]

Write one draft feature-policy YAML into the served workspace layout.

Parameters:
  • root (str or pathlib.Path) – Served OCScore output root.

  • body (dict[str, Any]) – Parsed JSON request body with policy, policy_yml_path, confirm, and optional overwrite.

Returns:

JSON-safe write result.

Return type:

dict[str, Any]

Raises:
  • ValueError – If confirmation, paths, or overwrite guards fail.

  • FileExistsError – If the target file exists and overwrite is not set.