Skip to content

Commit

Permalink
packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter554 committed May 17, 2018
1 parent 87322a8 commit b320f7b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ __pycache__/
patches/

\.DS_Store

\.pytest_cache/v/cache/

dist/

wsisampler\.egg-info/
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='wsisampler',
version='0.0.1',
version='0.0.2',
description='A package for WSI sampling.',
long_description=readme,
author='Peter Byfield',
Expand All @@ -18,7 +18,9 @@
'matplotlib',
'jupyter',
'future',
'cython'
'cython',
'pandas',
'scikit-image'
],
classifiers=[
# Specify the Python versions you support here. In particular, ensure
Expand Down
6 changes: 1 addition & 5 deletions wsisampler/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def level_converter(wsi, x, lvl_in, lvl_out):
"""
return int(x * wsi.level_downsamples[lvl_in] / wsi.level_downsamples[lvl_out])


def get_level(mag, mags, threshold=0.01):
"""
Get the level closest to a specified magnification.
Expand Down Expand Up @@ -111,8 +112,3 @@ def save_patchframe_patches(input, save_dir=os.path.join(os.getcwd(), 'patches')
patch = get_patch_from_info_dict(info)
filename = os.path.join(save_dir, 'p{}_class_{}_from_{}.png'.format(i, info['class'], info['id']))
patch.save(filename)


if __name__ == '__main__':
x = [2, 5, 4, 3, 0, 0]
assert index_last_non_zero(x) == 3
Empty file added wsisampler_tests/__init__.py
Empty file.
8 changes: 8 additions & 0 deletions wsisampler_tests/test_misc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from wsisampler.misc import *


def test_index_last_non_zero():
x = [2, 5, 4, 3, 0, 0]
assert index_last_non_zero(x) == 3
x = [2, 5, 4, 3, 7, 0]
assert index_last_non_zero(x) == 4

0 comments on commit b320f7b

Please sign in to comment.