Refactor function `_sift_read` in `skimage/io/sift.py` to use context manager #2439

Open
soupault opened this Issue Jan 8, 2017 · 2 comments

Projects

None yet

2 participants

@soupault
Member
soupault commented Jan 8, 2017

Description

Refactor function _sift_read in skimage/io/sift.py to use context manager for file handling.

See the discussion in #2404.

@souravsingh
Contributor

@soupault I would like to take a stab at the issue. We have to unify the if-else in the function to make use of context manager to load the file, correct?

@soupault
Member
soupault commented Jan 9, 2017

@souravsingh That's correct. What we'd like to see is a function which handles file-objects carefully (this block worries me a lot -> https://github.com/stefanv/scikit-image/blob/6e0f66099439f7ecb970d84176ae4d19f162aa89/skimage/io/sift.py#L47-L48).
Any other enhancements to the function are, of course, very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment