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
@@ -278,7 +278,7 @@ def inspect_all(
278278 config : Optional [dict ] = None ,
279279 ignore : OptionalListOfStrings = None ,
280280 select : OptionalListOfStrings = None ,
281- importance_threshold : Importance = Importance .BEST_PRACTICE_SUGGESTION ,
281+ importance_threshold : Union [ str , Importance ] = Importance .BEST_PRACTICE_SUGGESTION ,
282282 n_jobs : int = 1 ,
283283 skip_validate : bool = False ,
284284 progress_bar : bool = True ,
@@ -305,7 +305,7 @@ def inspect_all(
305305 Names of functions to skip.
306306 select: list of strings, optional
307307 Names of functions to pick out of available checks.
308- importance_threshold : string, optional
308+ importance_threshold : string or Importance , optional
309309 Ignores tests with an assigned importance below this threshold.
310310 Importance has three levels:
311311 CRITICAL
@@ -336,6 +336,9 @@ def inspect_all(
336336 Common options are 'draft' or 'published'.
337337 Defaults to the most recent published version, or if not published then the most recent draft version.
338338 """
339+ importance_threshold = (
340+ Importance [importance_threshold ] if isinstance (importance_threshold , str ) else importance_threshold
341+ )
339342 modules = modules or []
340343 if progress_bar_options is None :
341344 progress_bar_options = dict (position = 0 , leave = False )
@@ -410,7 +413,7 @@ def inspect_nwb(
410413 config : dict = None ,
411414 ignore : OptionalListOfStrings = None ,
412415 select : OptionalListOfStrings = None ,
413- importance_threshold : Importance = Importance .BEST_PRACTICE_SUGGESTION ,
416+ importance_threshold : Union [ str , Importance ] = Importance .BEST_PRACTICE_SUGGESTION ,
414417 driver : str = None ,
415418 skip_validate : bool = False ,
416419) -> List [InspectorMessage ]:
@@ -431,7 +434,7 @@ def inspect_nwb(
431434 Names of functions to skip.
432435 select: list, optional
433436 Names of functions to pick out of available checks.
434- importance_threshold : string, optional
437+ importance_threshold : string or Importance , optional
435438 Ignores tests with an assigned importance below this threshold.
436439 Importance has three levels:
437440 CRITICAL
@@ -447,6 +450,9 @@ def inspect_nwb(
447450 Skip the PyNWB validation step. This may be desired for older NWBFiles (< schema version v2.10).
448451 The default is False, which is also recommended.
449452 """
453+ importance_threshold = (
454+ Importance [importance_threshold ] if isinstance (importance_threshold , str ) else importance_threshold
455+ )
450456 if any (x is not None for x in [config , ignore , select , importance_threshold ]):
451457 checks = configure_checks (
452458 checks = checks , config = config , ignore = ignore , select = select , importance_threshold = importance_threshold
0 commit comments