Skip to content

Commit

Permalink
soft deprecate
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD committed Aug 26, 2024
1 parent 0d569e2 commit 9421941
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions src/nwbinspector/_nwb_inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,27 +92,38 @@ def inspect_all(
These modules may also contain their own custom checks for their extensions.
"""
in_path = Path(path)
importance_threshold = (
Importance[importance_threshold] if isinstance(importance_threshold, str) else importance_threshold
)
modules = modules or []

for module in modules:
importlib.import_module(module)

# TODO: remove after 3/1/2025
if version_id is not None:
message = (
"The `version_id` argument is deprecated and will be removed after 3/1/2025. "
"Please call `nwbinspector.inspect_dandiset` with the argument `dandiset_version` instead."
)
warn(message=message, category=DeprecationWarning, stacklevel=2)
if stream is True:
message = (
"The `stream` argument is deprecated and will be removed after 3/1/2025. "
"Please call `nwbinspector.inspect_dandiset` instead."
)
warn(message=message, category=DeprecationWarning, stacklevel=2)

inspect_dandiset()
if version_id is not None:
message = (
"The `version_id` argument is deprecated and will be removed after 3/1/2025. "
"Please call `nwbinspector.inspect_dandiset` with the argument `dandiset_version` instead."
)
warn(message=message, category=DeprecationWarning, stacklevel=2)
for message in inspect_dandiset(
dandiset_id=path,
dandiset_version=version_id,
config=config,
ignore=ignore,
select=select,
skip_validate=skip_validate,
):
yield message

importance_threshold = (
Importance[importance_threshold] if isinstance(importance_threshold, str) else importance_threshold
)
modules = modules or []
n_jobs = calculate_number_of_cpu(requested_cpu=n_jobs)
if progress_bar_options is None:
progress_bar_options = dict(position=0, leave=False)
Expand All @@ -126,8 +137,6 @@ def inspect_all(
nwbfiles = [in_path]
else:
raise ValueError(f"{in_path} should be a directory or an NWB file.")
for module in modules:
importlib.import_module(module)
# Filtering of checks should apply after external modules are imported, in case those modules have their own checks
checks = configure_checks(config=config, ignore=ignore, select=select, importance_threshold=importance_threshold)

Expand Down

0 comments on commit 9421941

Please sign in to comment.