Skip to content
This repository has been archived by the owner on Apr 16, 2023. It is now read-only.

Commit

Permalink
Allow capitalized extensions, add basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gsganden committed Aug 3, 2019
1 parent 6908a84 commit 01d2582
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -98,6 +98,10 @@ tar -xvf $(pwd)/data/${FILENAME} -C $(pwd)/data/

A third dataset from the Lincoln Park Zoo's Urban Wildlife Institute contains unlabeled three-image bursts from 2018. It takes up 5.7GB uncompressed. To get this data, follow the same steps as for the 2012-2014 dataset, but replace `FILENAME=lpz_2016_2017_processed.tar.gz` with `FILENAME=lpz_2018.tar.gz`.

## Running Tests

To test the app, run `pip install -r requirements-dev.txt` and then `pytest`. The tests assume that the app is running locally on port `8000` according to the instructions above.``

## Example Images

![buck](./gallery/buck.jpeg)
Expand Down
3 changes: 2 additions & 1 deletion autofocus/predict/app/utils.py
@@ -1,3 +1,4 @@
from pathlib import Path
from zipfile import ZipFile


Expand All @@ -11,7 +12,7 @@ def allowed_file(filename, allowed_extensions):
bool: whether the filename is in allowed extensions
"""
return "." in filename and filename.rsplit(".", 1)[1] in allowed_extensions
return Path(filename).suffix.lower().replace(".", "") in allowed_extensions


def list_zip_files(path):
Expand Down
6 changes: 6 additions & 0 deletions requirements-dev.txt
@@ -0,0 +1,6 @@
black
flake8
flake8-docstrings
flake8-import-order
pydocstyle<4.0.0
pytest
3 changes: 0 additions & 3 deletions tests/test_dummy.py

This file was deleted.

0 comments on commit 01d2582

Please sign in to comment.