-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix transform to rename labels * Fix openslide backend vendor call
- Loading branch information
1 parent
c6bbf1c
commit c418cad
Showing
6 changed files
with
46 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
include CONTRIBUTING.rst | ||
include LICENSE | ||
include README.md | ||
include dlup/py.typed | ||
|
||
recursive-include tests * | ||
recursive-exclude * __pycache__ | ||
recursive-exclude * *.py[co] | ||
|
||
recursive-include docs *.rst *.md conf.py Makefile make.bat *.jpg *.png *.gif *.typed | ||
recursive-include docs *.rst *.md conf.py Makefile make.bat *.jpg *.png *.gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,6 @@ replace = {new_version} | |
|
||
[aliases] | ||
test = pytest | ||
|
||
[options.package_data] | ||
dlup = py.typed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# coding=utf-8 | ||
# Copyright (c) dlup contributors | ||
import pytest | ||
|
||
from dlup.data.transforms import AnnotationClass, AnnotationType, RenameLabels | ||
|
||
|
||
class Polygon: | ||
def __init__(self, coordinates, a_cls): | ||
self.coordinates = coordinates | ||
self.label = a_cls.label | ||
self.a_cls = a_cls | ||
|
||
|
||
class Point: | ||
def __init__(self, coordinates, a_cls): | ||
self.coordinates = coordinates | ||
self.label = a_cls.label | ||
self.a_cls = a_cls | ||
|
||
|
||
@pytest.fixture | ||
def remap_labels(): | ||
return {"old_label1": "new_label1", "old_label2": "new_label2"} | ||
|
||
|
||
@pytest.fixture | ||
def renamer(remap_labels): | ||
return RenameLabels(remap_labels) |