Skip to content

Commit

Permalink
added pre-commit (pyest)
Browse files Browse the repository at this point in the history
  • Loading branch information
palash018 committed Aug 4, 2024
1 parent dc7f92d commit f94fb6d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
pull_request:
branches: "**"

env:
OMR_CHECKER_CONTAINER: true

jobs:
pre-commit:
runs-on: ubuntu-latest
Expand Down
11 changes: 8 additions & 3 deletions src/utils/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import cv2
from matplotlib import pyplot
from screeninfo import get_monitors

from screeninfo import Monitor, get_monitors
import os
from src.utils.constants import WAIT_KEYS
from src.utils.drawing import DrawingUtils
from src.utils.image import ImageUtils
Expand All @@ -13,7 +13,10 @@
@dataclass
class ImageMetrics:
# TODO: fix window metrics doesn't account for the doc/taskbar on macos
monitor_window = get_monitors()[0]
if os.environ.get("OMR_CHECKER_CONTAINER"):
monitor_window = Monitor(0, 0, 1000, 1000, 100, 100, "FakeMonitor", False)
else:
monitor_window = get_monitors()[0]
window_width, window_height = monitor_window.width, monitor_window.height
# for positioning image windows
window_x, window_y = 0, 0
Expand Down Expand Up @@ -112,6 +115,8 @@ def show(
config=None,
):
image_metrics = InteractionUtils.image_metrics
if os.environ.get("OMR_CHECKER_CONTAINER"):
return
if image is None:
logger.warning(f"'{name}' - NoneType image to show!")
if pause:
Expand Down

0 comments on commit f94fb6d

Please sign in to comment.