Skip to content

Commit

Permalink
fix type dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed Aug 2, 2024
1 parent 138c225 commit e6dd1af
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions sleap/util.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"""A miscellaneous set of utility functions.
"""A miscellaneous set of utility functions.
Try not to put things in here unless they really have no other place.
"""

from __future__ import annotations

import base64
import json
import os
Expand All @@ -11,31 +13,34 @@
from collections import defaultdict
from io import BytesIO
from pathlib import Path
from typing import Any, Dict, Hashable, Iterable, List, Optional
from typing import TYPE_CHECKING, Any, Dict, Hashable, Iterable, List, Optional
from urllib.parse import unquote, urlparse
from urllib.request import url2pathname
import rich.progress

try:
from importlib.resources import files # New in 3.9+
except ImportError:
from importlib_resources import files # TODO(LM): Upgrade to importlib.resources.

import attr
import h5py as h5
import numpy as np
import psutil
import rapidjson
import rich.progress
import yaml

try:
from importlib.resources import files # New in 3.9+
except ImportError:
from importlib_resources import files # TODO(LM): Upgrade to importlib.resources.
from PIL import Image

import sleap.version as sleap_version

if TYPE_CHECKING:
from rich.progress import Task


class RateColumn(rich.progress.ProgressColumn):
"""Renders the progress rate."""

def render(self, task: "Task") -> rich.progress.Text:
def render(self, task: Task) -> rich.progress.Text:
"""Show progress rate."""
speed = task.speed
if speed is None:
Expand Down

0 comments on commit e6dd1af

Please sign in to comment.