拓展分析运行已发布时个别样例报前缀不对的问题
This commit is contained in:
@@ -1333,6 +1333,15 @@ def _binding_replacements(
|
||||
}
|
||||
patched_path_roots: list[tuple[str, str]] = []
|
||||
|
||||
prefix = resolved.get("prefix_binding")
|
||||
prefix_old = prefix.get("old_prefix") if isinstance(prefix, dict) else None
|
||||
prefix_new = prefix.get("new_prefix") if isinstance(prefix, dict) else None
|
||||
participating_inputs = (
|
||||
set(prefix.get("participating_inputs") or ())
|
||||
if isinstance(prefix, dict)
|
||||
else set()
|
||||
)
|
||||
|
||||
def add(binding_key: str, original: str, replacement: str) -> None:
|
||||
if replacement == original:
|
||||
return
|
||||
@@ -1349,14 +1358,28 @@ def _binding_replacements(
|
||||
runtime = Path(str(binding.get("runtime_path") or ""))
|
||||
binding_key = f"path:{original}"
|
||||
replacement = runtime.name
|
||||
# When the output prefix is derived from an input name (e.g. seqkit
|
||||
# derives ``split_fasta/Ft.SPL.pep.part_001.fasta`` from the input
|
||||
# ``Ft.SPL.pep.fasta``), the participating input must be renamed as
|
||||
# well. Otherwise the tool keeps writing outputs under the original
|
||||
# prefix and the renamed outputs never materialise. ``output.fasta``
|
||||
# is symlinked into the work tree by render_runtime_package.
|
||||
if (
|
||||
isinstance(prefix_old, str)
|
||||
and isinstance(prefix_new, str)
|
||||
and original in participating_inputs
|
||||
and _output_has_prefix(replacement, prefix_old)
|
||||
):
|
||||
replacement = _replace_output_prefix(
|
||||
replacement, prefix_old, prefix_new
|
||||
)
|
||||
add(binding_key, original, replacement)
|
||||
if replacement != original and binding_key in patchable:
|
||||
patched_path_roots.append((original, replacement))
|
||||
|
||||
prefix = resolved.get("prefix_binding")
|
||||
if isinstance(prefix, dict):
|
||||
old_prefix = prefix.get("old_prefix")
|
||||
new_prefix = prefix.get("new_prefix")
|
||||
old_prefix = prefix_old
|
||||
new_prefix = prefix_new
|
||||
if isinstance(old_prefix, str) and isinstance(new_prefix, str):
|
||||
for reference in contract.get("path_references", []):
|
||||
if not isinstance(reference, dict):
|
||||
|
||||
@@ -621,10 +621,13 @@ class LightweightExtensionService:
|
||||
def _job_path(path: Path, roots: tuple[Path, Path]) -> Path:
|
||||
candidate = Path(os.path.abspath(Path(path).expanduser())).resolve()
|
||||
resolved_roots = tuple(root.resolve() for root in roots)
|
||||
if not candidate.is_file() or not any(
|
||||
candidate.is_relative_to(root) for root in resolved_roots
|
||||
):
|
||||
raise ValueError("runtime input must be a file inside the selected job")
|
||||
inside = any(candidate.is_relative_to(root) for root in resolved_roots)
|
||||
if not candidate.is_file():
|
||||
raise ValueError(f"runtime input file not found: {candidate}")
|
||||
if not inside:
|
||||
raise ValueError(
|
||||
f"runtime input must be a file inside the selected job: {candidate}"
|
||||
)
|
||||
return candidate
|
||||
|
||||
def _execute(
|
||||
|
||||
Reference in New Issue
Block a user