Skip to content

Commit b320f7b

Browse files
committed
packaging
1 parent 87322a8 commit b320f7b

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ __pycache__/
2020
patches/
2121

2222
\.DS_Store
23+
24+
\.pytest_cache/v/cache/
25+
26+
dist/
27+
28+
wsisampler\.egg-info/

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='wsisampler',
8-
version='0.0.1',
8+
version='0.0.2',
99
description='A package for WSI sampling.',
1010
long_description=readme,
1111
author='Peter Byfield',
@@ -18,7 +18,9 @@
1818
'matplotlib',
1919
'jupyter',
2020
'future',
21-
'cython'
21+
'cython',
22+
'pandas',
23+
'scikit-image'
2224
],
2325
classifiers=[
2426
# Specify the Python versions you support here. In particular, ensure

wsisampler/misc.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def level_converter(wsi, x, lvl_in, lvl_out):
6464
"""
6565
return int(x * wsi.level_downsamples[lvl_in] / wsi.level_downsamples[lvl_out])
6666

67+
6768
def get_level(mag, mags, threshold=0.01):
6869
"""
6970
Get the level closest to a specified magnification.
@@ -111,8 +112,3 @@ def save_patchframe_patches(input, save_dir=os.path.join(os.getcwd(), 'patches')
111112
patch = get_patch_from_info_dict(info)
112113
filename = os.path.join(save_dir, 'p{}_class_{}_from_{}.png'.format(i, info['class'], info['id']))
113114
patch.save(filename)
114-
115-
116-
if __name__ == '__main__':
117-
x = [2, 5, 4, 3, 0, 0]
118-
assert index_last_non_zero(x) == 3

wsisampler_tests/__init__.py

Whitespace-only changes.

wsisampler_tests/test_misc.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from wsisampler.misc import *
2+
3+
4+
def test_index_last_non_zero():
5+
x = [2, 5, 4, 3, 0, 0]
6+
assert index_last_non_zero(x) == 3
7+
x = [2, 5, 4, 3, 7, 0]
8+
assert index_last_non_zero(x) == 4

0 commit comments

Comments
 (0)