INNER CODE UNIT · Python

sort_by_schema

nf-core/tools · nf_core/modules/lint/__init__.py:320

        def sort_by_schema(data, node):
            properties = node.get("properties", {}) if isinstance(node, dict) else {}
            if not isinstance(data, dict) or not properties:
                return data
            # Schema-ordered keys first (recursing into each), then any extras preserved
            ordered = {key: sort_by_schema(data[key], child) for key, child in properties.items() if key in data}
            return {**ordered, **{key: value for key, value in data.items() if key not in ordered}}

        return sort_by_schema(meta_yml, schema)

    def update_meta_yml_file(self, mod):
        """
        Update the meta.yml file with the correct inputs, outputs, topics and containers
        """
        meta_yml = self.read_meta_yml_patched(mod)
        if meta_yml is None:
            log.warning(f"Could not read meta.yml for {mod.component_name}, skipping update")
            return

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…