From 61d305d727d571cd35626ef2c73a1f9509cd3f59 Mon Sep 17 00:00:00 2001 From: Bjoern Gruening Date: Tue, 25 Aug 2026 20:11:21 +0200 Subject: [PATCH 1/2] Migrate obfs datatype from basic to auto_primary_file composite type The OpenBabel Fastsearch (obfs) datatype was registered with composite_type='basic', but the upload pipeline (galaxy/tools/data_fetch.py) only supports 'auto_primary_file' composites -- 'basic' composites trigger an unimplemented assertion ('basic composite uploads not yet implemented'). This blocked the obfs datatype from being assembled as a tool input in the test framework, forcing downstream tools that consume obfs (openbabel subsearch, simsearch) to use expect_failure tests that never actually exercise the tool. The obfs primary file is a 0-byte placeholder; the real data lives entirely in the composite extra files (molecule.fs and the molecule source file), which is exactly the auto_primary_file pattern. Switch the composite type and add generate_primary_file/regenerate_primary_file to produce an HTML index page, following the established pattern (e.g. spaln, gis, neo4j). --- lib/galaxy/datatypes/molecules.py | 36 +++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/datatypes/molecules.py b/lib/galaxy/datatypes/molecules.py index b6100795bce7..27ebf43ffe93 100644 --- a/lib/galaxy/datatypes/molecules.py +++ b/lib/galaxy/datatypes/molecules.py @@ -10,7 +10,10 @@ Text, ) from galaxy.datatypes.metadata import MetadataElement -from galaxy.datatypes.protocols import DatasetProtocol +from galaxy.datatypes.protocols import ( + DatasetProtocol, + HasExtraFilesAndMetadata, +) from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, @@ -628,7 +631,7 @@ class OBFS(Binary): """OpenBabel Fastsearch format (fs).""" file_ext = "obfs" - composite_type = "basic" + composite_type = "auto_primary_file" MetadataElement( name="base_name", @@ -651,6 +654,35 @@ def __init__(self, **kwd): self.add_composite_file("molecule.mol2", optional=True, is_binary=False, description="Molecule File") self.add_composite_file("molecule.cml", optional=True, is_binary=False, description="Molecule File") + def generate_primary_file(self, dataset: HasExtraFilesAndMetadata) -> str: + rval = ["OpenBabel Fastsearch Index

"] + rval.append("

This composite dataset is composed of the following files:

") + return "\n".join(rval) + + def regenerate_primary_file(self, dataset: DatasetProtocol) -> None: + efp = dataset.extra_files_path + flist = os.listdir(efp) + rval = [ + f"Files for Composite Dataset {dataset.name}

Composite {dataset.name} contains:

") + with open(dataset.get_file_name(), "w") as f: + f.write("\n".join(rval)) + def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: """Set the peek and blurb text.""" if not dataset.dataset.purged: From c31fb9b1d9ed5643c7de66db706f07dff0c363ec Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 25 Aug 2026 15:44:15 -0400 Subject: [PATCH 2/2] Fix ruff UP032 in OBFS.generate_primary_file Convert the .format() call to an f-string. Only lint change; ruff check ., flake8, isort and black are all clean afterward. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01G95icoGkoDKbwPotGnvQpk --- lib/galaxy/datatypes/molecules.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/galaxy/datatypes/molecules.py b/lib/galaxy/datatypes/molecules.py index 27ebf43ffe93..b929eb488a22 100644 --- a/lib/galaxy/datatypes/molecules.py +++ b/lib/galaxy/datatypes/molecules.py @@ -661,9 +661,7 @@ def generate_primary_file(self, dataset: HasExtraFilesAndMetadata) -> str: description = composite_file.get("description") if description: rval.append( - '
  • {} ({})
  • '.format( - composite_name, composite_name, description - ) + f'
  • {composite_name} ({description})
  • ' ) else: rval.append(f'
  • {composite_name}
  • ')