88from pathlib import Path
99from collections .abc import Iterable
1010from enum import Enum
11- from typing import Optional , List
11+ from typing import Union , Optional , List
1212from concurrent .futures import ProcessPoolExecutor , as_completed
1313from types import FunctionType
1414from warnings import filterwarnings , warn
@@ -279,7 +279,7 @@ def inspect_all(
279279 config : Optional [dict ] = None ,
280280 ignore : OptionalListOfStrings = None ,
281281 select : OptionalListOfStrings = None ,
282- importance_threshold : Importance = Importance .BEST_PRACTICE_SUGGESTION ,
282+ importance_threshold : Union [ str , Importance ] = Importance .BEST_PRACTICE_SUGGESTION ,
283283 n_jobs : int = 1 ,
284284 skip_validate : bool = False ,
285285 progress_bar : bool = True ,
@@ -306,7 +306,7 @@ def inspect_all(
306306 Names of functions to skip.
307307 select: list of strings, optional
308308 Names of functions to pick out of available checks.
309- importance_threshold : string, optional
309+ importance_threshold : string or Importance , optional
310310 Ignores tests with an assigned importance below this threshold.
311311 Importance has three levels:
312312 CRITICAL
@@ -337,6 +337,9 @@ def inspect_all(
337337 Common options are 'draft' or 'published'.
338338 Defaults to the most recent published version, or if not published then the most recent draft version.
339339 """
340+ importance_threshold = (
341+ Importance [importance_threshold ] if isinstance (importance_threshold , str ) else importance_threshold
342+ )
340343 modules = modules or []
341344 if progress_bar_options is None :
342345 progress_bar_options = dict (position = 0 , leave = False )
@@ -411,7 +414,7 @@ def inspect_nwb(
411414 config : dict = None ,
412415 ignore : OptionalListOfStrings = None ,
413416 select : OptionalListOfStrings = None ,
414- importance_threshold : Importance = Importance .BEST_PRACTICE_SUGGESTION ,
417+ importance_threshold : Union [ str , Importance ] = Importance .BEST_PRACTICE_SUGGESTION ,
415418 driver : Optional [str ] = None ,
416419 skip_validate : bool = False ,
417420 max_retries : int = 10 ,
@@ -433,7 +436,7 @@ def inspect_nwb(
433436 Names of functions to skip.
434437 select: list, optional
435438 Names of functions to pick out of available checks.
436- importance_threshold : string, optional
439+ importance_threshold : string or Importance , optional
437440 Ignores tests with an assigned importance below this threshold.
438441 Importance has three levels:
439442 CRITICAL
@@ -454,6 +457,9 @@ def inspect_nwb(
454457 This sets a hard bound on the number of times to attempt to retry the collection of messages.
455458 Defaults to 10 (corresponds to 102.4s maximum delay on final attempt).
456459 """
460+ importance_threshold = (
461+ Importance [importance_threshold ] if isinstance (importance_threshold , str ) else importance_threshold
462+ )
457463 if any (x is not None for x in [config , ignore , select , importance_threshold ]):
458464 checks = configure_checks (
459465 checks = checks , config = config , ignore = ignore , select = select , importance_threshold = importance_threshold
0 commit comments