File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 3232
3333### General
3434
35+ - remove hard coded key prefix for schema in launcher ([ #3432 ] ( https://github.com/nf-core/tools/pull/3432 ) )
3536- output passed to write_params_file as Path object ([ #3435 ] ( https://github.com/nf-core/tools/pull/3435 ) )
3637- chore(deps): update python:3.12-slim docker digest to 69ce3ae ([ #3433 ] ( https://github.com/nf-core/tools/pull/3433 ) )
3738- chore(deps): update dependency pytest-textual-snapshot to v1.1.0 ([ #3439 ] ( https://github.com/nf-core/tools/pull/3439 ) )
Original file line number Diff line number Diff line change @@ -406,10 +406,20 @@ def prompt_schema(self):
406406 """Go through the pipeline schema and prompt user to change defaults"""
407407 answers = {}
408408 # Start with the subschema in the definitions - use order of allOf
409- definitions_schemas = self .schema_obj .schema .get ("$defs" , self .schema_obj .schema .get ("definitions" , {})).items ()
409+ defs_notation = self .schema_obj .defs_notation
410+ log .debug (f"defs_notation: { defs_notation } " )
411+ definitions_schemas = self .schema_obj .schema .get (defs_notation , {})
410412 for allOf in self .schema_obj .schema .get ("allOf" , []):
411- d_key = allOf ["$ref" ][14 :]
412- answers .update (self .prompt_group (d_key , definitions_schemas [d_key ]))
413+ # Extract the key from the $ref by removing the prefix
414+ ref_value = allOf ["$ref" ]
415+ prefix = f"#/{ defs_notation } /"
416+ d_key = ref_value [len (prefix ) :] if ref_value .startswith (prefix ) else ref_value
417+ log .debug (f"d_key: { d_key } " )
418+ try :
419+ answers .update (self .prompt_group (d_key , definitions_schemas [d_key ]))
420+ except KeyError :
421+ log .warning (f"Could not find definition for { d_key } " )
422+ continue
413423
414424 # Top level schema params
415425 for param_id , param_obj in self .schema_obj .schema .get ("properties" , {}).items ():
You can’t perform that action at this time.
0 commit comments