Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD committed Sep 6, 2024
1 parent b756e24 commit 814907c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/nwbinspector/_dandi_inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ def inspect_url(
url: str,
config: Union[str, pathlib.Path, dict, Literal["dandi"]] = "dandi",
checks: Union[list, None] = None,
ignore: Union[List[str], None] = None,
select: Union[List[str], None] = None,
ignore: Union[list[str], None] = None,
select: Union[list[str], None] = None,
importance_threshold: Union[str, Importance] = Importance.BEST_PRACTICE_SUGGESTION,
skip_validate: bool = False,
) -> Iterable[Union[InspectorMessage, None]]:
Expand Down
10 changes: 5 additions & 5 deletions src/nwbinspector/_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class FormatterOptions:
"""Class structure for defining all free attributes for the design of a report format."""

def __init__(
self, indent_size: int = 2, indent: Optional[str] = None, section_headers: List[str] = ["=", "-", "~"]
self, indent_size: int = 2, indent: Optional[str] = None, section_headers: list[str] = ["=", "-", "~"]
):
"""
Class that defines all the format parameters used by the generic MessageFormatter.
Expand Down Expand Up @@ -107,7 +107,7 @@ def __init__(
self.formatted_messages = []

@staticmethod
def _count_messages_by_importance(messages: list[InspectorMessage]) -> Dict[str, int]:
def _count_messages_by_importance(messages: list[InspectorMessage]) -> dict[str, int]:
message_count_by_importance = {importance_level.name: 0 for importance_level in Importance}
for message in messages:
message_count_by_importance[message.importance.name] += 1
Expand Down Expand Up @@ -221,7 +221,7 @@ def format_messages(
levels: list[str] = None,
reverse: Optional[list[bool]] = None,
detailed: bool = False,
) -> List[str]:
) -> list[str]:
"""Print InspectorMessages in order specified by the organization structure."""
if levels is None:
levels = ["file_path", "importance"]
Expand All @@ -230,14 +230,14 @@ def format_messages(
return formatted_messages


def print_to_console(formatted_messages: List[str]):
def print_to_console(formatted_messages: list[str]):
"""Print report file contents to console."""
sys.stdout.write(os.linesep * 2)
for line in formatted_messages:
sys.stdout.write(line + "\n")


def save_report(report_file_path: FilePathType, formatted_messages: List[str], overwrite=False):
def save_report(report_file_path: FilePathType, formatted_messages: list[str], overwrite=False):
"""Write the list of organized check results to a nicely formatted text file."""
report_file_path = Path(report_file_path)
if report_file_path.exists() and not overwrite:
Expand Down
2 changes: 1 addition & 1 deletion src/nwbinspector/testing/_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def make_minimal_nwbfile():
return NWBFile(session_description="", identifier=str(uuid4()), session_start_time=datetime.now().astimezone())


def check_streaming_enabled() -> Tuple[bool, Optional[str]]:
def check_streaming_enabled() -> tuple[bool, Optional[str]]:
"""
General purpose helper for determining if the environment can support S3 DANDI streaming.
Expand Down

0 comments on commit 814907c

Please sign in to comment.