Skip to content

Commit

Permalink
Fix import from deprecated inspector tools module
Browse files Browse the repository at this point in the history
  • Loading branch information
edeno committed Oct 8, 2024
1 parent f6399c8 commit 6dc69f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
- scipy
- pandas
- pynwb
- nwbinspector
- nwbinspector>=5.0.0
- dask
- ipython
- black
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies = [
"scipy",
"pandas",
"pynwb",
"nwbinspector",
"nwbinspector>=5.0.0",
"ndx_franklab_novela",
"pyyaml",
"neo",
Expand Down
10 changes: 4 additions & 6 deletions src/trodes_to_nwb/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,11 @@ def _inspect_nwb(nwbfile_path: Path, logger: logging.Logger):
)
logger.info("NWB Inspector output:")
logger.info(messages)
formatted_messages = nwbinspector.inspector_tools.format_messages(messages=messages)
formatted_messages = nwbinspector.format_messages(messages=messages)
report_file_path = (
nwbfile_path.parent / f"{nwbfile_path.stem}_nwbinspector_report.txt"
)
nwbinspector.inspector_tools.save_report(
nwbinspector.save_report(
report_file_path=report_file_path,
formatted_messages=formatted_messages,
overwrite=True,
Expand All @@ -366,12 +366,10 @@ def _inspect_nwb(nwbfile_path: Path, logger: logging.Logger):
print(
f"NWB Inspector found the following {len(critical_errors)} critical errors:"
)
formatted_critical_errors = nwbinspector.inspector_tools.format_messages(
formatted_critical_errors = nwbinspector.format_messages(
messages=critical_errors
)
nwbinspector.inspector_tools.print_to_console(
formatted_messages=formatted_critical_errors
)
nwbinspector.print_to_console(formatted_messages=formatted_critical_errors)
else:
print("NWB Inspector found 0 critical errors")

Expand Down

0 comments on commit 6dc69f8

Please sign in to comment.