Skip to content

Commit be29033

Browse files
authored
Merge pull request #96 from LorenFrankLab/fix-nwbinspector-import
Fix import from deprecated inspector tools module
2 parents f6399c8 + 6e45a0d commit be29033

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies:
88
- scipy
99
- pandas
1010
- pynwb
11-
- nwbinspector
11+
- nwbinspector>=0.5.0
1212
- dask
1313
- ipython
1414
- black

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies = [
2525
"scipy",
2626
"pandas",
2727
"pynwb",
28-
"nwbinspector",
28+
"nwbinspector>=0.5.0",
2929
"ndx_franklab_novela",
3030
"pyyaml",
3131
"neo",

src/trodes_to_nwb/convert.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,11 @@ def _inspect_nwb(nwbfile_path: Path, logger: logging.Logger):
341341
)
342342
logger.info("NWB Inspector output:")
343343
logger.info(messages)
344-
formatted_messages = nwbinspector.inspector_tools.format_messages(messages=messages)
344+
formatted_messages = nwbinspector.format_messages(messages=messages)
345345
report_file_path = (
346346
nwbfile_path.parent / f"{nwbfile_path.stem}_nwbinspector_report.txt"
347347
)
348-
nwbinspector.inspector_tools.save_report(
348+
nwbinspector.save_report(
349349
report_file_path=report_file_path,
350350
formatted_messages=formatted_messages,
351351
overwrite=True,
@@ -366,12 +366,10 @@ def _inspect_nwb(nwbfile_path: Path, logger: logging.Logger):
366366
print(
367367
f"NWB Inspector found the following {len(critical_errors)} critical errors:"
368368
)
369-
formatted_critical_errors = nwbinspector.inspector_tools.format_messages(
369+
formatted_critical_errors = nwbinspector.format_messages(
370370
messages=critical_errors
371371
)
372-
nwbinspector.inspector_tools.print_to_console(
373-
formatted_messages=formatted_critical_errors
374-
)
372+
nwbinspector.print_to_console(formatted_messages=formatted_critical_errors)
375373
else:
376374
print("NWB Inspector found 0 critical errors")
377375

0 commit comments

Comments
 (0)