Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method to import checks from any known extensions #447

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@

* Fixed `--modules` flag in `nwbinspector` command line interface to allow for import of additional modules in the command line. This was necessary to be able to register new customized checks to the NWB Inspector. [#446](https://github.com/NeurodataWithoutBorders/nwbinspector/pull/446)

### Improvements

* Enabled auto-import of checks defined from a set of known extensions, beginning with `ndx_multichannel_volume`. [#447](https://github.com/NeurodataWithoutBorders/nwbinspector/pull/447)



# v0.4.33

### Fixes
Expand Down
9 changes: 9 additions & 0 deletions src/nwbinspector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@
from .checks.icephys import *

default_check_registry = {check.__name__: check for check in available_checks}

# Automatically import from a set of known extensions that might be installed
import importlib

KNOWN_EXTENSIONS = ["ndx_multichannel_volume"]
for extension_candidate in KNOWN_EXTENSIONS:
if importlib.util.find_spec(name=extension_candidate) is not None:
importlib.import_module(name=extension_candidate)
# Any checks exposed to the extension __init__ will now be registered
Loading