Skip to content

Commit

Permalink
fix: fix coverage issues and grepping for slow imports
Browse files Browse the repository at this point in the history
  • Loading branch information
joanise committed Jan 4, 2024
1 parent 2fcb653 commit 01ff75e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
echo "CLI load time: $CLI_LOAD_TIME" > import-message.txt
echo "PR head ${{ github.event.pull_request.head.sha }}" >> import-message.txt
echo "Imports that take more than 0.1 s:" >> import-message.txt
grep -E 'cumulative|[0-9]{6}' importtime.txt >> import-message.txt
grep -E 'cumulative|[0-9]{6} ' importtime.txt >> import-message.txt
if [[ "$CLI_LOAD_TIME" > "0:01.00" ]]; then \
echo "ERROR: g2p --help is too slow."; \
echo "Please run 'PYTHONPROFILEIMPORTTIME=1 g2p -h 2> importtime.txt; tuna importtime.txt' and tuck away expensive imports so that the CLI doesn't load them until it uses them."; \
Expand Down
6 changes: 3 additions & 3 deletions g2p/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class BaseTransducer(ABC):

@abstractmethod
def __call__(self, to_convert: str):
pass
"""Transduce to_convert."""


class BaseTransductionGraph(ABC):
Expand All @@ -32,12 +32,12 @@ class BaseTransductionGraph(ABC):
@property
@abstractmethod
def tiers(self):
pass
"""A list of BaseTransductionGraph objects for each tier in the graph."""


class BaseTokenizer(ABC):
"""Base class to typecheck tokenizers without having to import them."""

@abstractmethod
def tokenize_text(self, text):
pass
"""Tokenize text."""

0 comments on commit 01ff75e

Please sign in to comment.