Skip to content

Commit

Permalink
Use Path instead of pathlib.Path
Browse files Browse the repository at this point in the history
and sort imports and remove unused imports
  • Loading branch information
roomrys committed Dec 18, 2024
1 parent d158633 commit 69b6273
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions sleap/gui/dataviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,17 @@
"""

from qtpy import QtCore, QtWidgets, QtGui

import numpy as np
import os
import pathlib

from operator import itemgetter
from pathlib import Path
from typing import Any, Callable, List, Optional

from typing import Any, Callable, Dict, List, Optional, Type
import numpy as np
from qtpy import QtCore, QtGui, QtWidgets

from sleap.gui.state import GuiState
from sleap.gui.commands import CommandContext
from sleap.gui.color import ColorManager
from sleap.io.dataset import Labels
from sleap.instance import LabeledFrame, Instance
from sleap.gui.state import GuiState
from sleap.instance import LabeledFrame
from sleap.skeleton import Skeleton


Expand Down Expand Up @@ -401,10 +397,10 @@ def item_to_data(self, obj, item: "Video"):
for property in self.properties:
if property == "name":
filename = getattr(item, "filename")
data[property] = pathlib.Path(filename).name
data[property] = Path(filename).name
elif property == "filepath":
filename = getattr(item, "filename")
data[property] = str(pathlib.Path(filename).parent)
data[property] = str(Path(filename).parent)
else:
data[property] = getattr(item, property)
return data
Expand Down

0 comments on commit 69b6273

Please sign in to comment.