From fd5fd152f3c4904c3e91f370091f83434d78c465 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 12 Mar 2024 18:24:24 +0100 Subject: [PATCH 1/3] Assert that at least one file in npz zipfile ends with .npy from https://pydoc.dev/numpy/latest/numpy.lib.npyio.NpzFile.html: > NpzFile is used to load files in the NumPy .npz data archive format. It assumes that files in the archive have a .npy extension, other files are ignored. --- lib/galaxy/datatypes/binary.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/datatypes/binary.py b/lib/galaxy/datatypes/binary.py index 0f53030b3d0..1598da17467 100644 --- a/lib/galaxy/datatypes/binary.py +++ b/lib/galaxy/datatypes/binary.py @@ -4297,9 +4297,9 @@ class Npz(CompressedArchive): def sniff(self, filename: str) -> bool: try: - npz = np.load(filename) - if isinstance(npz, np.lib.npyio.NpzFile): - return True + with np.load(filename) as npz: + if isinstance(npz, np.lib.npyio.NpzFile) and any(f.filename.endswith(".npy") for f in npz.zip.filelist): + return True except Exception: return False return False From 13a691c71441bdae409034fbc5f66fbe1c87d644 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 12 Mar 2024 19:13:31 +0100 Subject: [PATCH 2/3] Explicitly exclude ConnectedValue from runtime input check --- lib/galaxy/managers/workflows.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/managers/workflows.py b/lib/galaxy/managers/workflows.py index 2e33b001e2c..d4c46b8b775 100644 --- a/lib/galaxy/managers/workflows.py +++ b/lib/galaxy/managers/workflows.py @@ -81,6 +81,7 @@ from galaxy.tools.parameters import ( visit_input_values, ) from galaxy.tools.parameters.basic import ( + ConnectedValue, DataCollectionToolParameter, DataToolParameter, RuntimeValue, @@ -1494,12 +1495,12 @@ class WorkflowContentsManager(UsesAnnotations): if name: input_dicts.append({"name": name, "description": annotation_str}) for name, val in step_state.items(): - if isinstance(val, RuntimeValue): + if isinstance(val, RuntimeValue) and not isinstance(val, ConnectedValue): input_dicts.append({"name": name, "description": f"runtime parameter for tool {module.get_name()}"}) elif isinstance(val, dict): # Input type is described by a dict, e.g. indexed parameters. for partval in val.values(): - if isinstance(partval, RuntimeValue): + if isinstance(partval, RuntimeValue) and not isinstance(val, ConnectedValue): input_dicts.append( {"name": name, "description": f"runtime parameter for tool {module.get_name()}"} ) From 2493844367ee58e0a292c67936133f043f35c9aa Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 12 Mar 2024 22:34:30 -0400 Subject: [PATCH 3/3] Fix contentitem display routing. We use a custom push method that has a different signature, hence the ts-ignores which can be removed with the migration to vue-router4 and native 'force' arg. --- client/src/components/History/Content/ContentItem.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/components/History/Content/ContentItem.vue b/client/src/components/History/Content/ContentItem.vue index 70059b96f61..dc7022d3a82 100644 --- a/client/src/components/History/Content/ContentItem.vue +++ b/client/src/components/History/Content/ContentItem.vue @@ -250,10 +250,11 @@ function onDisplay() { // but we're using a __vkey__ bit as a workaround // Only conditionally force to keep urls clean most of the time. if (route.path === itemUrls.value.display) { - // @ts-ignore + // @ts-ignore - monkeypatched router, drop with migration. router.push(itemUrls.value.display, { title: props.name, force: true }); } else if (itemUrls.value.display) { - router.push({ path: itemUrls.value.display, params: { title: props.name } }); + // @ts-ignore - monkeypatched router, drop with migration. + router.push(itemUrls.value.display, { title: props.name }); } } }