Skip to content

Commit

Permalink
debugs
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD committed Aug 13, 2024
1 parent 68b2815 commit 84df2ee
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 41 deletions.
12 changes: 1 addition & 11 deletions src/nwbinspector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,7 @@
from ._inspection import inspect_nwb # TODO: remove after 7/1/2023
from ._formatting import format_messages, print_to_console, save_report, MessageFormatter, FormatterOptions
from ._organization import organize_messages
from .checks.ecephys import *
from .checks.general import *
from .checks.image_series import *
from .checks.images import *
from .checks.nwb_containers import *
from .checks.nwbfile_metadata import *
from .checks.ogen import *
from .checks.ophys import *
from .checks.tables import *
from .checks.time_series import *
from .checks.icephys import *
from .checks import *

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

Expand Down
5 changes: 3 additions & 2 deletions src/nwbinspector/_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@

import numpy as np

from ._registration import InspectorMessage, Importance
from .utils._utils import get_package_version, FilePathType
from ._types import InspectorMessage, Importance
from ._organization import organize_messages
from .utils import get_package_version, FilePathType


def _get_report_header():
Expand Down
2 changes: 1 addition & 1 deletion src/nwbinspector/_inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from tqdm import tqdm
from natsort import natsorted

from . import available_checks
from . import available_checks, configure_checks
from ._registration import InspectorMessage, Importance
from .tools import get_s3_urls_and_dandi_paths
from .utils import (
Expand Down
15 changes: 3 additions & 12 deletions src/nwbinspector/_inspection_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,9 @@

import click

from ._formatting import (
_get_report_header,
format_messages,
print_to_console,
save_report,
)
from ._registration import Importance
from nwbinspector.utils._utils import (
strtobool,
)

from ._inspection import inspect_all
from ._formatting import _get_report_header
from . import Importance, inspect_all, format_messages, print_to_console, save_report, __version__
from .utils import strtobool


@click.command()
Expand Down
11 changes: 11 additions & 0 deletions src/nwbinspector/checks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from .ecephys import *
from .general import *
from .image_series import *
from .images import *
from .nwb_containers import *
from .nwbfile_metadata import *
from .ogen import *
from .ophys import *
from .tables import *
from .time_series import *
from .icephys import *
4 changes: 2 additions & 2 deletions src/nwbinspector/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
update_testing_config,
generate_testing_files,
generate_image_series_testing_files,
make_minimal_nwbfilem,
make_minimal_nwbfile,
TESTING_CONFIG_FILE_PATH,
)

Expand All @@ -20,6 +20,6 @@
"update_testing_config",
"generate_testing_files",
"generate_image_series_testing_files",
"make_minimal_nwbfilem",
"make_minimal_nwbfile",
"TESTING_CONFIG_FILE_PATH",
]
18 changes: 13 additions & 5 deletions tests/test_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,24 @@

from nwbinspector import (
Importance,
Severity,
InspectorMessage,
register_check,
load_config,
inspect_all,
inspect_nwbfile,
inspect_nwbfile_object,
available_checks,
)
from nwbinspector.checks import (
check_small_dataset_compression,
check_regular_timestamps,
check_data_orientation,
check_timestamps_match_first_dimension,
check_subject_exists,
load_config,
)
from nwbinspector import inspect_all, inspect_nwbfile, inspect_nwbfile_object, available_checks
from nwbinspector._registration import Severity, InspectorMessage, register_check
from nwbinspector.tools import make_minimal_nwbfile
from nwbinspector.utils._utils import FilePathType
from nwbinspector.testing import make_minimal_nwbfile
from nwbinspector.utils import FilePathType


def add_big_dataset_no_compression(nwbfile: NWBFile):
Expand Down Expand Up @@ -120,6 +127,7 @@ def assertFileExists(self, path: FilePathType):
def assertLogFileContentsEqual(
self, test_file_path: FilePathType, true_file_path: FilePathType, skip_first_newlines: bool = False
):
skip_first_n_lines = 0
with open(file=test_file_path, mode="r") as test_file:
with open(file=true_file_path, mode="r") as true_file:
test_file_lines = test_file.readlines()
Expand Down
3 changes: 1 addition & 2 deletions tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import pynwb
from hdmf.testing import TestCase

from nwbinspector import InspectorMessage, Importance, Severity, organize_messages
from nwbinspector.tools import all_of_type
from nwbinspector._formatting import organize_messages
from nwbinspector._registration import InspectorMessage, Importance, Severity


def test_all_of_type():
Expand Down
3 changes: 1 addition & 2 deletions tests/unit_tests/test_image_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
check_image_series_data_size,
check_timestamps_match_first_dimension,
)
from nwbinspector.tools import make_minimal_nwbfile
from nwbinspector.testing._testing import load_testing_config
from nwbinspector.testing import make_minimal_nwbfile, load_testing_config

try:
testing_config = load_testing_config()
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/test_nwbfile_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
check_session_start_time_future_date,
PROCESSING_MODULE_CONFIG,
)
from nwbinspector.tools import make_minimal_nwbfile
from nwbinspector.testing import make_minimal_nwbfile


minimal_nwbfile = make_minimal_nwbfile()
Expand Down
5 changes: 2 additions & 3 deletions tests/unit_tests/test_time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
check_timestamp_of_the_first_sample_is_not_negative,
check_rate_is_not_zero,
)
from nwbinspector.tools import make_minimal_nwbfile
from nwbinspector.testing._testing import check_streaming_tests_enabled
from nwbinspector.utils._utils import get_package_version, robust_s3_read
from nwbinspector.testing import make_minimal_nwbfile, check_streaming_tests_enabled
from nwbinspector.utils import get_package_version, robust_s3_read

STREAMING_TESTS_ENABLED, DISABLED_STREAMING_TESTS_REASON = check_streaming_tests_enabled()

Expand Down

0 comments on commit 84df2ee

Please sign in to comment.