diff --git a/pdf_build_src/process_markdowns.py b/pdf_build_src/process_markdowns.py index 705daa8b22..42e984fa98 100644 --- a/pdf_build_src/process_markdowns.py +++ b/pdf_build_src/process_markdowns.py @@ -559,7 +559,7 @@ def correct_tables(root_path, debug=False): for i, new_line in enumerate(content): if i == start_line: new_content.pop() - if i >= start_line and i < end_line: + if start_line <= i < end_line: new_content.append("|".join(table[count]) + " \n") count += 1 elif i == end_line: diff --git a/tools/add_contributors.py b/tools/add_contributors.py index 1fe86f6abf..c6cc537dcd 100644 --- a/tools/add_contributors.py +++ b/tools/add_contributors.py @@ -115,7 +115,6 @@ def emoji_map(reverse=False) -> dict[str, str]: "tutorial": ":check_mark_button:", "maintenance": ":construction:", "financial": ":dollar_banknote:", - "infra": ":metro:", } @@ -333,7 +332,7 @@ def update_tributors( """ALLCONTRIB""" -def load_allcontrib(allcontrib_file: Path) -> None: +def load_allcontrib(allcontrib_file: Path) -> dict: """Load `.all-contributorsrc` file.""" with open(allcontrib_file, "r", encoding="utf8") as input_file: return json.load(input_file) diff --git a/tools/mkdocs_macros_bids/macros.py b/tools/mkdocs_macros_bids/macros.py index f68453c6b8..e43e8449d3 100644 --- a/tools/mkdocs_macros_bids/macros.py +++ b/tools/mkdocs_macros_bids/macros.py @@ -208,7 +208,7 @@ def make_metadata_table(field_info, src_path=None): Parameters ---------- - field_names : dict + field_info : dict A list of the field names. Field names correspond to filenames in the "metadata" directory of the schema. diff --git a/tools/schemacode/bidsschematools/render/tables.py b/tools/schemacode/bidsschematools/render/tables.py index cf8645ffeb..b32e982e52 100644 --- a/tools/schemacode/bidsschematools/render/tables.py +++ b/tools/schemacode/bidsschematools/render/tables.py @@ -284,7 +284,7 @@ def make_entity_table(schema, tablefmt="github", src_path=None, **kwargs): Parameters ---------- - schema_path : str + schema : str Directory containing schema, which is stored in yaml files. tablefmt : string, optional The target table format. The default is "github" (GitHub format). diff --git a/tools/schemacode/bidsschematools/render/text.py b/tools/schemacode/bidsschematools/render/text.py index 1106e17185..c9fb6f2298 100644 --- a/tools/schemacode/bidsschematools/render/text.py +++ b/tools/schemacode/bidsschematools/render/text.py @@ -559,10 +559,6 @@ def render_text(schema, key: str, src_path=None): schema : dict The BIDS schema. - object : str - The object to render the description for: - possible values correspond to the keys in schema["objects"]. - key : str The key of the object to render the description for: possible values correspond to the keys in schema["objects"][object] diff --git a/tools/schemacode/bidsschematools/schema.py b/tools/schemacode/bidsschematools/schema.py index 8a51725f1b..cae15fece1 100644 --- a/tools/schemacode/bidsschematools/schema.py +++ b/tools/schemacode/bidsschematools/schema.py @@ -130,7 +130,7 @@ def flatten_enums(namespace, inplace=True): Parameters ---------- - schema : dict + namespace : dict Schema in dictionary form to be flattened. Returns diff --git a/tools/schemacode/bidsschematools/validator.py b/tools/schemacode/bidsschematools/validator.py index 34621a8c60..4ec04f6df6 100644 --- a/tools/schemacode/bidsschematools/validator.py +++ b/tools/schemacode/bidsschematools/validator.py @@ -133,9 +133,9 @@ def _get_directory_suffixes(my_schema): def _get_paths( bids_paths, - pseudofile_suffixes=[], + pseudofile_suffixes=None, dummy_paths=False, - exclude_files=[], + exclude_files=None, ): """ Get all paths from a list of directories, excluding hidden subdirectories from distribution. @@ -166,6 +166,11 @@ def _get_paths( first. """ + if exclude_files is None: + exclude_files = [] + if pseudofile_suffixes is None: + pseudofile_suffixes = [] + path_list = [] bidsignore_list = [] bids_root_found = False @@ -387,7 +392,7 @@ def validate_all( Parameters ---------- - bids_paths : list or str + paths_list : list or str A string pointing to a BIDS directory for which paths should be validated, or a list of strings pointing to individual files or subdirectories which *all* reside within one and only one BIDS directory root (i.e. nested datasets should be validated @@ -548,7 +553,7 @@ def validate_bids( report_path=False, suppress_errors=False, accept_non_bids_dir=False, - exclude_files=[], + exclude_files=None, ): """ Validate paths according to BIDS schema. @@ -604,6 +609,9 @@ def validate_bids( https://github.com/bids-standard/bids-specification/pull/969#issuecomment-1132119492 """ + if exclude_files is None: + exclude_files = [] + if isinstance(in_paths, str): in_paths = [in_paths]