Skip to content

Commit

Permalink
some mypy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
carueda committed Apr 1, 2024
1 parent f87dc5b commit d576921
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
4 changes: 3 additions & 1 deletion pbp/json_generator/gen_abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Filename: metadata/generator/gen_abstract.py
# Description: Abstract class that captures sound wav metadata
from datetime import datetime
from typing import List

import pandas as pd
from pbp.logging_helper import PbpLogger

Expand All @@ -12,7 +14,7 @@ def __init__(
logger: PbpLogger,
audio_loc: str,
json_base_dir: str,
prefix: [str],
prefix: List[str],
start: datetime,
end: datetime,
seconds_per_file: float = 0.0,
Expand Down
4 changes: 3 additions & 1 deletion pbp/json_generator/gen_iclisten.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import re
from datetime import timedelta
from datetime import datetime
from typing import List

import boto3

import pandas as pd
Expand All @@ -27,7 +29,7 @@ def __init__(
json_base_dir: str,
start: datetime,
end: datetime,
prefix: [str],
prefix: List[str],
seconds_per_file: float = 300.0,
):
"""
Expand Down
4 changes: 3 additions & 1 deletion pbp/json_generator/gen_nrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import re
from datetime import timedelta, datetime
import time
from typing import List

from google.cloud import storage

import pandas as pd
Expand All @@ -25,7 +27,7 @@ def __init__(
json_base_dir: str,
start: datetime,
end: datetime,
prefix: [str],
prefix: List[str],
seconds_per_file: float = 14400.0,
):
"""
Expand Down
3 changes: 2 additions & 1 deletion pbp/json_generator/gen_soundtrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Filename: json_generator/gen_soundtrap.py
# Description: Captures SoundTrap metadata either from a local directory of S3 bucket
import logging
from typing import List

import boto3
import datetime
Expand Down Expand Up @@ -34,7 +35,7 @@ def __init__(
pbp_logger: PbpLogger,
uri: str,
json_base_dir: str,
prefix: [str],
prefix: List[str],
start: datetime,
end: datetime,
):
Expand Down
3 changes: 2 additions & 1 deletion pbp/json_generator/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from typing import Tuple
from urllib.parse import urlparse


def parse_s3_or_gcp_url(url) -> (str, str, str):
def parse_s3_or_gcp_url(url) -> Tuple[str, str, str]:
"""
Parse the S3, GS of local file url
:param url:
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ ignore_missing_imports = true
exclude = [
'examples/',
'pbp/plotting\.py',
'pbp/json_generator/',
'tests/test_json_generator.py',
'pbp/json_generator/metadata.*\.py',
'pbp/json_generator/corrector\.py',
'pbp/json_generator/gen_soundtrap\.py',
'pbp/json_generator/gen_nrs\.py',
]

[tool.ruff]
Expand Down

0 comments on commit d576921

Please sign in to comment.