Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds tiff files when using images.fromtif default 'tif extension #357

Merged
merged 6 commits into from
Sep 7, 2016

Conversation

boazmohar
Copy link
Contributor

Solves #341
@freeman-lab What is a good default behavior as this is implemented now, it will not enable you to select either tif or tiff from your folders.
I could change the default ext='tif' to `'ext='tifs' to make it possible, What do you think?
Also didn't test with s3, any thoughts as to how?

@freeman-lab
Copy link
Member

freeman-lab commented Aug 20, 2016

Cool @boazmohar ! I agree this would be good to support, another idea might be to just say if either tif or tiff is specified, we look for both of them? In other words, make it symmetric, whereas what you have only handles one of the cases. What do you think about that?

@@ -74,3 +74,24 @@ def test_local_recursive_nested(tmpdir):
make(tmpdir, filenames)
actual = LocalFileReader().list(str(tmpdir), recursive=True)
assert parse(actual) == expected

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should probably be in test_images_io.py, the test_readers.py are for testing generic io functionality relevant to all data types

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried moving them but I would need to either import the make and parse functions or copy paste them into test_images_io.py. I think they belong in the test_readers.py that is the main function that I changed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, that's fine then.

@freeman-lab
Copy link
Member

freeman-lab commented Aug 20, 2016

For testing on s3, you could at least make sure thunder.images.fromexample('fish') works for you after this change, that loads tif files from s3 with the default settings. BTW we don't include that one in the test suits because it takes extra time and requires a network connection.

@boazmohar
Copy link
Contributor Author

boazmohar commented Aug 20, 2016

@freeman-lab Sure I can make it symmetric but what about a case where someone wants only tif or only tiff files. If you are OK without these options I am too. I thought to have a default of 'tifs' and that would be 'symmetric' as it will include tif and tiff. Specifying another extension will work as expected.
Tell me what you prefer, I don't have a strong opinion either way.

@boazmohar
Copy link
Contributor Author

@freeman-lab fish example is working. Thanks.

@freeman-lab
Copy link
Member

Ah, totally see where you were coming from, I think my call would be to just make it symmetric, as both extensions really do fundamentally specify the same format (see e.g. http://superuser.com/questions/287776/differences-between-tiff-tif-tiff-tif), and it seems very unusual for people to have both in the same location.

@boazmohar
Copy link
Contributor Author

@freeman-lab Thanks for the feedback, ready to merge in my opinion.

@freeman-lab
Copy link
Member

ok great @boazmohar , merging this in!

@freeman-lab freeman-lab merged commit 967ff8f into thunder-project:master Sep 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants